2

I'm using Ubuntu 10.10 64-bit and have created a group 'dcc' to which I added myself as user 'ralc'. After logging out and back in again I tried the command 'groups' and it gives me the line:

ralc adm ... dcc 

(some groups omitted)

I then created a directory 'dccdir', used chmod g=rwx dccdir; chmod u= dccdir and changed the directory group with chgrp dcc dccdir. The result from ls -l | grep dcc is as follows:

d---rwxr-x  2 ralc dcc 4096 2011-04-26 18:56 dccdir

Now for the real question: seeing that I'm in the same group as the directory, I would assume that I should be able to access and list the contents of the directory. However, when doing ls dccdir I get the message:

bash: cd: dccdir/: Permission denied

Can you explain where I'm mistaken?

Ralc
  • 23

1 Answers1

3

Since you own the directory, only the "owner" permission bits are applied. "Group" and "world" permissions are ignored.

Quote manual page path_resolution(7):

Permissions

The permission bits of a file consist of three groups of three bits, cf. chmod(1) and stat(2). The first group of three is used when the effective user ID of the calling process equals the owner ID of the file. The second group of three is used when the group ID of the file either equals the effective group ID of the calling process, or is one of the supplementary group IDs of the calling process (as set by setgroups(2)). When neither holds, the third group is used.

grawity
  • 501,077