diff options
| author | 2006-09-25 05:59:28 +0000 | |
|---|---|---|
| committer | 2006-09-25 05:59:28 +0000 | |
| commit | 15a2cd27d2ab74b5e51133641398df2c14c7bab5 (patch) | |
| tree | 34b946daa79981fc2500d869d3c833aab324ce5a /usr.sbin/bind/lib/isc/unix/fsaccess.c | |
| parent | Change "a SSH" to "an SSH". Hurray, I'm not the only one who (diff) | |
| download | wireguard-openbsd-15a2cd27d2ab74b5e51133641398df2c14c7bab5.tar.xz wireguard-openbsd-15a2cd27d2ab74b5e51133641398df2c14c7bab5.zip | |
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/bind/lib/isc/unix/fsaccess.c')
| -rw-r--r-- | usr.sbin/bind/lib/isc/unix/fsaccess.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/bind/lib/isc/unix/fsaccess.c b/usr.sbin/bind/lib/isc/unix/fsaccess.c index 35b99eeb9b9..24f8e2b3227 100644 --- a/usr.sbin/bind/lib/isc/unix/fsaccess.c +++ b/usr.sbin/bind/lib/isc/unix/fsaccess.c @@ -40,9 +40,9 @@ isc_fsaccess_set(const char *path, isc_fsaccess_t access) { if (stat(path, &statb) != 0) return (isc__errno2result(errno)); - if ((statb.st_mode & S_IFDIR) != 0) + if (S_ISDIR(statb.st_mode)) is_dir = ISC_TRUE; - else if ((statb.st_mode & S_IFREG) == 0) + else if (!S_ISREG(statb.st_mode)) return (ISC_R_INVALIDFILE); result = check_bad_bits(access, is_dir); |
