diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2015-11-11 17:02:23 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2015-11-11 17:02:23 +0000 |
commit | ec369eebbe44011111324dc0aa944b2938aa4fed (patch) | |
tree | 274de07f89f9297c6ca46b4eab9d29bc71c49521 /usr.sbin | |
parent | 9f3e4c19d464bd841a83e18c3d1b6460271db69e (diff) |
Fix spool dir mode check to avoid extraneous chmod() calls.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/cron/common.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/cron/common.c b/usr.sbin/cron/common.c index 0900f806bd2..a5869e87cce 100644 --- a/usr.sbin/cron/common.c +++ b/usr.sbin/cron/common.c @@ -1,4 +1,4 @@ -/* $OpenBSD: common.c,v 1.3 2015/11/09 15:57:39 millert Exp $ */ +/* $OpenBSD: common.c,v 1.4 2015/11/11 17:02:22 millert Exp $ */ /* Copyright 1988,1990,1993,1994 by Paul Vixie * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") @@ -89,7 +89,7 @@ set_cron_cwd(void) if (grp != NULL) { if (sb.st_gid != grp->gr_gid) chown(CRON_SPOOL, -1, grp->gr_gid); - if (sb.st_mode != 01730) + if ((sb.st_mode & ALLPERMS) != 01730) chmod(CRON_SPOOL, 01730); } @@ -114,7 +114,7 @@ set_cron_cwd(void) if (grp != NULL) { if (sb.st_gid != grp->gr_gid) chown(AT_SPOOL, -1, grp->gr_gid); - if (sb.st_mode != 01770) + if ((sb.st_mode & ALLPERMS) != 01770) chmod(AT_SPOOL, 01770); } } |