Module Name: src
Committed By: uebayasi
Date: Fri Aug 28 08:56:39 UTC 2015
Modified Files:
src/usr.bin/config: files.c
Log Message:
Error out if a given path is absolute.
To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/config/files.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/config/files.c
diff -u src/usr.bin/config/files.c:1.18 src/usr.bin/config/files.c:1.19
--- src/usr.bin/config/files.c:1.18 Mon Nov 17 00:53:15 2014
+++ src/usr.bin/config/files.c Fri Aug 28 08:56:39 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: files.c,v 1.18 2014/11/17 00:53:15 uebayasi Exp $ */
+/* $NetBSD: files.c,v 1.19 2015/08/28 08:56:39 uebayasi Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
#endif
#include <sys/cdefs.h>
-__RCSID("$NetBSD: files.c,v 1.18 2014/11/17 00:53:15 uebayasi Exp $");
+__RCSID("$NetBSD: files.c,v 1.19 2015/08/28 08:56:39 uebayasi Exp $");
#include <sys/param.h>
#include <errno.h>
@@ -106,6 +106,10 @@ addfile(const char *path, struct condexp
path);
goto bad;
}
+ if (*path == '/') {
+ cfgerror("path must be relative");
+ goto bad;
+ }
/* find last part of pathname, and same without trailing suffix */
tail = strrchr(path, '/');