checkpath: add missing sticky/set*id mode bits to check
We incorrectly masked out the upper 3 bits when checking to see if the permissions need updating leading us to run chmod when not needed. Fixes #482.
This commit is contained in:
parent
52dcb4aaa3
commit
6f44445958
@ -285,7 +285,7 @@ static int do_check(char *path, uid_t uid, gid_t gid, mode_t mode,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode && (st.st_mode & 0777) != mode) {
|
if (mode && (st.st_mode & 07777) != mode) {
|
||||||
if ((type != inode_dir) && (st.st_nlink > 1)) {
|
if ((type != inode_dir) && (st.st_nlink > 1)) {
|
||||||
eerror("%s: chmod: Too many hard links to %s", applet, path);
|
eerror("%s: chmod: Too many hard links to %s", applet, path);
|
||||||
close(readfd);
|
close(readfd);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user