[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
install program : avoiding unnecessary chown()
From: |
Richard Curnow |
Subject: |
install program : avoiding unnecessary chown() |
Date: |
Thu, 25 Oct 2001 15:32:55 +0100 |
I've run into a small problem when using GNU install. I'm on Linux 2.2.19,
with the destination directory being mounted via smbfs. (The remote end is
actually samba on Solaris, being used to export a ClearCase view.) The
invocation of install is using the -m switch, but *not* the -o or -g switches.
install was exiting with an "operation not permitted" error.
Running strace, I could see the problem was coming from a call to chown() with
uid=gid=-1 (i.e. leave owner and group the same). I've found that in the Linux
kernel, a chown call with either of these arguments =-1 is taken to mean "copy
that arg from what the file has now", rather than "don't bother changing the
file if both are -1". That method would probably have been wrong anyway, since
the mtime needs to change at least.
The underlying problem is probably that smbfs doesn't support a chown
operation, as I doubt it's part of the SMB protocol.
So, I decided the easiest fix was in install. If neither the -o nor -g
switches have been specified, don't bother trying to do chown() on the
destination file at all. I've attached a patch to do this.
--
Richard | SuperH Core Architecture /// .... At home ...
Curnow | address@hidden /// address@hidden
| http://www.superh.com/ /// http://www.rrbcurnow.freeuk.com/
install.patch
Description: Text document
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- install program : avoiding unnecessary chown(),
Richard Curnow <=