diff options
| author | Jordan K. Hubbard <jkh@FreeBSD.org> | 1997-10-03 03:32:20 +0000 |
|---|---|---|
| committer | Jordan K. Hubbard <jkh@FreeBSD.org> | 1997-10-03 03:32:20 +0000 |
| commit | 867c3565c2155ffb64f54d0f1ba2d05e096e4d29 (patch) | |
| tree | 79267bc0b6845c2f34ced98f85593148a533ca75 /release/sysinstall | |
| parent | 39689f1c5d66e3fce8d86c5e6fd77ac4bf7375c4 (diff) | |
Notes
Diffstat (limited to 'release/sysinstall')
| -rw-r--r-- | release/sysinstall/ftp.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/release/sysinstall/ftp.c b/release/sysinstall/ftp.c index ac1c42289498..5a64c313c0d4 100644 --- a/release/sysinstall/ftp.c +++ b/release/sysinstall/ftp.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: ftp.c,v 1.18.2.11 1997/02/18 16:23:10 jkh Exp $ + * $Id: ftp.c,v 1.18.2.12 1997/02/27 11:48:39 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -41,6 +41,7 @@ #include <sys/param.h> #include <sys/wait.h> #include <netdb.h> +#include <pwd.h> #include <ftpio.h> Boolean ftpInitted = FALSE; @@ -113,8 +114,16 @@ try: if (variable_get(VAR_FTP_PASS)) SAFE_STRCPY(password, variable_get(VAR_FTP_PASS)); - else + else if (RunningAsInit) sprintf(password, "installer@%s", variable_get(VAR_HOSTNAME)); + else { + struct passwd *pw; + char *user; + + pw = getpwuid(getuid()); + user = pw ? pw->pw_name : "ftp"; + sprintf(password, "%s@%s", user, variable_get(VAR_HOSTNAME)); + } msgNotify("Logging in to %s@%s..", login_name, hostname); if ((OpenConn = ftpLogin(hostname, login_name, password, FtpPort, isDebug(), &code)) == NULL) { msgConfirm("Couldn't open FTP connection to %s:\n %s.", hostname, ftpErrString(code)); |
