GNU bug report logs - #11043
chmod - new feature - restore default mode regarding the umask value

Previous Next

Package: coreutils;

Reported by: Julien Blitte <julien.blitte <at> gmail.com>

Date: Mon, 19 Mar 2012 07:47:02 UTC

Severity: normal

Tags: fixed

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Julien Blitte <julien.blitte <at> gmail.com>
To: 11043 <at> debbugs.gnu.org
Subject: bug#11043: chmod - new feature - restore default mode regarding the umask value
Date: Sun, 18 Mar 2012 21:31:02 +0100
[Message part 1 (text/plain, inline)]
Hello,

I have used for a while a modified chmod for my own use, I think it could
be usefull to other people.
The option --umask is added to chmod to be used in order to restore default
mode to files and directories regarding the current umask value.

Attached, the up to date implementation (git format-patch)  for last
version of coreutils and gnulib.
It save some time for me.

Some use cases for this feature:
You have just changed your umask value and you want to update your home's
files:
$ umask 0027
$ chmod --umask --recursive ~

You are a beginer, you have performed mode changes - a mistake - a and you
want to restore default mode:
$ chmod 3106 my_file.ext
$ chmod --umask my_file.ext

You copied data from on other file system (e.g. usb key, ntfs) witch does
not support rigths
(and you forgot to mount with correct fmask / dmask options):
$ cp -R /media/usb/data_dir/ ~
$ chmod --umask --recursive ~/data_dir/

You are a system administrator and you want to reset users' files:
# umask 0022
# chmod --umask --recursive ~/home/*

etc.

Regards,
-- 
Julien Blitte
[Message part 2 (text/html, inline)]
[chmod-umask-coreutils.patch.gz (application/x-gzip, attachment)]
[chmod-umask-gnulib.patch.gz (application/x-gzip, attachment)]

This bug report was last modified 6 years and 278 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.