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

Commit 43f43d87 authored by Elliott Hughes's avatar Elliott Hughes Committed by Gerrit Code Review
Browse files

Merge "Move adb's selinux_android_restorecon up and check for failures."

parents e8e272c5 0adc0972
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;