From 7de9ac3ed900701fd2fafb2e0c006b56f18672d7 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Thu, 19 Sep 2013 21:47:44 +0200 Subject: preflight: Use userpref_get_system_buid() instead of hardcoded path --- src/main.c | 5 ++++- src/preflight.c | 6 ++---- src/preflight.h | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/main.c b/src/main.c index bb2eb2c..7ae3532 100644 --- a/src/main.c +++ b/src/main.c @@ -47,9 +47,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include "device.h" #include "client.h" +extern const char* userpref_get_config_dir(); + static const char *socket_path = "/var/run/usbmuxd"; static const char *lockfile = "/var/run/usbmuxd.pid"; -static const char *userprefdir = "/var/lib/lockdown"; int should_exit; int should_discover; @@ -529,6 +530,8 @@ int main(int argc, char *argv[]) if(listenfd < 0) goto terminate; + const char* userprefdir = userpref_get_config_dir(); + struct stat fst; int userprefdir_created = 0; 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 { void *conn_data; }; -extern void userpref_get_system_buid(char **systembuid); - struct np_cb_data { idevice_t dev; np_client_t np; @@ -194,9 +192,9 @@ static void* preflight_worker_handle_device_add(void* userdata) struct np_cb_data cbdata; cbdata.dev = dev; cbdata.np = np; - + np_set_notify_callback(np, np_callback, (void*)&cbdata); - + const char* spec[] = { "com.apple.mobile.lockdown.request_pair", "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 #include "device.h" +extern void userpref_get_system_buid(char **systembuid); extern void userpref_device_record_get_host_id(const char *udid, char **host_id); void preflight_worker_device_add(struct device_info* info); -- cgit v1.1-32-gdbae