more work on safefile -- it was STILL too pissy
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Fri, 27 Aug 1993 02:21:20 +0000 (18:21 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Fri, 27 Aug 1993 02:21:20 +0000 (18:21 -0800)
SCCS-vsn: usr.sbin/sendmail/src/util.c 8.9

usr/src/usr.sbin/sendmail/src/util.c

index 1216349..08a436c 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)util.c     8.8 (Berkeley) %G%";
+static char sccsid[] = "@(#)util.c     8.9 (Berkeley) %G%";
 #endif /* not lint */
 
 # include "sendmail.h"
 #endif /* not lint */
 
 # include "sendmail.h"
@@ -426,8 +426,8 @@ safefile(fn, uid, gid, uname, mustown, mode)
                *p = '\0';
                if (stat(fn, &stbuf) < 0)
                        break;
                *p = '\0';
                if (stat(fn, &stbuf) < 0)
                        break;
-               if (stbuf.st_uid == uid && !bitset(S_IXUSR, stbuf.st_mode))
-                       break;
+               if (stbuf.st_uid == uid && bitset(S_IXUSR, stbuf.st_mode))
+                       continue;
                if (stbuf.st_gid == gid && bitset(S_IXGRP, stbuf.st_mode))
                        continue;
 #ifndef NO_GROUP_SET
                if (stbuf.st_gid == gid && bitset(S_IXGRP, stbuf.st_mode))
                        continue;
 #ifndef NO_GROUP_SET
@@ -440,8 +440,8 @@ safefile(fn, uid, gid, uname, mustown, mode)
                        for (gp = gr->gr_mem; *gp != NULL; gp++)
                                if (strcmp(*gp, uname) == 0)
                                        break;
                        for (gp = gr->gr_mem; *gp != NULL; gp++)
                                if (strcmp(*gp, uname) == 0)
                                        break;
-                       if (*gp != NULL && !bitset(S_IXGRP, stbuf.st_mode))
-                               break;
+                       if (*gp != NULL && bitset(S_IXGRP, stbuf.st_mode))
+                               continue;
                }
 #endif
                if (!bitset(S_IXOTH, stbuf.st_mode))
                }
 #endif
                if (!bitset(S_IXOTH, stbuf.st_mode))