diff options
author | phk <phk@FreeBSD.org> | 1995-02-04 19:20:49 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1995-02-04 19:20:49 +0000 |
commit | 47e4dbe85ecb6224aabe5b3cf54f81a1d12e43c3 (patch) | |
tree | cf2374d0a3bf47021d45341ca1d999d1b6f28c49 /usr.sbin/ctm | |
parent | f1d31d40fafc776767ffe1f897029e4febef8a66 (diff) | |
download | FreeBSD-src-47e4dbe85ecb6224aabe5b3cf54f81a1d12e43c3.zip FreeBSD-src-47e4dbe85ecb6224aabe5b3cf54f81a1d12e43c3.tar.gz |
A couple of sensible changes from down under...
Reviewed by: phk
Submitted by: Stephen McKay <syssgm@devetir.qld.gov.au>
Diffstat (limited to 'usr.sbin/ctm')
-rw-r--r-- | usr.sbin/ctm/ctm/ctm_pass1.c | 6 | ||||
-rw-r--r-- | usr.sbin/ctm/ctm/ctm_pass2.c | 9 | ||||
-rw-r--r-- | usr.sbin/ctm/ctm/ctm_pass3.c | 5 |
3 files changed, 14 insertions, 6 deletions
diff --git a/usr.sbin/ctm/ctm/ctm_pass1.c b/usr.sbin/ctm/ctm/ctm_pass1.c index d778414..8d69b18 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.4 1994/09/22 02:49:18 phk Exp $ + * $Id: ctm_pass1.c,v 1.5 1994/11/26 08:57:40 phk Exp $ * */ @@ -93,6 +93,10 @@ Pass1(FILE *fd) fprintf(stderr,"Warning: contains trailing slash\n"); slashwarn++; } + if (p[0] == '/') { + Fatal("Absolute paths are illegal."); + return Exit_Mess; + } break; case CTM_F_Uid: GETFIELD(p,sep); diff --git a/usr.sbin/ctm/ctm/ctm_pass2.c b/usr.sbin/ctm/ctm/ctm_pass2.c index ef6202c..0154602 100644 --- a/usr.sbin/ctm/ctm/ctm_pass2.c +++ b/usr.sbin/ctm/ctm/ctm_pass2.c @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: ctm_pass2.c,v 1.4 1994/09/22 02:49:19 phk Exp $ + * $Id: ctm_pass2.c,v 1.5 1994/11/26 08:57:41 phk Exp $ * */ @@ -80,9 +80,12 @@ Pass2(FILE *fd) break; } if(-1 == stat(name,&st)) { - fprintf(stderr," %s: %s doesn't exists.\n", + fprintf(stderr," %s: %s doesn't exist.\n", sp->Key,name); - ret |= Exit_NotOK; + if (sp->Key[1] == 'R') + ret |= Exit_Forcible; + else + ret |= Exit_NotOK; break; } if (j & CTM_Q_Name_Dir) { diff --git a/usr.sbin/ctm/ctm/ctm_pass3.c b/usr.sbin/ctm/ctm/ctm_pass3.c index 3767b14..cb536fa 100644 --- a/usr.sbin/ctm/ctm/ctm_pass3.c +++ b/usr.sbin/ctm/ctm/ctm_pass3.c @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: ctm_pass3.c,v 1.6 1994/11/27 16:01:29 bde Exp $ + * $Id: ctm_pass3.c,v 1.7 1994/12/04 04:47:31 phk Exp $ * */ @@ -160,7 +160,8 @@ Pass3(FILE *fd) if(!strcmp(sp->Key,"FR")) { if (0 != unlink(name)) { fprintf(stderr,"<%s> unlink failed\n",name); - WRONG + if (!Force) + WRONG } continue; } |