install command is buggy -- where to report?

The install command has a bug, but I don’t know where to report it.

install -m 700 -d one/two/three

Only three will have the requested permissions set; the previous components, even if generated by the command, will have default permissions. While it makes sense to not modify permissions on existing components of the path, not setting it on newly created ones except the last one is completely nonsensical!

mkdir -m also has the same bug.

I meant mkdir -p -m.

On 2015-05-06 07:16, Prune wrote:
>
> The install command has a bug, but I don’t know where to report it.

If it were an openSUSE issue, in openSUSE’s bugzilla.

In this case, upstream, I’d guess.

> install -m 700 -d one/two/three
>
> Only three will have the requested permissions set; the previous
> components, even if generated by the command, will have default
> permissions. While it makes sense to not modify permissions on existing
> components of the path, not setting it on newly created ones except the
> last one is completely nonsensical!

IMO, the correct approach would be to create each directory in a
separate command, specifying the permissions and ownership on each. Not
create the three elements in one shot.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

When you report a bug, my advice would be that you document it better then you do here. Like:

  • version of openSUSE;
  • complete example that proves your conclusions.

And of course, better read the documentation before you file a bug.

From info coreutils ‘install invocation’

 * 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.   Directory Setuid
      and Setgid, for how the set-user-ID and set-group-ID bits of
      parent directories are inherited.

On Wed 06 May 2015 05:16:01 AM CDT, Prune wrote:

The install command has a bug, but I don’t know where to report it.

install -m 700 -d one/two/three

Only three will have the requested permissions set; the previous
components, even if generated by the command, will have default
permissions. While it makes sense to not modify permissions on existing
components of the path, not setting it on newly created ones except the
last one is completely nonsensical!

Hi
In rpm specs I use;


install -Dm0700 /one/two/three


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel 3.12.39-47-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

That’s not a bug. That’s a feature. That’s how it is supposed to be.

You are installing only the final part. You are also creating any needed directory, so it is appropriate that those have default permissions.

You could alway use something like:

 ( umask 077 && install 700 -d one/two/three )

if you want restrictive permissions for newly created directories.

Thanks, I’ll use this.

On 2015-05-14 08:46, Prune wrote:
>
> nrickert;2708638 Wrote:
>>
>> You could alway use something like:
>>>
> Code:
> --------------------
> > > ( umask 077 && install 700 -d one/two/three )
> --------------------
>>>
>> if you want restrictive permissions for newly created directories.
> Thanks, I’ll use this.

Documentation says it should not work, umask is ignored:

File: coreutils.info, Node: install invocation, Next: mv invocation,
Prev: dd invocation, Up: Basic operations

  • 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.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))