05.01.2013 Views

Mac OS X Leopard - ARCAism

Mac OS X Leopard - ARCAism

Mac OS X Leopard - ARCAism

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Leopard</strong>:~ scott$ ls -le<br />

total 0<br />

drwx------+ 5 scott staff 170 Sep 7 10:35 Desktop/<br />

0: group:everyone deny delete<br />

drwx------+ 11 scott staff 374 Sep 7 07:53 Documents/<br />

0: group:everyone deny delete<br />

drwx------+ 10 scott staff 340 Sep 7 11:32 Downloads/<br />

0: group:everyone deny delete<br />

drwx------+ 40 scott staff 1360 Sep 7 10:39 Library/<br />

0: group:everyone deny delete<br />

drwx------+ 3 scott staff 102 Aug 25 14:54 Movies/<br />

0: group:everyone deny delete<br />

drwx------+ 6 scott staff 204 Aug 30 19:15 Music/<br />

0: group:everyone deny delete<br />

drwx------+ 4 scott staff 136 Aug 25 14:54 Pictures/<br />

0: group:everyone deny delete<br />

drwxr-xr-x+ 4 scott staff 136 Aug 25 14:54 Public/<br />

0: group:everyone deny delete<br />

drwxr-xr-x+ 6 scott staff 204 Sep 6 18:17 Sites/<br />

0: group:everyone deny delete<br />

CHAPTER 18 INTRODUCING DARWIN AND THE SHELL 323<br />

When you look at the ACLs attached to the default folders in your home directory, you’ll<br />

see that they are set to deny everyone from deleting them. Don’t be afraid to try it; if you try a<br />

rmdir, you’ll get a Permission Denied warning, and if you try to drag the folders into the trash,<br />

you’ll get a warning telling you that that directory can’t be modified or deleted.<br />

To view a file’s attributes, use the -@ option with ls.<br />

NOTE Most of the file attributes are strictly there for application and Finder support. You can<br />

add your own attributes for whatever reason you want, but for the most part in <strong>OS</strong> X they are<br />

there to support the Finder.<br />

To add entries to or delete entries from an ACL, you use the chmod command with +a (to add<br />

an entry) or -a (to remove an entry). When you are adding an entry, the new entry will be added<br />

to the ACL. To remove an entry, you will need to specify the entry number using # n directives.<br />

Here are some examples of working with ACL entries:<br />

<strong>Leopard</strong>:macbeth scott$ ls -l<br />

total 8<br />

-rw-r--r-- 1 scott staff 401 Sep 7 07:47 soliloquy4<br />

<strong>Leopard</strong>:macbeth scott$ chmod +a "staff deny write,delete" soliloquy4<br />

<strong>Leopard</strong>:macbeth scott$ ls -le<br />

total 8<br />

-rw-r--r--+ 1 scott staff 401 Sep 7 07:47 soliloquy4<br />

0: group:staff deny write,delete<br />

<strong>Leopard</strong>:macbeth scott$ chmod +a "scott allow read,write,delete" soliloquy4<br />

<strong>Leopard</strong>:macbeth scott$ chmod +a "nobody deny read,write,delete" soliloquy4<br />

<strong>Leopard</strong>:macbeth scott$ ls -le<br />

total 8<br />

-rw-r--r--+ 1 scott staff 401 Sep 7 07:47 soliloquy4<br />

0: user:nobody deny read,write,delete<br />

1: group:staff deny write,delete<br />

2: user:scott allow read,write,delete<br />

<strong>Leopard</strong>:macbeth scott$ chmod -a# 1 soliloquy4<br />

<strong>Leopard</strong>:macbeth scott$ ls -le<br />

total 8<br />

-rw-r--r--+ 1 scott staff 401 Sep 7 07:47 soliloquy4

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

Saved successfully!

Ooh no, something went wrong!