bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

--preserve-root option of chown, chmod, etc. warns but does not exit whe


From: Matthew M. Boedicker
Subject: --preserve-root option of chown, chmod, etc. warns but does not exit when running on / with recursion
Date: Tue, 12 Dec 2006 12:33:22 -0500
User-agent: Mutt/1.5.11

Hope this is not a dupe. I sent this before I subscribed but it didn't seem
to go through.

The --preserve-root failsafe in chown, chmod, etc. does not exit when it
should. It prints a warning and continues to recurse. ROOT_DEV_INO_WARN
should pass a non-zero value as the first argument to error() to exit.

--- lib/root-dev-ino.h.orig     2006-12-12 10:47:22.000000000 -0500
+++ lib/root-dev-ino.h  2006-12-12 10:51:56.000000000 -0500
@@ -36,14 +36,14 @@
 # define ROOT_DEV_INO_WARN(Dirname)                                    \
   do                                                                   \
     {                                                                  \
+      error (0, 0, _("use --no-preserve-root to override this failsafe")); \
       if (STREQ (Dirname, "/"))                                                
\
-       error (0, 0, _("it is dangerous to operate recursively on %s"), \
+       error (EXIT_FAILURE, 0, _("it is dangerous to operate recursively on 
%s"),      \
               quote (Dirname));                                        \
       else                                                             \
-       error (0, 0,                                                    \
+       error (EXIT_FAILURE, 0,                                                 
\
               _("it is dangerous to operate recursively on %s (same as %s)"), \
               quote_n (0, Dirname), quote_n (1, "/"));                 \
-      error (0, 0, _("use --no-preserve-root to override this failsafe")); \
     }                                                                  \
   while (0)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]