am 43f43d87: Merge "Move adb\'s selinux_android_restorecon up and check for failures."
* commit '43f43d8792ffc91df085a787feecdb0cfd225b47': Move adb's selinux_android_restorecon up and check for failures.
This commit is contained in:
commit
1ce12d397f
1 changed files with 8 additions and 5 deletions
|
|
@ -166,9 +166,14 @@ static bool handle_send_file(int s, const char* path, uid_t uid,
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
// fchown clears the setuid bit - restore it if present.
|
if (selinux_android_restorecon(path, 0) == -1) {
|
||||||
// Ignore the result of calling fchmod. It's not supported
|
SendSyncFailErrno(s, "selinux_android_restorecon failed");
|
||||||
// by all filesystems. b/12441485
|
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
|
||||||
fchmod(fd, mode);
|
fchmod(fd, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue