diff options
author | Niall O'Higgins <niallo@cvs.openbsd.org> | 2005-09-30 15:02:27 +0000 |
---|---|---|
committer | Niall O'Higgins <niallo@cvs.openbsd.org> | 2005-09-30 15:02:27 +0000 |
commit | aa440bf11a565b1f27d98f44076bd07b6d471049 (patch) | |
tree | 6440b336e83c3c8f6f40b080cbbcd603395ac997 /usr.bin/rcs/rcsprog.c | |
parent | a397de8f3e4d9b055840c2a78b6586d604bccbcc (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.c | 4 |
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); |