summaryrefslogtreecommitdiff
path: root/usr.bin/rcs/rcsprog.c
diff options
context:
space:
mode:
authorNiall O'Higgins <niallo@cvs.openbsd.org>2005-09-30 15:02:27 +0000
committerNiall O'Higgins <niallo@cvs.openbsd.org>2005-09-30 15:02:27 +0000
commitaa440bf11a565b1f27d98f44076bd07b6d471049 (patch)
tree6440b336e83c3c8f6f40b080cbbcd603395ac997 /usr.bin/rcs/rcsprog.c
parenta397de8f3e4d9b055840c2a78b6586d604bccbcc (diff)
ensure RCSDIR is in fact a directory before deciding to use it.
"go for it" joris@
Diffstat (limited to 'usr.bin/rcs/rcsprog.c')
-rw-r--r--usr.bin/rcs/rcsprog.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/rcs/rcsprog.c b/usr.bin/rcs/rcsprog.c
index b7891ab6e6f..55c0c2d252f 100644
--- a/usr.bin/rcs/rcsprog.c
+++ b/usr.bin/rcs/rcsprog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsprog.c,v 1.14 2005/09/29 21:38:48 xsa Exp $ */
+/* $OpenBSD: rcsprog.c,v 1.15 2005/09/30 15:02:26 niallo Exp $ */
/*
* Copyright (c) 2005 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -71,7 +71,7 @@ rcs_statfile(char *fname, char *out, size_t len)
if (l == -1 || l >= (int)sizeof(filev))
return (-1);
- if (stat(RCSDIR, &st) != -1) {
+ if (stat(RCSDIR, &st) != -1 && (st.st_mode & S_IFDIR)) {
l = snprintf(fpath, sizeof(fpath), "%s/%s", RCSDIR, filev);
if (l == -1 || l >= (int)sizeof(fpath))
return (-1);