aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
Diffstat (limited to 'toys')
-rw-r--r--toys/posix/chmod.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/posix/chmod.c b/toys/posix/chmod.c
index 42924399..572dff6a 100644
--- a/toys/posix/chmod.c
+++ b/toys/posix/chmod.c
@@ -43,7 +43,7 @@ static int do_chmod(struct dirtree *try)
{
mode_t mode;
- if (!dirtree_notdotdot(try)) return 0;
+ if (try->parent && !dirtree_notdotdot(try)) return 0;
mode = string_to_mode(TT.mode, try->st.st_mode);
if (toys.optflags & FLAG_v) {