From 02f638f9e098e7b8f1d3de62867638b1ecb2be34 Mon Sep 17 00:00:00 2001 From: ewt Date: Tue, 22 Oct 1996 22:32:20 +0000 Subject: [PATCH] 1) don't use getpwuid() to get username for uid 0, just use "root" CVS patchset: 1131 CVS date: 1996/10/22 22:32:20 --- ftp.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ftp.c b/ftp.c index 52497ec..233c261 100644 --- a/ftp.c +++ b/ftp.c @@ -210,10 +210,14 @@ int ftpOpen(char * host, char * name, char * password, char * proxy, name = "anonymous"; if (!password) { - pw = getpwuid(getuid()); - password = alloca(strlen(pw->pw_name) + 2); - strcpy(password, pw->pw_name); - strcat(password, "@"); + if (getuid()) { + pw = getpwuid(getuid()); + password = alloca(strlen(pw->pw_name) + 2); + strcpy(password, pw->pw_name); + strcat(password, "@"); + } else { + password = "root@"; + } } if (proxy) { -- 2.7.4