summaryrefslogtreecommitdiffstats
path: root/src/deviceinterfaced.h
diff options
context:
space:
mode:
authorGravatar Peter A2026-08-22 17:07:04 +0200
committerGravatar Nikias Bassen2026-09-07 01:46:30 +0200
commit35dee10f82711101a7d30d03f0ec781ac23221e9 (patch)
tree48098a59895ff0fe346dcbe7ae928ad06b4c0c56 /src/deviceinterfaced.h
parentd9aa264b673fdd14fc0cb7f7daa1b9127ede4916 (diff)
downloadidevicerestore-35dee10f82711101a7d30d03f0ec781ac23221e9.tar.gz
idevicerestore-35dee10f82711101a7d30d03f0ec781ac23221e9.tar.bz2
macOS: Avoid deviceinterfaced races during DFU reconnect
During Port DFU-to-DFU re-enumeration, macOS deviceinterfaced daemon can acquire the USB interface first, making idevicerestore time out waiting for DFU reconnection. Add experimental flag: --exclusive-usb that keeps deviceinterfaced from claiming the USB device for the duration of the restore, by booting it out or repeatedly terminating it when bootout is denied (SIP on), then reloading and starting it again on exit. idevicerestore itself does not need to run as root for this. Only the launchctl subcommands that manage the system-domain deviceinterfaced daemon (bootout, bootstrap, kickstart, kill) are elevated individually via sudo, which may prompt for a password on the controlling terminal. Read-only queries (print) are run unprivileged. Document how to allow these specific commands via a scoped sudoers(5) NOPASSWD rule for unattended use. Co-authored-by: Nikias Bassen <nikias@gmx.li>
Diffstat (limited to 'src/deviceinterfaced.h')
-rw-r--r--src/deviceinterfaced.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/deviceinterfaced.h b/src/deviceinterfaced.h
new file mode 100644
index 0000000..c8623ad
--- /dev/null
+++ b/src/deviceinterfaced.h
@@ -0,0 +1,28 @@
+/*
+ * deviceinterfaced.h
+ * Control deviceinterfaced while accessing restore devices on macOS
+ *
+ * Copyright (c) 2026 libimobiledevice contributors. All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef DEVICEINTERFACED_H
+#define DEVICEINTERFACED_H
+
+int deviceinterfaced_control_start(void);
+void deviceinterfaced_control_stop(void);
+
+#endif