For people running paranoid ftpds, use the real username to log in
with when running multi-user and we actually have one. Suggested by: Joao Carlos Mendes Luis <jonny@coppe.ufrj.br>
This commit is contained in:
parent
7bb8e61105
commit
6cf4a83ec5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=30067
@ -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$
|
||||
* $Id: ftp.c,v 1.32 1997/02/22 14:11:42 peter 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 @@ mediaInitFTP(Device *dev)
|
||||
|
||||
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));
|
||||
|
@ -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$
|
||||
* $Id: ftp.c,v 1.32 1997/02/22 14:11:42 peter 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 @@ mediaInitFTP(Device *dev)
|
||||
|
||||
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));
|
||||
|
Loading…
Reference in New Issue
Block a user