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

Commit 0adc0972 authored by Elliott Hughes's avatar Elliott Hughes
Browse files

Move adb's selinux_android_restorecon up and check for failures.

Change-Id: Ib3ff282cf52df03f3b9a0abecf0abda99d7df641
parent e8e272c5
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -166,6 +166,11 @@ static bool handle_send_file(int s, const char* path, uid_t uid,
            goto fail;
        }

        if (selinux_android_restorecon(path, 0) == -1) {
            SendSyncFailErrno(s, "selinux_android_restorecon failed");
            goto fail;
        }

        // fchown clears the setuid bit - restore it if present.
        // Ignore the result of calling fchmod. It's not supported
        // by all filesystems. b/12441485
@@ -201,8 +206,6 @@ static bool handle_send_file(int s, const char* path, uid_t uid,

    adb_close(fd);

    selinux_android_restorecon(path, 0);

    utimbuf u;
    u.actime = timestamp;
    u.modtime = timestamp;