16.12.2012 Views

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Examples<br />

–x EntryOrFile<br />

Deletes the extended ACL entries specified by EntryOrFile. EntryOrFile is a<br />

string of ACL entries typed directly on the command line. If an ACL entry<br />

does not exist for the user or group specified, then you will not get an error.<br />

If the permissions field is provided in EntryOrFile, then it is ignored when<br />

this option is processed. Users cannot delete the base ACL entries (file<br />

owner, owning group, and others). If base ACL entries are specified with<br />

this option, they are ignored. Deleting an extended ACL entry does not<br />

necessarily have the same effect as removing all the permissions from an<br />

entry.<br />

–X EntryOrFile<br />

Deletes the extended ACL entries specified by EntryOrFile. EntryOrFile is a<br />

file containing ACL entries. If an ACL entry does not exist for the user or<br />

group specified, then you will not get an error. If EntryOrFile is –, then<br />

entries are read from stdin. If the permissions field is provided in<br />

EntryOrFile, then it is ignored when this option is processed. Users cannot<br />

delete the base ACL entries (file owner, owning group, and others). If base<br />

ACL entries are specified with this option, they are ignored. Deleting an<br />

extended ACL entry does not necessarily have the same effect as removing<br />

all the permissions from an entry.<br />

When you use setfacl to add, change and delete ACL entries, all deletion<br />

operations are performed first. In other words, deletion operations are processed<br />

before any change or add operations.<br />

1. To set (replace) the current access ACL for file foo, giving only user Billy read<br />

and execute access:<br />

setfacl -s user::rwx,group::---,other::---,user:billy:r-x foo<br />

This may change the permission bits of the file.<br />

2. To modify the current access ACL for file foo to contain an extended ACL entry<br />

for group cartoons, giving that group read access:<br />

setfacl -m group:cartoons:+r foo<br />

3. To set (replace) the current access and directory default ACLs for directory<br />

Haunted so that users user1 and user2 have read and search permissions,<br />

while the group thegang has read permissions:<br />

setfacl -s "u::rwx,g::---,o::---, \<br />

user:user1:r-x,group:thegang:r--,user:user2:r-x, \<br />

d:user:user1:r-x,d:group:thegang:r--,d:user:user2:r-x" Haunted<br />

4. To copy the ACL from file foo such that the file bar will have the same ACL:<br />

getfacl foo | setfacl -S - bar<br />

5. To delete all of the extended ACL entries for user user3 for all files and<br />

directories in the current directory:<br />

setfacl -x user:user3,d:user:user3,f:user:user3 *<br />

6. To delete all of the extended ACL entries for all files and directories in the<br />

current working directory:<br />

setfacl -D e *<br />

7. To change a directory’s access ACL so that that user1 has read, write, and<br />

execute access for all files in the Haunted directory:<br />

setfacl -m user:user1:rwx Haunted<br />

setfacl<br />

Chapter 2. Shell command descriptions 547

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!