summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/systrace/intercept.c4
-rw-r--r--bin/systrace/policy.c10
-rw-r--r--sbin/isakmpd/log.c4
-rw-r--r--sbin/isakmpd/ui.c4
-rw-r--r--sbin/isakmpd/x509.c6
5 files changed, 14 insertions, 14 deletions
diff --git a/bin/systrace/intercept.c b/bin/systrace/intercept.c
index 0e8815942fd..1281f5ea45b 100644
--- a/bin/systrace/intercept.c
+++ b/bin/systrace/intercept.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intercept.c,v 1.52 2006/07/02 12:34:15 sturm Exp $ */
+/* $OpenBSD: intercept.c,v 1.53 2006/09/19 10:48:41 otto Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -704,7 +704,7 @@ normalize_filename(int fd, pid_t pid, char *name, int userp)
*/
if (userp != ICLINK_NOLAST) {
if (lstat(rcwd, &st) == -1 ||
- !(st.st_mode & S_IFDIR))
+ !S_ISDIR(st.st_mode))
failed = 1;
}
}
diff --git a/bin/systrace/policy.c b/bin/systrace/policy.c
index d00da3550aa..2afcc5b964a 100644
--- a/bin/systrace/policy.c
+++ b/bin/systrace/policy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: policy.c,v 1.31 2006/07/02 12:34:15 sturm Exp $ */
+/* $OpenBSD: policy.c,v 1.32 2006/09/19 10:48:41 otto Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -127,7 +127,7 @@ systrace_setupdir(char *path)
if (stat(policydir, &sb) != -1) {
- if (!(sb.st_mode & S_IFDIR))
+ if (!S_ISDIR(sb.st_mode))
errx(1, "Not a directory: \"%s\"", policydir);
} else if (mkdir(policydir, 0700) == -1)
err(1, "mkdir(%s)", policydir);
@@ -438,7 +438,7 @@ systrace_templatedir(void)
goto error;
/* Check if template directory exists */
- if (stat(filename, &sb) != -1 && (sb.st_mode & S_IFDIR))
+ if (stat(filename, &sb) != -1 && S_ISDIR(sb.st_mode))
dir = opendir(filename);
}
@@ -446,7 +446,7 @@ systrace_templatedir(void)
if (dir == NULL) {
strlcpy(filename, POLICY_PATH, sizeof(filename));
strlcat(filename, "/templates", sizeof(filename));
- if (stat(filename, &sb) != -1 && (sb.st_mode & S_IFDIR))
+ if (stat(filename, &sb) != -1 && S_ISDIR(sb.st_mode))
dir = opendir(filename);
if (dir == NULL)
return (-1);
@@ -462,7 +462,7 @@ systrace_templatedir(void)
sizeof(filename))
goto error;
- if (stat(filename, &sb) == -1 || !(sb.st_mode & S_IFREG))
+ if (stat(filename, &sb) == -1 || !S_ISREG(sb.st_mode))
continue;
template = systrace_readtemplate(filename, NULL, NULL);
diff --git a/sbin/isakmpd/log.c b/sbin/isakmpd/log.c
index f36d364515c..77376d47148 100644
--- a/sbin/isakmpd/log.c
+++ b/sbin/isakmpd/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.58 2005/05/26 05:35:55 moritz Exp $ */
+/* $OpenBSD: log.c,v 1.59 2006/09/19 10:48:41 otto Exp $ */
/* $EOM: log.c,v 1.30 2000/09/29 08:19:23 niklas Exp $ */
/*
@@ -413,7 +413,7 @@ log_packet_init(char *newname)
/* XXX This is a fstat! */
if (monitor_stat(pcaplog_file, &st) == 0) {
/* Sanity checks. */
- if ((st.st_mode & S_IFMT) != S_IFREG) {
+ if (!S_ISREG(st.st_mode)) {
log_print("log_packet_init: existing capture file is "
"not a regular file");
return;
diff --git a/sbin/isakmpd/ui.c b/sbin/isakmpd/ui.c
index 0f3df0007f3..121cf022f11 100644
--- a/sbin/isakmpd/ui.c
+++ b/sbin/isakmpd/ui.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ui.c,v 1.48 2006/09/01 00:24:06 mpf Exp $ */
+/* $OpenBSD: ui.c,v 1.49 2006/09/19 10:48:41 otto Exp $ */
/* $EOM: ui.c,v 1.43 2000/10/05 09:25:12 niklas Exp $ */
/*
@@ -84,7 +84,7 @@ ui_init(void)
/* Don't overwrite a file, i.e '-f /etc/isakmpd/isakmpd.conf'. */
if (lstat(ui_fifo, &st) == 0) {
- if ((st.st_mode & S_IFMT) == S_IFREG) {
+ if (S_ISREG(st.st_mode)) {
errno = EEXIST;
log_fatal("ui_init: could not create FIFO \"%s\"",
ui_fifo);
diff --git a/sbin/isakmpd/x509.c b/sbin/isakmpd/x509.c
index eeaefefc7f5..a003d8a395e 100644
--- a/sbin/isakmpd/x509.c
+++ b/sbin/isakmpd/x509.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509.c,v 1.106 2006/06/02 19:35:55 hshoexer Exp $ */
+/* $OpenBSD: x509.c,v 1.107 2006/09/19 10:48:41 otto Exp $ */
/* $EOM: x509.c,v 1.54 2001/01/16 18:42:16 ho Exp $ */
/*
@@ -608,7 +608,7 @@ x509_read_from_dir(X509_STORE *ctx, char *name, int hash)
continue;
}
- if (!(sb.st_mode & S_IFREG)) {
+ if (!S_ISREG(sb.st_mode)) {
close(fd);
continue;
}
@@ -690,7 +690,7 @@ x509_read_crls_from_dir(X509_STORE *ctx, char *name)
continue;
}
- if (!(sb.st_mode & S_IFREG)) {
+ if (!S_ISREG(sb.st_mode)) {
close(fd);
continue;
}