ACLs and cp

Casey Schaufler casey at sgi.com
Thu Jan 13 18:36:20 GMT 2000


Andreas Gruenbacher wrote:

> DS17 specifies that these tools retain the ACLs of files. Now how does the umask
> affect the behavior (and how does a default ACL)? Should cp simply copy the
> permissions 1-1, or should it copy the permissions, minus those masked out by
> the umask?
> 
> The GNU fileutils do a chmod() with the umask bits masked out after copying:
> 
>   > umask
>   022
>   > ls -l x
>   -rw-rw-rw-   1 agruenba users           0 Jan 13 01:00 x
>   > cp x y
>   > ls -l y
>   -rw-r--r--   1 agruenba users           0 Jan 13 01:05 y

What to do regarding the attributes on a file that's cp'ed
has always been contentious. The general rule for POSIX has
been to preserve attributes with mv but to use them as guidence
in cp. For example, the execute bits are preserved, but the
umask is applied. For ACLs, it's probably best to either drop
the ACL completely or preserve it without change. Remember that
the 1e mechanism is designed to integrate well with the traditional
mode bit behaviours. Applying the umask to the mode bit ought
to suffice.

-- 

Casey Schaufler                         voice: (650) 933-1634
casey at sgi.com                           fax:   (650) 933-0170
To Unsubscribe: send mail to majordomo at cyrus.watson.org
with "unsubscribe posix1e" in the body of the message



More information about the posix1e mailing list