summaryrefslogtreecommitdiffstats
path: root/usr.bin/ftp
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1995-02-16 11:42:36 +0000
committerbde <bde@FreeBSD.org>1995-02-16 11:42:36 +0000
commit5ab11f181a31c5d62d479f554e13080ed64ebc57 (patch)
tree69dd2bff00ab95f1784e13cecd5744894f7b4a88 /usr.bin/ftp
parente0acfb2a4801cfdeffa6440c9a8cdda5530da463 (diff)
downloadFreeBSD-src-5ab11f181a31c5d62d479f554e13080ed64ebc57.zip
FreeBSD-src-5ab11f181a31c5d62d479f554e13080ed64ebc57.tar.gz
Fix checking of directory access for "/foo". The parent directory is
"/", not "".
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 1ea43b9..5ac4cf1 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 0edff5e..7f2165d 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);
OpenPOWER on IntegriCloud