Do not use getlogin, it's different (and/or broken) on AIX
Removed external variable `sp' git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@495 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -43,6 +43,7 @@ main(int argc, char **argv)
|
|||||||
int ch, top;
|
int ch, top;
|
||||||
struct passwd *pw = NULL;
|
struct passwd *pw = NULL;
|
||||||
char *cp, homedir[MAXPATHLEN];
|
char *cp, homedir[MAXPATHLEN];
|
||||||
|
struct servent *sp;
|
||||||
|
|
||||||
sp = getservbyname("ftp", "tcp");
|
sp = getservbyname("ftp", "tcp");
|
||||||
if (sp == 0)
|
if (sp == 0)
|
||||||
@@ -98,12 +99,7 @@ main(int argc, char **argv)
|
|||||||
/*
|
/*
|
||||||
* Set up the home directory in case we're globbing.
|
* Set up the home directory in case we're globbing.
|
||||||
*/
|
*/
|
||||||
cp = getlogin();
|
pw = getpwuid(getuid());
|
||||||
if (cp != NULL) {
|
|
||||||
pw = getpwnam(cp);
|
|
||||||
}
|
|
||||||
if (pw == NULL)
|
|
||||||
pw = getpwuid(getuid());
|
|
||||||
if (pw != NULL) {
|
if (pw != NULL) {
|
||||||
home = homedir;
|
home = homedir;
|
||||||
(void) strcpy(home, pw->pw_dir);
|
(void) strcpy(home, pw->pw_dir);
|
||||||
|
Reference in New Issue
Block a user