rrestor needs to run as root to set up remote host
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Fri, 3 Dec 1982 10:13:06 +0000 (02:13 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Fri, 3 Dec 1982 10:13:06 +0000 (02:13 -0800)
SCCS-vsn: sbin/restore/Makefile 4.5
SCCS-vsn: sbin/restore/main.c 2.15

usr/src/sbin/restore/Makefile
usr/src/sbin/restore/main.c

index e0ba8d9..401c263 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright (c) 1982 Regents of the University of California
 #
 # Copyright (c) 1982 Regents of the University of California
 #
-#      @(#)Makefile    4.4     (Berkeley)      %G%
+#      @(#)Makefile    4.5     (Berkeley)      %G%
 #
 DESTDIR=
 CFLAGS= -O
 #
 DESTDIR=
 CFLAGS= -O
@@ -18,7 +18,7 @@ rrestor.o: restor.c
        mv restor.o rrestor.o
 
 install: rrestor restor
        mv restor.o rrestor.o
 
 install: rrestor restor
-       install rrestor ${DESTDIR}/etc/rrestor
+       install -m 4755 rrestor ${DESTDIR}/etc/rrestor
        install restor ${DESTDIR}/etc/restor
 
 clean:
        install restor ${DESTDIR}/etc/restor
 
 clean:
index ce6e653..d178343 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (c) 1982 Regents of the University of California */
 
 #ifndef lint
 /* Copyright (c) 1982 Regents of the University of California */
 
 #ifndef lint
-char version[] = "@(#)main.c 2.14 %G%";
+char version[] = "@(#)main.c 2.15 %G%";
 #endif
 
 /*     Modified to include h option (recursively extract all files within
 #endif
 
 /*     Modified to include h option (recursively extract all files within
@@ -202,6 +202,7 @@ nohost:
        if (host == 0)
                goto nohost;
 #endif
        if (host == 0)
                goto nohost;
 #endif
+       setuid(getuid());       /* no longer need or want root privileges */
        doit(command, argc, argv);
        done(0);
 }
        doit(command, argc, argv);
        done(0);
 }