diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2006-09-25 05:59:29 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2006-09-25 05:59:29 +0000 |
commit | 37b331a25b8bbc8ff4a11dace55d6fdf71c52d47 (patch) | |
tree | acd2ff90c630ce77b5cf436706d95ba18609e43f /usr.sbin/ypserv/ypxfr | |
parent | cbeb1f8e870a309147bbec4fd18ad2e9e983562d (diff) |
Use S_IS* macros insted of masking with S_IF* flags. The latter may
have multiple bits set, which leads to surprising results. Spotted by
from Paul Stoeber, more to come. ok jaredy@
Diffstat (limited to 'usr.sbin/ypserv/ypxfr')
-rw-r--r-- | usr.sbin/ypserv/ypxfr/ypxfr.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.sbin/ypserv/ypxfr/ypxfr.c b/usr.sbin/ypserv/ypxfr/ypxfr.c index 800211cbb70..f4156d9c3f1 100644 --- a/usr.sbin/ypserv/ypxfr/ypxfr.c +++ b/usr.sbin/ypserv/ypxfr/ypxfr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ypxfr.c,v 1.34 2006/04/03 05:01:24 deraadt Exp $ */ +/* $OpenBSD: ypxfr.c,v 1.35 2006/09/25 05:59:28 otto Exp $ */ /* * Copyright (c) 1994 Mats O Jansson <moj@stacken.kth.se> @@ -27,7 +27,7 @@ */ #ifndef lint -static const char rcsid[] = "$OpenBSD: ypxfr.c,v 1.34 2006/04/03 05:01:24 deraadt Exp $"; +static const char rcsid[] = "$OpenBSD: ypxfr.c,v 1.35 2006/09/25 05:59:28 otto Exp $"; #endif #include <sys/types.h> @@ -93,8 +93,7 @@ get_local_ordernum(char *domain, char *map, u_int32_t *lordernum) status = YPPUSH_SUCC; snprintf(map_path, sizeof map_path, "%s/%s", YP_DB_PATH, domain); - if (!((stat(map_path, &finfo) == 0) && - ((finfo.st_mode & S_IFMT) == S_IFDIR))) { + if (!((stat(map_path, &finfo) == 0) && S_ISDIR(finfo.st_mode))) { fprintf(stderr, "ypxfr: domain %s not found locally\n", domain); status = YPPUSH_NODOM; |