aboutsummaryrefslogtreecommitdiff
path: root/src/checkpath
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2023-01-15 15:31:25 -0500
committerMike Frysinger <vapier@gentoo.org>2023-01-15 15:31:25 -0500
commit6f444459586b5012717f37a3e51024b3abb224ec (patch)
tree02baaea079d82887adfcb70ce1f701f4b0b8a18e /src/checkpath
parent52dcb4aaa3ab1b9090e31545b38f495e551aaedc (diff)
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.
Diffstat (limited to 'src/checkpath')
-rw-r--r--src/checkpath/checkpath.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/checkpath/checkpath.c b/src/checkpath/checkpath.c
index 1ced7168..735be758 100644
--- a/src/checkpath/checkpath.c
+++ b/src/checkpath/checkpath.c
@@ -285,7 +285,7 @@ static int do_check(char *path, uid_t uid, gid_t gid, mode_t mode,
return -1;
}
- if (mode && (st.st_mode & 0777) != mode) {
+ if (mode && (st.st_mode & 07777) != mode) {
if ((type != inode_dir) && (st.st_nlink > 1)) {
eerror("%s: chmod: Too many hard links to %s", applet, path);
close(readfd);