aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/ftp
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1995-02-16 11:42:36 +0000
committerBruce Evans <bde@FreeBSD.org>1995-02-16 11:42:36 +0000
commit829b9f6e93ed336ff13324a94af0a1c015c346c9 (patch)
tree69dd2bff00ab95f1784e13cecd5744894f7b4a88 /usr.bin/ftp
parent3ab1adc555e046444147cb543672cbd2f703361a (diff)
downloadsrc-829b9f6e93ed336ff13324a94af0a1c015c346c9.tar.gz
src-829b9f6e93ed336ff13324a94af0a1c015c346c9.zip
Fix checking of directory access for "/foo". The parent directory is
"/", not "".
Notes
Notes: svn path=/head/; revision=6493
Diffstat (limited to 'usr.bin/ftp')
-rw-r--r--usr.bin/ftp/ftp.c4
-rw-r--r--usr.bin/ftp/main.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/ftp/ftp.c b/usr.bin/ftp/ftp.c
index 1ea43b99a986..5ac4cf1c65d5 100644
--- a/usr.bin/ftp/ftp.c
+++ b/usr.bin/ftp/ftp.c
@@ -749,7 +749,7 @@ recvrequest(cmd, local, remote, lmode, printnames)
}
if (dir != NULL)
*dir = 0;
- d = access(dir ? local : ".", 2);
+ d = access(dir == local ? "/" : dir ? local : ".", 2);
if (dir != NULL)
*dir = '/';
if (d < 0) {
@@ -1445,7 +1445,7 @@ gunique(local)
if (cp)
*cp = '\0';
- d = access(cp ? local : ".", 2);
+ d = access(cp == local ? "/" : cp ? local : ".", 2);
if (cp)
*cp = '/';
if (d < 0) {
diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c
index 0edff5ee1473..7f2165d9b12e 100644
--- a/usr.bin/ftp/main.c
+++ b/usr.bin/ftp/main.c
@@ -220,6 +220,8 @@ tail(filename)
break;
if (s[1])
return (s + 1);
+ if (s == filename)
+ break; XXX
*s = '\0';
}
return (filename);