diff options
author | peter <peter@FreeBSD.org> | 1998-06-02 12:00:08 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1998-06-02 12:00:08 +0000 |
commit | 0a878d230401cb8579d9aa96a0be77145d0d2a78 (patch) | |
tree | 3db0d3b550a269062604bfc5a7938d660d4a3ae4 /usr.bin/xinstall/xinstall.c | |
parent | 9b3fd83b9eec58baa7a9955cfa5ded9a8bf70c39 (diff) | |
download | FreeBSD-src-0a878d230401cb8579d9aa96a0be77145d0d2a78.zip FreeBSD-src-0a878d230401cb8579d9aa96a0be77145d0d2a78.tar.gz |
Treat an EOPNOTSUPP from fchflags() as a non-fatal case. Only warn about
it if flags were explicitly specified on the command line. Do not warn
if we were merely trying to preserve flags or remove UF_NODUMP. NFS does
not support flags.
I'm not sure that this is ideal, but it should do for now. Installing
a plain file onto a NFS server must work, we used to silently ignore the
attempt. Doing a binary install looses the flags anyway since cpio
doens't preserve them with the cdrom/network images.
XXX make world should not use flags or chown/chgrp in the obj/tmp area.
This is based on a suggestion from Ken Merry <ken@plutotech.com>.
Diffstat (limited to 'usr.bin/xinstall/xinstall.c')
-rw-r--r-- | usr.bin/xinstall/xinstall.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c index 2e1f8b8..61adb5d 100644 --- a/usr.bin/xinstall/xinstall.c +++ b/usr.bin/xinstall/xinstall.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "From: @(#)xinstall.c 8.1 (Berkeley) 7/21/93"; #endif static const char rcsid[] = - "$Id: xinstall.c,v 1.30 1998/01/13 02:12:43 alex Exp $"; + "$Id: xinstall.c,v 1.31 1998/01/20 13:52:32 bde Exp $"; #endif /* not lint */ /*- @@ -430,16 +430,15 @@ different: fprintf(stderr, "install: renaming for %s: %s to %s\n", from_name, to_name, old_to_name); + if (verbose != 0) + printf("install: %s -> %s\n", + from_name, old_to_name); if (dopreserve && stat(from_name, ×tamp_sb) == 0) { utb.actime = from_sb.st_atime; utb.modtime = from_sb.st_mtime; (void)utime(to_name, &utb); } moveit: - if (verbose) { - printf("install: %s -> %s\n", - from_name, old_to_name); - } if (rename(to_name, old_to_name) < 0) { serrno = errno; unlink(to_name); @@ -496,13 +495,22 @@ moveit: /* * If provided a set of flags, set them, otherwise, preserve the * flags, except for the dump flag. + * NFS does not support flags. Ignore EOPNOTSUPP flags if we're just + * trying to turn off UF_NODUMP. If we're trying to set real flags, + * then warn if the the fs doesn't support it, otherwise fail. */ if (fchflags(to_fd, flags & SETFLAGS ? fset : from_sb.st_flags & ~UF_NODUMP)) { - serrno = errno; - (void)unlink(to_name); - errno = serrno; - err(EX_OSERR, "%s: chflags", to_name); + if (flags & SETFLAGS) { + if (errno == EOPNOTSUPP) + warn("%s: chflags", to_name); + else { + serrno = errno; + (void)unlink(to_name); + errno = serrno; + err(EX_OSERR, "%s: chflags", to_name); + } + } } (void)close(to_fd); |