Less bogus domain name handling.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@611 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1996-07-25 22:49:46 +00:00
parent f18b6e207b
commit cd29da2b9e
2 changed files with 19 additions and 10 deletions

View File

@@ -75,6 +75,8 @@ ruserpass(char *host, char **aname, char **apass, char **aacct)
strcpy(myhostname, "");
if((mydomain = strchr(myhostname, '.')) == NULL)
mydomain = myhostname;
else
mydomain++;
hdir = getenv("HOME");
if (hdir == NULL)
hdir = ".";
@@ -107,11 +109,13 @@ next:
if (strcasecmp(hostname, tokval) == 0)
goto match;
if ((tmp = strchr(hostname, '.')) != NULL &&
tmp++ &&
strcasecmp(tmp, mydomain) == 0 &&
strncasecmp(hostname, tokval, tmp-hostname) == 0 &&
tokval[tmp - hostname] == '\0')
goto match;
if ((tmp = strchr(host, '.')) != NULL &&
tmp++ &&
strcasecmp(tmp, mydomain) == 0 &&
strncasecmp(host, tokval, tmp - host) == 0 &&
tokval[tmp - host] == '\0')