From 37b331a25b8bbc8ff4a11dace55d6fdf71c52d47 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Mon, 25 Sep 2006 05:59:29 +0000 Subject: 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@ --- usr.sbin/ypserv/ypxfr/ypxfr.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'usr.sbin/ypserv/ypxfr') 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 @@ -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 @@ -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; -- cgit v1.2.3