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:
Assar Westerlund
1996-06-10 01:47:03 +00:00
parent 68d5842818
commit 6ffe374413

View File

@@ -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) {