rm -rf needs to chmod directories to u+rwx, because directories need +x to search.
authorIsaac Dunham <ibid.ag@gmail.com>
Thu, 18 Sep 2014 18:05:21 +0000 (13:05 -0500)
committerIsaac Dunham <ibid.ag@gmail.com>
Thu, 18 Sep 2014 18:05:21 +0000 (13:05 -0500)
(Fixes messages about not being able to delete directories when running make test).

toys/posix/rm.c

index 6c98404..9561a67 100644 (file)
@@ -49,7 +49,7 @@ static int do_rm(struct dirtree *try)
   if (dir) {
     // Handle chmod 000 directories when -f
     if (faccessat(fd, try->name, R_OK, AT_SYMLINK_NOFOLLOW)) {
-      if (toys.optflags & FLAG_f) wfchmodat(fd, try->name, 0600);
+      if (toys.optflags & FLAG_f) wfchmodat(fd, try->name, 0700);
       else goto skip;
     }
     if (!try->again) return DIRTREE_COMEAGAIN;