Jim Meyering <[EMAIL PROTECTED]> writes:

| Marc Olzheim <[EMAIL PROTECTED]> writes:
| | I just noticed some unwanted behaviour of install. When using the
| | -o option as non-root, it just installs the file as yourself. When
| | also using the option '-m 4755', it justs makes the file setuid me !
| | So a harmless install -m 4755 -o nobody prog dest will not do what the
| | reason for doing it was in the first place...
| |
| | I noticed that FreeBSD install unlinks the file when it cannot chown/chgrp
| | it.
| |
| | So is this behaviour a well considered choice or is it a bug ?
|
| Thanks for the report.
| I'm going to fix it one way or the other.
| Right now, rather than removing the just-installed file altogether,
| I'm inclined to reset any special permission bits if the chown fails.
| Of course, install will exit nonzero in that case.

Thanks again.
The fix was even simpler:
Just avoid performing the chmod if the chown fails.

IMHO, doing that makes GNU install more consistent with others programs
like cp and mv (they don't remove the destination file in the event that
they can't preserve all file attributes).

Reply via email to