>From f845b1742ce2f06dd8b6a6fe94e3881f7cd0ff4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Va=C5=A1=C3=ADk?=
Date: Mon, 5 Mar 2012 10:34:13 +0100 Subject: [PATCH] modechange: Allow cleaning of special bits on dirs when requested As discussed in coreutils bug #8391 and rhbz #691466, some users miss the functionality of cleaning set user id and set group id dir bits by exact octal mode. This functionality was removed by 4e3c4c0478e6e1e81f093b80d8272840a39ca2bd gnulib commit and this patch allows it for 5+ digits octal modes or octal modes preceeded by "@" character. * lib/modechange.c: Allow cleaning of special bits on dirs. (enum): Add new mode flag - MODE_EXACT_CHANGE. (mode_compile): Use MODE_EXACT_CHANGE for 5+ digits octals and octal mode preceeded by @. (mode_adjust): Don't mask the special bit change for MODE_EXACT_CHANGE. --- ChangeLog | 8 ++++++++ lib/modechange.c | 21 ++++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4ec700f..54b9ffb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2012-03-04 Ondrej Vasik + modechange: Allow cleaning of special bits on dirs when requested + * lib/modechange.c: Allow cleaning of special bits on dirs. + (enum): Add new mode flag - MODE_EXACT_CHANGE. + (mode_compile): Use MODE_EXACT_CHANGE for 5+ digits octals and octal + mode preceeded by @. + (mode_adjust): Don't mask the special bit change for MODE_EXACT_CHANGE. + 2012-03-04 Bruno Haible sqrt* tests: More tests. diff --git a/lib/modechange.c b/lib/modechange.c index 4ae90ca..a4741ac 100644 --- a/lib/modechange.c +++ b/lib/modechange.c @@ -32,6 +32,7 @@ #include "stat-macros.h" #include "xalloc.h" #include