bug-coreutils
[Top][All Lists]
Advanced

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

enhancement request for gnu chmod


From: Doug McLaren
Subject: enhancement request for gnu chmod
Date: Mon, 2 Oct 2006 12:04:59 -0500
User-agent: Mutt/1.4.2.1i

It would be nice if gnu chmod had an option to set two sets of
permissions -- one for files and one for directories.  Or perhaps one
for directories and one for {everything else}?

For example, if you want to standardize the set of permissions in a
large directory tree, you could do this --

   chmod --recursive 755 /directory

but that would make files executable, which isn't really appopriate if
the files shouldn't be executable.  You could also do a 

   chmod --recursive 644 /directory

but that would create a directory structure that only root could
access, because the directories aren't executable.

Right now, the best way to do what I'm referring to is something like
this --

   find /directory -type d -print0 | xargs --no-run-if-empty -0 chmod 755
   find /directory '!' -type d '!' -type l -print0 | \
      xargs --no-run-if-empty -0 chmod 644

As an example of how the problem has been solved in other products,
rsync allows you to specify seperate permissions for directories and
files --

       --chmod
...
              In addition  to  the  normal  parsing  rules  specified  in  the
              chmod(1) manpage, you can specify an item that should only apply
              to a directory by prefixing it with a 'D', or  specify  an  item
              that  should  only  apply  to a file by prefixing it with a 'F'.
              For example:

              --chmod=Dg+s,ug+w,Fo-w,+X

I'm not sure if I like that, but it's one way of specifying things.

-- 
Doug McLaren, address@hidden
No fair! You changed the outcome by measuring it! --Prof Farnsworth





reply via email to

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