When in -U mode do avoid setting SUID bits, but do not modify the mode
variable so the intended mode can be logged correctly if -M is specified. Sponsored by: DARPA, AFRL
This commit is contained in:
parent
4b6b0f4163
commit
7a06a9247d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=246147
@ -953,9 +953,8 @@ install(const char *from_name, const char *to_name, u_long fset, u_int flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mode != (to_sb.st_mode & ALLPERMS)) {
|
if (mode != (to_sb.st_mode & ALLPERMS)) {
|
||||||
if (dounpriv)
|
if (fchmod(to_fd,
|
||||||
mode &= S_IRWXU|S_IRWXG|S_IRWXO;
|
dounpriv ? mode & (S_IRWXU|S_IRWXG|S_IRWXO) : mode)) {
|
||||||
if (fchmod(to_fd, mode)) {
|
|
||||||
serrno = errno;
|
serrno = errno;
|
||||||
(void)unlink(to_name);
|
(void)unlink(to_name);
|
||||||
errno = serrno;
|
errno = serrno;
|
||||||
|
Loading…
Reference in New Issue
Block a user