From: Eric Allman Date: Fri, 27 Aug 1993 02:21:20 +0000 (-0800) Subject: more work on safefile -- it was STILL too pissy X-Git-Tag: BSD-4_4_Lite1-Snapshot-Development~1856 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/a616e5b58e8cf951c66de790f4a7b3ceff804bff more work on safefile -- it was STILL too pissy SCCS-vsn: usr.sbin/sendmail/src/util.c 8.9 --- diff --git a/usr/src/usr.sbin/sendmail/src/util.c b/usr/src/usr.sbin/sendmail/src/util.c index 1216349530..08a436c1da 100644 --- a/usr/src/usr.sbin/sendmail/src/util.c +++ b/usr/src/usr.sbin/sendmail/src/util.c @@ -7,7 +7,7 @@ */ #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" @@ -426,8 +426,8 @@ safefile(fn, uid, gid, uname, mustown, mode) *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 @@ -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; - 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))