Subject: bug#22432: closed (Re: bug#22432: owner, group and mode options are only applied to the deepest directory)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 22 Jan 2016 16:46:03 +0000

Your bug report

#22432: owner,group and mode options are only applied to the deepest directory

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
22432: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22432
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#22432: owner, group and mode options are only applied to the deepest directory
From: Eric Blake <[email-masked]>
To: Hans Lambermont <[email-masked]>, [email-masked]
Date: Fri, 22 Jan 2016 09:45:13 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

tag 22432 notabug
thanks

On 01/22/2016 04:42 AM, Hans Lambermont wrote:
> Package: coreutils
> Version: 8.21
> 
> When 'install' creates nested directories the options for owner,group and mode
> are only applied to the deepest directory.

Thanks for the report, but this is documented.  Per 'info install':

   • If the ‘--directory’ (‘-d’) option is given, ‘install’ creates each
     DIRECTORY and any missing parent directories.  Parent directories
     are created with mode ‘u=rwx,go=rx’ (755), regardless of the ‘-m’
     option or the current umask.  *Note Directory Setuid and Setgid::,
     for how the set-user-ID and set-group-ID bits of parent directories
     are inherited.

If you want to create parent directories with specific permissions, you
have to do multiple invocations.

As such, I'm closing this as not a bug, but feel free to add further
comments to this thread.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Subject: owner,group and mode options are only applied to the deepest directory
From: Hans Lambermont <[email-masked]>
To: [email-masked]
Date: Fri, 22 Jan 2016 12:42:05 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Package: coreutils
Version: 8.21

When 'install' creates nested directories the options for owner,group and mode
are only applied to the deepest directory.

Example, when I run as root :

install -o "www-data" -g "models" --mode=2775 -d /tmp/00/00/00/00

ls -la /tmp/00/00/00/00
drwxrwsr-x 2 www-data models 4096 Jan 21 16:38 .
drwxr-xr-x 3 root     root   4096 Jan 21 16:38 ..

This shows that /tmp/00/00/00/ is owned by root:root and has 755 as permissions.
The same holds for the just created /tmp/00/00/ and /tmp/00/ .
Only /tmp/00/00/00/00/ is correct.

All created directories should get the given owner,group and mode options.

System: Ubuntu 12.04.5 LTS
GNU coreutils 8.21 (deb 8.21-1ubuntu5.3 amd64)

-- Hans Lambermont