commit 71ba97c175c805ab1e473c62a9581073cc791b66
parent 4f1d0df755e6eb85630380c3e77f0584eedf0627
Author: Michael Forney <mforney@mforney.org>
Date: Fri, 1 Nov 2019 01:58:54 -0700
chmod: Clear the S_IFMT bits before calling chmod
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/chmod.c b/chmod.c
@@ -13,7 +13,7 @@ chmodr(const char *path, struct stat *st, void *data, struct recursor *r)
{
mode_t m;
- m = parsemode(modestr, st->st_mode, mask);
+ m = parsemode(modestr, st->st_mode & ~S_IFMT, mask);
if (chmod(path, m) < 0) {
weprintf("chmod %s:", path);
ret = 1;