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

This commit is contained in:
Elliott Hughes 2015-08-25 20:26:59 +00:00 committed by Gerrit Code Review
commit 43f43d8792

View file

@ -166,6 +166,11 @@ static bool handle_send_file(int s, const char* path, uid_t uid,
goto fail; 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. // fchown clears the setuid bit - restore it if present.
// Ignore the result of calling fchmod. It's not supported // Ignore the result of calling fchmod. It's not supported
// by all filesystems. b/12441485 // 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); adb_close(fd);
selinux_android_restorecon(path, 0);
utimbuf u; utimbuf u;
u.actime = timestamp; u.actime = timestamp;
u.modtime = timestamp; u.modtime = timestamp;