You are not logged in.

#1 2009-11-09 18:11:51

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

ACLs (Permissions get copied)

ls -ld /home/public/
drwxrwsr-x+ 9 samba users 4096 2009-11-08 20:20 /home/public/

[pyther@mongo home]$ getfacl public/
# file: public/
# owner: samba
# group: users
# flags: -s-
user::rwx
group::rwx
other::r-x
default:user::rwx
default:group::rwx
default:other::r-x


[pyther@mongo home]$ ls -l /home/pyther/.vimrc 
-rw-r--r-- 1 pyther users 288 2009-10-20 16:55 /home/pyther/.vimrc

[pyther@mongo home]$ cp -r /home/pyther/.vimrc public/vim

[pyther@mongo home]$ getfacl public/vim/
# file: public/vim/
# owner: pyther
# group: users
# flags: -s-
user::rwx
group::r-x
other::r-x
default:user::rwx
default:group::rwx
default:other::r-x

Works as expected

[pyther@mongo public]$ mkdir test

[pyther@mongo public]$ getfacl test/
# file: test/
# owner: pyther
# group: users
# flags: -s-
user::rwx
group::rwx
other::r-x
default:user::rwx
default:group::rwx
default:other::r-x

[pyther@mongo public]$ touch test/game.txt

[pyther@mongo public]$ getfacl test/game.txt 
# file: test/game.txt
# owner: pyther
# group: users
user::rw-
group::rw-
other::r--

What I want is for public/vim/ to have group rwx permissions automatically.

What am I doing wrong / misunderstanding? How can I get the desired results?

Last edited by pyther (2009-11-09 18:35:47)


Website - Blog - arch-home
Arch User since March 2005

Offline

#2 2009-11-09 22:12:41

rine
Member
From: Germany
Registered: 2008-03-04
Posts: 217

Re: ACLs (Permissions get copied)

umask 0000

Then try again. I just now found out that I can display the umask simply by calling umask without arguments. And that if you don't set it, it's 0022 by default.
(Someday all the permission/acl stuff will be implemented cleaner and more straightforward (I hope -.-))

edit: Oh and as this is your second post about acl, this might help (especially if you want to copy files into directories): http://bbs.archlinux.org/viewtopic.php?id=54420

Last edited by rine (2009-11-09 22:19:33)

Offline

#3 2009-11-09 22:40:00

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: ACLs (Permissions get copied)

Just so I understand this correctly

Currently it is impossible to achieve what I am trying to do. From what I understand most applications write files/folders with 777 and then let the umask take care of the rest. Because of this the default group permissions do not get inherited.

The suggested solution is to run a crontab every x minutes or setup incrond, correct?


Website - Blog - arch-home
Arch User since March 2005

Offline

#4 2009-11-10 00:13:57

rine
Member
From: Germany
Registered: 2008-03-04
Posts: 217

Re: ACLs (Permissions get copied)

Well for what you want to do you could just set umask to 0002 I guess. At the time I wrote in that other thread I don't think I thought about umask. Isn't this what you are looking for?

rine@archy ~/tmp/huk $ getfacl .
# file: .
# owner: rine
# group: users
user::rwx
group::rwx
other::r-x
default:user::rwx
default:group::rwx
default:other::r-x

rine@archy ~/tmp/huk $ mkdir bla
rine@archy ~/tmp/huk $ getfacl bla
# file: bla
# owner: rine
# group: users
user::rwx
group::r-x
other::r-x
default:user::rwx
default:group::rwx
default:other::r-x

rine@archy ~/tmp/huk $ umask 0002
rine@archy ~/tmp/huk $ mkdir bla2
rine@archy ~/tmp/huk $ getfacl bla2
# file: bla2
# owner: rine
# group: users
user::rwx
group::rwx
other::r-x
default:user::rwx
default:group::rwx
default:other::r-x

Btw, how did you get

# flags: -s-

?

On my machine that's missing and I can't find anything in the man page.

Last edited by rine (2009-11-10 00:15:10)

Offline

#5 2009-11-10 00:25:44

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: ACLs (Permissions get copied)

You are correct setting umask to 002 would work, but I still like my gui file manager. AFAIK it is not possible to set a umask with a file manager.

chmod preserves a directory's set-user-ID and set-group-ID bits  unless
       you  explicitly  specify otherwise.  You can set or clear the bits with
       symbolic modes like u+s and g-s, and you can set (but  not  clear)  the
       bits with a numeric mode.

So the -s- sets the group id for all new files and folders that get created based on the parents folder's gid.

chmod g+s folder
chmod 2775 folder

Either of those commands would set the group id.

I hope that makes sense.


Website - Blog - arch-home
Arch User since March 2005

Offline

#6 2009-11-10 01:45:15

rine
Member
From: Germany
Registered: 2008-03-04
Posts: 217

Re: ACLs (Permissions get copied)

pyther wrote:

You are correct setting umask to 002 would work, but I still like my gui file manager. AFAIK it is not possible to set a umask with a file manager.

It is. I just set umask and started thunar from the same shell. I don't know how you start your filemanager, but you can do things like

alias thunar='umask 0002 && thunar'

or something similar.

pyther wrote:

chmod preserves a directory's set-user-ID and set-group-ID bits  unless
       you  explicitly  specify otherwise.  You can set or clear the bits with
       symbolic modes like u+s and g-s, and you can set (but  not  clear)  the
       bits with a numeric mode.

So the -s- sets the group id for all new files and folders that get created based on the parents folder's gid.

chmod g+s folder
chmod 2775 folder

Either of those commands would set the group id.

I hope that makes sense.

Oh, no I know what they are smile
It's just that my getfacl doesn't show it.

Offline

Board footer

Powered by FluxBB