arjitkumar / rpms / ftp

Forked from rpms/ftp 5 years ago
Clone

Blame SOURCES/netkit-ftp-0.17-getlogin.patch

09d58c
--- netkit-ftp-0.17-dist/ftp/ftp.c	2012-10-02 14:44:06.328343277 +0200
09d58c
+++ netkit-ftp-0.17-new/ftp/ftp.c	2012-10-03 09:07:47.381868330 +0200
09d58c
@@ -328,14 +328,12 @@ dologin(const char *host)
09d58c
 		return(0);
09d58c
 	}
09d58c
 	while (luser == NULL) {
09d58c
-		char *myname = getlogin();
09d58c
+		char *myname = NULL;
09d58c
 
09d58c
-		if (myname == NULL) {
09d58c
-			struct passwd *pp = getpwuid(getuid());
09d58c
+		struct passwd *pp = getpwuid(getuid());
09d58c
 
09d58c
-			if (pp != NULL)
09d58c
-				myname = pp->pw_name;
09d58c
-		}
09d58c
+		if (pp != NULL)
09d58c
+			myname = pp->pw_name;
09d58c
 		if (myname)
09d58c
 			printf("Name (%s:%s): ", host, myname);
09d58c
 		else
09d58c
--- netkit-ftp-0.17-dist/ftp/main.c	2012-10-02 14:44:06.330343274 +0200
09d58c
+++ netkit-ftp-0.17-new/ftp/main.c	2012-10-03 09:07:36.849862227 +0200
09d58c
@@ -204,12 +204,7 @@ main(volatile int argc, char **volatile
09d58c
 	/*
09d58c
 	 * Set up the home directory in case we're globbing.
09d58c
 	 */
09d58c
-	cp = getlogin();
09d58c
-	if (cp != NULL) {
09d58c
-		pw = getpwnam(cp);
09d58c
-	}
09d58c
-	if (pw == NULL)
09d58c
-		pw = getpwuid(getuid());
09d58c
+	pw = getpwuid(getuid());
09d58c
 	if (pw != NULL) {
09d58c
 		strncpy(homedir, pw->pw_dir, sizeof(homedir));
09d58c
 		homedir[sizeof(homedir)-1] = 0;