Get hostname even if user has no '.netrc' file.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@576 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -71,6 +71,10 @@ ruserpass(char *host, char **aname, char **apass, char **aacct)
|
||||
int t, i, c, usedefault = 0;
|
||||
struct stat stb;
|
||||
|
||||
if(k_gethostname(myhostname, MaxHostNameLen) < 0)
|
||||
strcpy(myhostname, "");
|
||||
if((mydomain = strchr(myhostname, '.')) == NULL)
|
||||
mydomain = myhostname;
|
||||
hdir = getenv("HOME");
|
||||
if (hdir == NULL)
|
||||
hdir = ".";
|
||||
@@ -81,10 +85,6 @@ ruserpass(char *host, char **aname, char **apass, char **aacct)
|
||||
warn("%s", buf);
|
||||
return (0);
|
||||
}
|
||||
if(k_gethostname(myhostname, MaxHostNameLen) < 0)
|
||||
strcpy(myhostname, "");
|
||||
if((mydomain = strchr(myhostname, '.')) == NULL)
|
||||
mydomain = myhostname;
|
||||
|
||||
next:
|
||||
while ((t = token())) switch(t) {
|
||||
|
Reference in New Issue
Block a user