summaryrefslogtreecommitdiffstats
path: root/minadbd/adb.c
diff options
context:
space:
mode:
Diffstat (limited to 'minadbd/adb.c')
-rw-r--r--minadbd/adb.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/minadbd/adb.c b/minadbd/adb.c
index 127d072be..c35e8300b 100644
--- a/minadbd/adb.c
+++ b/minadbd/adb.c
@@ -38,6 +38,8 @@ int HOST = 0;
static const char *adb_device_banner = "sideload";
+char ADB_SIDELOAD_FILENAME[255];
+
void fatal(const char *fmt, ...)
{
va_list ap;
@@ -376,8 +378,9 @@ static void adb_cleanup(void)
usb_cleanup();
}
-int adb_main()
+int adb_main(const char* path)
{
+ strcpy(ADB_SIDELOAD_FILENAME, path);
atexit(adb_cleanup);
#if defined(HAVE_FORKEXEC)
// No SIGCHLD. Let the service subproc handle its children.
@@ -392,6 +395,19 @@ int adb_main()
usb_init();
}
+/* Remove this so that perms work properly
+ if (setgid(AID_SHELL) != 0) {
+ fprintf(stderr, "failed to setgid to shell\n");
+ exit(1);
+ }
+ if (setuid(AID_SHELL) != 0) {
+ fprintf(stderr, "failed to setuid to shell\n");
+ exit(1);
+ }
+
+ fprintf(stderr, "userid is %d\n", getuid());
+*/
+
D("Event loop starting\n");
fdevent_loop();