bug-coreutils
[Top][All Lists]
Advanced

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

bug#11043: chmod - new feature - restore default mode regarding the umas


From: Julien Blitte
Subject: bug#11043: chmod - new feature - restore default mode regarding the umask value
Date: Sun, 18 Mar 2012 21:31:02 +0100

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

Attachment: chmod-umask-coreutils.patch.gz
Description: GNU Zip compressed data

Attachment: chmod-umask-gnulib.patch.gz
Description: GNU Zip compressed data


reply via email to

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