Skip to content
yvan edited this page Mar 18, 2015 · 1 revision

#Permissions

if I create dir and file i get

[yvans@vali test]$ touch file
[yvans@vali test]$ mkdir dir
[yvans@vali test]$ ls -l
total 4
drwxr-x---. 2 yvans yvans 4096 Jan  8 14:44 dir
-rw-r-----. 1 yvans yvans    0 Jan  8 14:44 file
[yvans@vali test]$

now set the sticky bit

[yvans@vali test]$ cd ../
[yvans@vali ~]$ chmod g+s test/
[yvans@vali ~]$ chgrp -R ous-diag test/
[yvans@vali ~]$ cd test/
[yvans@vali test]$ ls -l
total 4
drwxr-x---. 2 yvans ous-diag 4096 Jan  8 14:44 dir
-rw-r-----. 1 yvans ous-diag    0 Jan  8 14:44 file
[yvans@vali test]$

Now recreate dir and file

yvans@vali test]$ touch file_sticky
[yvans@vali test]$ mkdir dir_sticky
[yvans@vali test]$ ls -l
total 8
drwxr-x---. 2 yvans ous-diag 4096 Jan  8 14:44 dir
drwxr-s---. 2 yvans ous-diag 4096 Jan  8 14:47 dir_sticky
-rw-r-----. 1 yvans ous-diag    0 Jan  8 14:44 file
-rw-r-----. 1 yvans ous-diag    0 Jan  8 14:47 file_sticky

ok the new dir/file got the correct group.

Now set the umask in .bashrc:

# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# User specific aliases and functions

umask 007

and source it:

[yvans@vali test]$ source ~/.bashrc

[yvans@vali test]$ mkdir dir_sticky_umask
[yvans@vali test]$ touch file_sticky_umask
[yvans@vali test]$ ls -l
total 12
drwxr-x---. 2 yvans ous-diag 4096 Jan  8 14:44 dir
drwxr-s---. 2 yvans ous-diag 4096 Jan  8 14:47 dir_sticky
drwxrws---. 2 yvans ous-diag 4096 Jan  8 14:51 dir_sticky_umask
-rw-r-----. 1 yvans ous-diag    0 Jan  8 14:44 file
-rw-r-----. 1 yvans ous-diag    0 Jan  8 14:47 file_sticky
-rw-rw----. 1 yvans ous-diag    0 Jan  8 14:51 file_sticky_umask

So dir and file got writing right for the group but not execute....

Trying the cal method

[yvans@vali test]$ getfacl ./
# file: .
# owner: yvans
# group: ous-diag
# flags: -s-
user::rwx
group::r-x
other::---

[yvans@vali test]$ setfacl -d -m g::rwx ./
[yvans@vali test]$ getfacl ./
# file: .
# owner: yvans
# group: ous-diag
# flags: -s-
user::rwx
group::r-x
other::---
default:user::rwx
default:group::rwx
default:other::---

[yvans@vali test]$ mkdir dir_sticky_umask_acl
[yvans@vali test]$ touch file_sticky_umask_acl
[yvans@vali test]$ ls -ltr
total 20
-rw-r-----. 1 yvans ous-diag    0 Jan  8 14:44 file
drwxr-x---. 2 yvans ous-diag 4096 Jan  8 14:44 dir
-rw-r-----. 1 yvans ous-diag    0 Jan  8 14:47 file_sticky
drwxr-s---. 2 yvans ous-diag 4096 Jan  8 14:47 dir_sticky
drwxrws---. 2 yvans ous-diag 4096 Jan  8 14:51 dir_sticky_umask
-rw-rw----. 1 yvans ous-diag    0 Jan  8 14:51 file_sticky_umask
drwxrws---+ 2 yvans ous-diag 4096 Jan  8 14:58 dir_sticky_umask_acl
-rw-rw----. 1 yvans ous-diag    0 Jan  8 14:58 file_sticky_umask_acl
[yvans@vali test]$

Not working!!!

Clone this wiki locally