diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-06-03 16:34:55 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-06-03 16:34:55 +0000 |
commit | 58cc48dd15e92ff4be5300f9de57c30bcd314bb8 (patch) | |
tree | 1924a64eddbb35e503eac921728f33ce9c2a679a | |
parent | 7cbd0f09957baa7a85cb201458fc3a8078448197 (diff) |
correct anonftp passwd
-rw-r--r-- | usr.bin/ftp/ftp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/ftp/ftp.c b/usr.bin/ftp/ftp.c index 0496b16c435..da041dd1164 100644 --- a/usr.bin/ftp/ftp.c +++ b/usr.bin/ftp/ftp.c @@ -202,6 +202,7 @@ login(host) char *user, *pass, *acct; int n, aflag = 0; char anonpass[MAXHOSTNAMELEN+2+32]; + char hostname[MAXHOSTNAMELEN]; user = pass = acct = 0; if (ruserpass(host, &user, &pass, &acct) < 0) { @@ -212,7 +213,8 @@ login(host) user = getlogin(); strncpy(anonpass, user, 32); strcat(anonpass, "@"); - gethostname(&anonpass[strlen(anonpass)-1], MAXHOSTNAMELEN); + gethostname(hostname, sizeof hostname); + strcat(anonpass, hostname); pass = anonpass; user = "anonymous"; } |