BSD 4_3_Reno release
[unix-history] / usr / src / old / btlgammon / btlgammon.c
index fa90e97..79cc1f4 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)btlgammon.c        1.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)btlgammon.c        1.2 (Berkeley) 9/20/87";
 #endif not lint
 
 /*
 #endif not lint
 
 /*
@@ -139,9 +139,14 @@ retry:
                        exit(0);
 
                case '!':                       /* escape to Shell */
                        exit(0);
 
                case '!':                       /* escape to Shell */
+#ifdef ADD_A_MAJOR_SECURITY_HOLE
                        if(s[1] != '\0')
                                system(s+1);
                        if(s[1] != '\0')
                                system(s+1);
-                       else if((pid = fork()) == 0) {
+                       else
+#endif
+                       if (!(pid = vfork()) == 0) {
+                               (void)setuid(getuid());
+                               (void)setgid(getgid());
                                execl("/bin/sh", "sh", "-", 0);
                                fprintf(stderr, "back: cannot exec /bin/sh!\n");
                                exit(2);
                                execl("/bin/sh", "sh", "-", 0);
                                fprintf(stderr, "back: cannot exec /bin/sh!\n");
                                exit(2);