chmod.c: mask out the file type bits.
The kernel will do this for us on both Linux and macOS, but error messages are a bit misleading if we don't do it ourselves --- it can look as if the failure is because of the type bits.
This commit is contained in:
parent
83326334d5
commit
fbc2252f4f
@ -50,7 +50,7 @@ static int do_chmod(struct dirtree *try)
|
||||
// symlinks mentioned directly as arguments. We'll fail, of course,
|
||||
// but that's what you asked for in that case.
|
||||
} else {
|
||||
mode = string_to_mode(TT.mode, try->st.st_mode);
|
||||
mode = string_to_mode(TT.mode, try->st.st_mode & ~S_IFMT);
|
||||
if (FLAG(v)) {
|
||||
char *s = dirtree_path(try, 0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user