$ cd d
$ umask 027
$ touch f
- $ ls -l f | awk -- '{ print $1, $3, $4 }'
+ $ ls -l f | awk -- '{sub(/\\./, "", $1); print $1, $3, $4 }'
> -rw-r----- root root
gives user bin write access.
$ chown bin:bin f
- $ ls -l f | awk -- '{ print $1, $3, $4 }'
+ $ ls -l f | awk -- '{sub(/\\./, "", $1); print $1, $3, $4 }'
> -rw-r----- bin bin
$ su bin
$ echo bin >> f
Replaced "echo" with "touch" can resolve such problem.
# $ echo i > e/i
# > e/i: Permission denied
- $ touch e/i
- > touch: cannot touch `e/i': Permission denied
+ $ touch e/i 2>&1 | sed -e "s/touch .*e\\/i.*:/touch \\'e\\/i\\':/"
+ > touch: cannot touch 'e/i': Permission denied
$ su
$ setfacl -m u:bin:rwx e
$ mkdir -m 600 x
$ chown daemon:daemon x
$ echo j > x/j
- $ ls -l x/j | awk -- '{ print $1, $3, $4 }'
+ $ ls -l x/j | awk -- '{sub(/\\./, "", $1); print $1, $3, $4 }'
> -rw-r----- root root
$ setfacl -m u:daemon:r x
- $ ls -l x/j | awk -- '{ print $1, $3, $4 }'
+ $ ls -l x/j | awk -- '{sub(/\\./, "", $1); print $1, $3, $4 }'
> -rw-r----- root root
(With the bug this gives: `ls: x/j: Permission denied'.)