summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ctm/ctm/ctm_pass1.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/ctm/ctm/ctm_pass1.c')
-rw-r--r--usr.sbin/ctm/ctm/ctm_pass1.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.sbin/ctm/ctm/ctm_pass1.c b/usr.sbin/ctm/ctm/ctm_pass1.c
index 8d69b18..7ef3cb9 100644
--- a/usr.sbin/ctm/ctm/ctm_pass1.c
+++ b/usr.sbin/ctm/ctm/ctm_pass1.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: ctm_pass1.c,v 1.5 1994/11/26 08:57:40 phk Exp $
+ * $Id: ctm_pass1.c,v 1.6 1995/02/04 19:20:47 phk Exp $
*
*/
@@ -97,6 +97,16 @@ Pass1(FILE *fd)
Fatal("Absolute paths are illegal.");
return Exit_Mess;
}
+ for (;;) {
+ if (p[0] == '.' && p[1] == '.')
+ if (p[2] == '/' || p[2] == '\0') {
+ Fatal("Paths containing '..' are illegal.");
+ return Exit_Mess;
+ }
+ if ((p = strchr(p, '/')) == NULL)
+ break;
+ p++;
+ }
break;
case CTM_F_Uid:
GETFIELD(p,sep);
OpenPOWER on IntegriCloud