bug-gzip
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sequence of chmod and chown in unrestricted chown environment


From: Paul Eggert
Subject: Re: sequence of chmod and chown in unrestricted chown environment
Date: Mon, 08 Jul 2013 19:38:59 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7

On 07/08/2013 07:36 AM, Vladimir Marek wrote:
> On solaris you can mount given filesystem with norstchown parameter
> which gives the owner of the file the ability to chown the file to
> someone else.

Yes, that's true.  But this is unusual -- I've never
seen it done, and I've used a lot of Solaris systems.
Who uses it and why?  It might be helpful to understand
their motiviation before diving into implementation.

Anyway, for reasons discussed in the earlier thread,
we can't simply change the code to do a chmod before
chown, as that would be wrong for typical platforms.
Nor does it make sense for this to be a configure-time
option, as even on Solaris gzip's current behavior
is typically correct now, and it's wrong only in the
unusual case where file systems have this mount option.
Nor should it be settable by a command-line option or
(even worse) an environment variable.  Most users won't
know about the option.

Here's a better idea: have gzip detect when the destination
is on a file system that lets you give files away and where
it's correct to do the chmod before the chown.  On platforms
that never let you give files away, this should take zero
instructions at run-time.  On platforms like Solaris where
it depends on mount options, this should inspect the mount
options.

Can you contribute code to do that?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]