turn off the NODUMP flag
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Tue, 30 Jun 1992 10:02:05 +0000 (02:02 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Tue, 30 Jun 1992 10:02:05 +0000 (02:02 -0800)
SCCS-vsn: usr.bin/xinstall/install.1 6.13
SCCS-vsn: usr.bin/xinstall/xinstall.c 5.28

usr/src/usr.bin/xinstall/install.1
usr/src/usr.bin/xinstall/xinstall.c

index a7ffedb..e48dafb 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\" %sccs.include.redist.roff%
 .\"
 .\"
 .\" %sccs.include.redist.roff%
 .\"
-.\"     @(#)install.1  6.12 (Berkeley) %G%
+.\"     @(#)install.1  6.13 (Berkeley) %G%
 .\"
 .Dd 
 .Dt INSTALL 1
 .\"
 .Dd 
 .Dt INSTALL 1
@@ -63,7 +63,8 @@ utility attempts to prevent moving a file onto itself.
 .Pp
 The
 .Nm install
 .Pp
 The
 .Nm install
-utility always attempts to preserve the file flags.
+utility always attempts to preserve the file flags with the exception
+of the NODUMP flag which is always turned off.
 .Pp
 Installing
 .Pa /dev/null
 .Pp
 Installing
 .Pa /dev/null
index 17f3215..5e3d482 100644 (file)
@@ -12,7 +12,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)xinstall.c 5.27 (Berkeley) %G%";
+static char sccsid[] = "@(#)xinstall.c 5.28 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -173,8 +173,8 @@ install(from_name, to_name, isdir)
                err("%s: %s", to_name, strerror(serrno));
        }
 
                err("%s: %s", to_name, strerror(serrno));
        }
 
-       /* Always preserve the flags. */
-       if (fchflags(to_fd, from_sb.st_flags)) {
+       /* Always preserve the flags, except for the dump flag. */
+       if (fchflags(to_fd, from_sb.st_flags & ~NODUMP)) {
                serrno = errno;
                (void)unlink(to_name);
                err("%s: %s", to_name, strerror(serrno));
                serrno = errno;
                (void)unlink(to_name);
                err("%s: %s", to_name, strerror(serrno));