summaryrefslogtreecommitdiffstats
path: root/loader/ftp.c
diff options
context:
space:
mode:
authorjakub <jakub>2000-08-07 11:45:49 +0000
committerjakub <jakub>2000-08-07 11:45:49 +0000
commit440c7c040b3fb919efda03185097606d1ad080be (patch)
tree77f5eedbb0e11a295edb17de6e43d895ad07cc68 /loader/ftp.c
parent2e8cc2f6429b22f3d6eb0beb871aa5aa29bf8900 (diff)
downloadanaconda-440c7c040b3fb919efda03185097606d1ad080be.tar.gz
anaconda-440c7c040b3fb919efda03185097606d1ad080be.tar.xz
anaconda-440c7c040b3fb919efda03185097606d1ad080be.zip
The IMHO safe part of the stripping down changes.
Saves more than 200KB of the /sbin/loader's unused crap.
Diffstat (limited to 'loader/ftp.c')
-rw-r--r--loader/ftp.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/loader/ftp.c b/loader/ftp.c
index 2c53631f3..c76916143 100644
--- a/loader/ftp.c
+++ b/loader/ftp.c
@@ -228,13 +228,14 @@ int ftpOpen(char * host, char * name, char * password, char * proxy,
name = "anonymous";
if (!password) {
+ password = "root@";
if (getuid()) {
pw = getpwuid(getuid());
- password = alloca(strlen(pw->pw_name) + 2);
- strcpy(password, pw->pw_name);
- strcat(password, "@");
- } else {
- password = "root@";
+ if (pw) {
+ password = alloca(strlen(pw->pw_name) + 2);
+ strcpy(password, pw->pw_name);
+ strcat(password, "@");
+ }
}
}