guarantee that setuid/executable bits are off
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Wed, 23 Aug 1989 05:26:27 +0000 (21:26 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Wed, 23 Aug 1989 05:26:27 +0000 (21:26 -0800)
SCCS-vsn: usr.bin/uudecode/uudecode.c 5.8

usr/src/usr.bin/uudecode/uudecode.c

index 74f56f4..80cf698 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)uudecode.c 5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)uudecode.c 5.8 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -104,7 +104,8 @@ decode()
        }
 
        /* create output file, set mode */
        }
 
        /* create output file, set mode */
-       if (!freopen(buf, "w", stdout) || fchmod(fileno(stdout), mode)) {
+       if (!freopen(buf, "w", stdout) ||
+           fchmod(fileno(stdout), mode&0666)) {
                (void)fprintf(stderr, "uudecode: %s: %s: %s\n", buf,
                    filename, strerror(errno));
                return(1);
                (void)fprintf(stderr, "uudecode: %s: %s: %s\n", buf,
                    filename, strerror(errno));
                return(1);