source: npl/system/netkit-ftp/patches/32-netkit-ftp-0.17-getlogin.patch

Last change on this file was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100644
File size: 1.1 KB
RevLine 
[c5c522c]1--- netkit-ftp-0.17-dist/ftp/ftp.c      2012-10-02 14:44:06.328343277 +0200
2+++ netkit-ftp-0.17-new/ftp/ftp.c       2012-10-03 09:07:47.381868330 +0200
3@@ -328,14 +328,12 @@ dologin(const char *host)
4                return(0);
5        }
6        while (luser == NULL) {
7-               char *myname = getlogin();
8+               char *myname = NULL;
9 
10-               if (myname == NULL) {
11-                       struct passwd *pp = getpwuid(getuid());
12+               struct passwd *pp = getpwuid(getuid());
13 
14-                       if (pp != NULL)
15-                               myname = pp->pw_name;
16-               }
17+               if (pp != NULL)
18+                       myname = pp->pw_name;
19                if (myname)
20                        printf("Name (%s:%s): ", host, myname);
21                else
22--- netkit-ftp-0.17-dist/ftp/main.c     2012-10-02 14:44:06.330343274 +0200
23+++ netkit-ftp-0.17-new/ftp/main.c      2012-10-03 09:07:36.849862227 +0200
24@@ -204,12 +204,7 @@ main(volatile int argc, char **volatile
25        /*
26         * Set up the home directory in case we're globbing.
27         */
28-       cp = getlogin();
29-       if (cp != NULL) {
30-               pw = getpwnam(cp);
31-       }
32-       if (pw == NULL)
33-               pw = getpwuid(getuid());
34+       pw = getpwuid(getuid());
35        if (pw != NULL) {
36                strncpy(homedir, pw->pw_dir, sizeof(homedir));
37                homedir[sizeof(homedir)-1] = 0;
Note: See TracBrowser for help on using the repository browser.