diff options
| author | 2013-09-19 21:47:44 +0200 | |
|---|---|---|
| committer | 2013-09-19 21:47:44 +0200 | |
| commit | 7de9ac3ed900701fd2fafb2e0c006b56f18672d7 (patch) | |
| tree | bbf7c0bd28b387c39362ce961017ff04e2b4a48b | |
| parent | 130d1ca4d5d99ef4a470e90db64116a0de55b43e (diff) | |
| download | usbmuxd-7de9ac3ed900701fd2fafb2e0c006b56f18672d7.tar.gz usbmuxd-7de9ac3ed900701fd2fafb2e0c006b56f18672d7.tar.bz2 | |
preflight: Use userpref_get_system_buid() instead of hardcoded path
| -rw-r--r-- | src/main.c | 5 | ||||
| -rw-r--r-- | src/preflight.c | 6 | ||||
| -rw-r--r-- | src/preflight.h | 1 |
3 files changed, 7 insertions, 5 deletions
| @@ -47,9 +47,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |||
| 47 | #include "device.h" | 47 | #include "device.h" |
| 48 | #include "client.h" | 48 | #include "client.h" |
| 49 | 49 | ||
| 50 | extern const char* userpref_get_config_dir(); | ||
| 51 | |||
| 50 | static const char *socket_path = "/var/run/usbmuxd"; | 52 | static const char *socket_path = "/var/run/usbmuxd"; |
| 51 | static const char *lockfile = "/var/run/usbmuxd.pid"; | 53 | static const char *lockfile = "/var/run/usbmuxd.pid"; |
| 52 | static const char *userprefdir = "/var/lib/lockdown"; | ||
| 53 | 54 | ||
| 54 | int should_exit; | 55 | int should_exit; |
| 55 | int should_discover; | 56 | int should_discover; |
| @@ -529,6 +530,8 @@ int main(int argc, char *argv[]) | |||
| 529 | if(listenfd < 0) | 530 | if(listenfd < 0) |
| 530 | goto terminate; | 531 | goto terminate; |
| 531 | 532 | ||
| 533 | const char* userprefdir = userpref_get_config_dir(); | ||
| 534 | |||
| 532 | struct stat fst; | 535 | struct stat fst; |
| 533 | int userprefdir_created = 0; | 536 | int userprefdir_created = 0; |
| 534 | if (stat(userprefdir, &fst) < 0) { | 537 | if (stat(userprefdir, &fst) < 0) { |
diff --git a/src/preflight.c b/src/preflight.c index ec510ec..17748c6 100644 --- a/src/preflight.c +++ b/src/preflight.c | |||
| @@ -49,8 +49,6 @@ struct idevice_private { | |||
| 49 | void *conn_data; | 49 | void *conn_data; |
| 50 | }; | 50 | }; |
| 51 | 51 | ||
| 52 | extern void userpref_get_system_buid(char **systembuid); | ||
| 53 | |||
| 54 | struct np_cb_data { | 52 | struct np_cb_data { |
| 55 | idevice_t dev; | 53 | idevice_t dev; |
| 56 | np_client_t np; | 54 | np_client_t np; |
| @@ -194,9 +192,9 @@ static void* preflight_worker_handle_device_add(void* userdata) | |||
| 194 | struct np_cb_data cbdata; | 192 | struct np_cb_data cbdata; |
| 195 | cbdata.dev = dev; | 193 | cbdata.dev = dev; |
| 196 | cbdata.np = np; | 194 | cbdata.np = np; |
| 197 | 195 | ||
| 198 | np_set_notify_callback(np, np_callback, (void*)&cbdata); | 196 | np_set_notify_callback(np, np_callback, (void*)&cbdata); |
| 199 | 197 | ||
| 200 | const char* spec[] = { | 198 | const char* spec[] = { |
| 201 | "com.apple.mobile.lockdown.request_pair", | 199 | "com.apple.mobile.lockdown.request_pair", |
| 202 | "com.apple.mobile.lockdown.request_host_buid", | 200 | "com.apple.mobile.lockdown.request_host_buid", |
diff --git a/src/preflight.h b/src/preflight.h index 045a5e9..62349d1 100644 --- a/src/preflight.h +++ b/src/preflight.h | |||
| @@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |||
| 23 | 23 | ||
| 24 | #include "device.h" | 24 | #include "device.h" |
| 25 | 25 | ||
| 26 | extern void userpref_get_system_buid(char **systembuid); | ||
| 26 | extern void userpref_device_record_get_host_id(const char *udid, char **host_id); | 27 | extern void userpref_device_record_get_host_id(const char *udid, char **host_id); |
| 27 | 28 | ||
| 28 | void preflight_worker_device_add(struct device_info* info); | 29 | void preflight_worker_device_add(struct device_info* info); |
