LINUX.ORG.RU

ACL и прочие mkdir :)


0

0

#Короче прикол:
$ ls -al 
total 0
drwxrwx---+ 4 root   root    80 Jul 22 11:49 ./
drwxrwxrwt  3 root   root   140 Jul 22 11:28 ../

$ getfacl .
# file: .
# owner: root
# group: root
user::rwx
user:user1:rwx
user:user2:r-x
group::---
mask::rwx
other::---
default:user::rwx
default:user:user1:rwx
default:user:user2:r-x
default:group::---
default:mask::rwx
default:other::---

#defaul mask::rwx типа того
#Далее

#Вариант первый
$ pushd . ; for i in {1..5}; do mkdir a$i; cd a$i; done; popd

#Вариант второй
$ mkdir -p b1/b2/b3/b4/b5

#Смотрим результат, думаем :) смотрим в сторону mask :)

$ getfacl -R .

# file: b1
# owner: user1
# group: user1
user::rwx
user:user1:rwx	#effective:---
user:user2:r-x	#effective:---
group::---
mask::---
other::---
default:user::rwx
default:user:user1:rwx
default:user:user2:r-x
default:group::---
default:mask::rwx
default:other::---

# file: b1/b2
# owner: user1
# group: user1
user::rwx
user:user1:rwx	#effective:---
user:user2:r-x	#effective:---
group::---
mask::---
other::---
default:user::rwx
default:user:user1:rwx
default:user:user2:r-x
default:group::---
default:mask::rwx
default:other::---

# file: b1/b2/b3
# owner: user1
# group: user1
user::rwx
user:user1:rwx	#effective:---
user:user2:r-x	#effective:---
group::---
mask::---
other::---
default:user::rwx
default:user:user1:rwx
default:user:user2:r-x
default:group::---
default:mask::rwx
default:other::---

# file: b1/b2/b3/b4
# owner: user1
# group: user1
user::rwx
user:user1:rwx	#effective:---
user:user2:r-x	#effective:---
group::---
mask::---
other::---
default:user::rwx
default:user:user1:rwx
default:user:user2:r-x
default:group::---
default:mask::rwx
default:other::---

# file: b1/b2/b3/b4/b5
# owner: user1
# group: user1
user::rwx
user:user1:rwx
user:user2:r-x
group::---
mask::rwx
other::---
default:user::rwx
default:user:user1:rwx
default:user:user2:r-x
default:group::---
default:mask::rwx
default:other::---

# file: a1
# owner: user1
# group: user1
user::rwx
user:user1:rwx
user:user2:r-x
group::---
mask::rwx
other::---
default:user::rwx
default:user:user1:rwx
default:user:user2:r-x
default:group::---
default:mask::rwx
default:other::---

# file: a1/a2
# owner: user1
# group: user1
user::rwx
user:user1:rwx
user:user2:r-x
group::---
mask::rwx
other::---
default:user::rwx
default:user:user1:rwx
default:user:user2:r-x
default:group::---
default:mask::rwx
default:other::---

# file: a1/a2/a3
# owner: user1
# group: user1
user::rwx
user:user1:rwx
user:user2:r-x
group::---
mask::rwx
other::---
default:user::rwx
default:user:user1:rwx
default:user:user2:r-x
default:group::---
default:mask::rwx
default:other::---

# file: a1/a2/a3/a4
# owner: user1
# group: user1
user::rwx
user:user1:rwx
user:user2:r-x
group::---
mask::rwx
other::---
default:user::rwx
default:user:user1:rwx
default:user:user2:r-x
default:group::---
default:mask::rwx
default:other::---

# file: a1/a2/a3/a4/a5
# owner: user1
# group: user1
user::rwx
user:user1:rwx
user:user2:r-x
group::---
mask::rwx
other::---
default:user::rwx
default:user:user1:rwx
default:user:user2:r-x
default:group::---
default:mask::rwx
default:other::---

#Вопрос на засыпку: где баг то? в mkdir -p или чё?
Ответ на: комментарий от mky

да я уж подумал что до 5 мало :) когда запостил :) кста... по теме то... mkdir -p хавает umask, а просто mkdir нет, насколько я понял... то есть при umask 0000 всё правильно с ACL, а при 0022 или т.п. mask затирается этими битами... короче пурга полная...

vinni_puh
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.