Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 48704798 authored by Doug Zongker's avatar Doug Zongker
Browse files

run minadbd as shell user, remove unused code

Make minadbd drop its root privileges after initializing.  We need to
make the /tmp directory writable by the shell group so that it can
drop the sideloaded file there.
parent 45fdb389
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -15,6 +15,9 @@ on init
    mkdir /cache
    mount /tmp /tmp tmpfs

    chown root shell /tmp
    chmod 0775 /tmp

    write /sys/class/android_usb/android0/enable 0
    write /sys/class/android_usb/android0/idVendor 18D1
    write /sys/class/android_usb/android0/idProduct D001
+13 −1
Original line number Diff line number Diff line
@@ -4,16 +4,19 @@ the following changes:
adb.c
  - much support for host mode and non-linux OS's stripped out; this
    version only runs as adbd on the device.
  - does not setuid/setgid itself (always stays root)
  - always setuid/setgid's itself to the shell user
  - only uses USB transport
  - references to JDWP removed
  - main() removed
  - all ADB_HOST and win32 code removed
  - removed listeners, logging code, background server (for host)

adb.h
  - minor changes to match adb.c changes

sockets.c
  - references to JDWP removed
  - ADB_HOST code removed

services.c
  - all services except echo_service (which is commented out) removed
@@ -25,3 +28,12 @@ services.c
Android.mk
  - only builds in adbd mode; builds as static library instead of a
    standalone executable.

sysdeps.h
  - changes adb_creat() to use O_NOFOLLOW

transport.c
  - removed ADB_HOST code

transport_usb.c
  - removed ADB_HOST code
+10 −747

File changed.

Preview size limit exceeded, changes collapsed.

+1 −26

File changed.

Preview size limit exceeded, changes collapsed.

+1 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ static void sideload_service(int s, void *cookie)

    fd = adb_creat(ADB_SIDELOAD_FILENAME, 0644);
    if(fd < 0) {
        fprintf(stderr, "failed to create %s\n", ADB_SIDELOAD_FILENAME);
        adb_close(s);
        return;
    }
Loading