From 6b8f01f8cb4094e1e45db72bfae7cfefad273525 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 15 Oct 2012 19:37:34 +0200 Subject: [PATCH 3/3] chcon: add descriptions for three undocumented options * src/chcon.c (usage): Mention the two --preserve-root options. * doc/coreutils.texi (chcon invocation): Plus the --dereferece option. --- doc/coreutils.texi | 20 ++++++++++++++++++-- src/chcon.c | 6 ++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/doc/coreutils.texi b/doc/coreutils.texi index cac66a4..9486eb2 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -1384,7 +1384,7 @@ legitimate uses for such a command, that resolves to @file{/}. If you really want to try to remove all the files on your system, you can use the @option{--no-preserve-root} option, but the default behavior, specified by the address@hidden, is safer for most purposes. address@hidden option, is safer for most purposes. The commands @command{chgrp}, @command{chmod} and @command{chown} can also operate destructively on entire hierarchies, so they too @@ -15190,12 +15190,16 @@ The program accepts the following options. Also see @ref{Common options}. @table @samp address@hidden --dereference address@hidden --dereference +Do not affect symbolic links but what they refer to; this is the default. + @item -h @itemx --no-dereference @opindex -h @opindex --no-dereference @cindex no dereference -Affect symbolic links instead of any referenced file. +Affect the symbolic links themselves instead of any referenced file. @item address@hidden @opindex --reference @@ -15208,6 +15212,18 @@ Use @var{rfile}'s security context rather than specifying a @var{context} value. @opindex --recursive Operate on files and directories recursively. address@hidden --preserve-root address@hidden --preserve-root +Refuse to operate recursively on the root directory, @file{/}, +when used together with the @option{--recursive} option. address@hidden / specially}. + address@hidden --no-preserve-root address@hidden --no-preserve-root +Do not treat the root directory, @file{/}, specially when operating +recursively; this is the default. address@hidden / specially}. + @choptH @xref{Traversing symlinks}. diff --git a/src/chcon.c b/src/chcon.c index 34e92e4..c0eec51 100644 --- a/src/chcon.c +++ b/src/chcon.c @@ -378,6 +378,12 @@ With --reference, change the security context of each FILE to that of RFILE.\n\ -R, --recursive operate on files and directories recursively\n\ "), stdout); fputs (_("\ + --preserve-root refuse to operate recursively on the root directory\n\ +"), stdout); + fputs (_("\ + --no-preserve-root do not treat the root directory specially (default)\n\ +"), stdout); + fputs (_("\ -v, --verbose output a diagnostic for every file processed\n\ "), stdout); fputs (_("\ -- 1.7.0.4