On 09/01/16 18:29, lopiuh wrote:
> Package: coreutils
> Version: 8.23-4
> Severity: normal
> 
> Dear Maintainer,
> 
> stat -c "%a" returns "0" instead of "000" in case of getting octal 
> permissions of a directory with permissions 000 (no permissions). No 
> permissions are set in order to prevent users write into unmounted mountpoints
> 
> # ls /mnt/ -lath
> insgesamt 16K
> drwxr-xr-x 1 root root  14 Jan  9 19:12 .
> d--------- 1 root root   0 Jan  9 19:12 data
> drwxr-xr-x 1 root root 198 Jan  9 19:00 ..
> 
> # stat -c "%a" /mnt/data/
> 0
> 
> Thanks
> 
> lopiuh
> 
> 
> -- System Information:
> Debian Release: stretch/sid
>   APT prefers testing-updates
>   APT policy: (500, 'testing-updates'), (500, 'testing')
> Architecture: amd64 (x86_64)
> 
> Kernel: Linux 4.3.0-1-amd64 (SMP w/4 CPU cores)
> Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
> Init: systemd (via /run/systemd/system)
> 
> Versions of packages coreutils depends on:
> ii  libacl1      2.2.52-2
> ii  libattr1     1:2.4.47-2
> ii  libc6        2.21-6
> ii  libselinux1  2.4-3
> 
> coreutils recommends no packages.
> 
> coreutils suggests no packages.


Control over the precise format of the number is given to the user.
So you can get the behavior you desire like:

$ stat -c %#03a data
000

$ find data -maxdepth 0 -printf %#03m\\n
000

We probably should mention those flags in the upstream docs for %a.
I'll do that now.

thanks,
Pádraig

Reply via email to