Skip to content

Commit 6f44445

Browse files
committed
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.
1 parent 52dcb4a commit 6f44445

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/checkpath/checkpath.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ static int do_check(char *path, uid_t uid, gid_t gid, mode_t mode,
285285
return -1;
286286
}
287287

288-
if (mode && (st.st_mode & 0777) != mode) {
288+
if (mode && (st.st_mode & 07777) != mode) {
289289
if ((type != inode_dir) && (st.st_nlink > 1)) {
290290
eerror("%s: chmod: Too many hard links to %s", applet, path);
291291
close(readfd);

0 commit comments

Comments
 (0)