diff options
author | Bruce Evans <bde@FreeBSD.org> | 1995-02-16 11:42:36 +0000 |
---|---|---|
committer | Bruce Evans <bde@FreeBSD.org> | 1995-02-16 11:42:36 +0000 |
commit | 829b9f6e93ed336ff13324a94af0a1c015c346c9 (patch) | |
tree | 69dd2bff00ab95f1784e13cecd5744894f7b4a88 /usr.bin/ftp | |
parent | 3ab1adc555e046444147cb543672cbd2f703361a (diff) | |
download | src-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.c | 4 | ||||
-rw-r--r-- | usr.bin/ftp/main.c | 2 |
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); |