diff options
author | brian <brian@FreeBSD.org> | 1999-04-07 14:05:03 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1999-04-07 14:05:03 +0000 |
commit | 1f94ee27968b1aa23d58ad3c398e034b8afddfff (patch) | |
tree | 3b545a9d4abdba8880addb0b960e41780e8a58ca /usr.bin | |
parent | 37c783b7891d1cfb8771028b6893c5d5d88f804e (diff) | |
download | FreeBSD-src-1f94ee27968b1aa23d58ad3c398e034b8afddfff.zip FreeBSD-src-1f94ee27968b1aa23d58ad3c398e034b8afddfff.tar.gz |
Don't perform the trimdomain() functionality twice,
trimdomain() now works as expected.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/login/login.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/usr.bin/login/login.c b/usr.bin/login/login.c index 3ee0c74..34698e0 100644 --- a/usr.bin/login/login.c +++ b/usr.bin/login/login.c @@ -42,7 +42,7 @@ static char copyright[] = static char sccsid[] = "@(#)login.c 8.4 (Berkeley) 4/2/94"; #endif static const char rcsid[] = - "$Id: login.c,v 1.44 1999/01/03 23:39:33 eivind Exp $"; + "$Id: login.c,v 1.45 1999/01/19 22:59:37 abial Exp $"; #endif /* not lint */ /* @@ -138,10 +138,9 @@ main(argc, argv) int changepass; time_t warntime; uid_t uid, euid; - char *domain, *p, *ttyn; + char *p, *ttyn; char tbuf[MAXPATHLEN + 2]; char tname[sizeof(_PATH_TTY) + 10]; - char localhost[MAXHOSTNAMELEN]; char *shell = NULL; login_cap_t *lc = NULL; @@ -167,12 +166,7 @@ main(argc, argv) * host to login so that it may be placed in utmp and wtmp */ *full_hostname = '\0'; - domain = NULL; term = NULL; - if (gethostname(localhost, sizeof(localhost)) < 0) - syslog(LOG_ERR, "couldn't get local hostname: %m"); - else - domain = strchr(localhost, '.'); fflag = hflag = pflag = 0; uid = getuid(); @@ -187,11 +181,8 @@ main(argc, argv) errx(1, "-h option: %s", strerror(EPERM)); hflag = 1; strncpy(full_hostname, optarg, sizeof(full_hostname)-1); - if (domain && (p = strchr(optarg, '.')) && - strcasecmp(p, domain) == 0) - *p = 0; - trimdomain(optarg, UT_HOSTSIZE ); + trimdomain(optarg, UT_HOSTSIZE); if (strlen(optarg) > UT_HOSTSIZE) { struct hostent *hp = gethostbyname(optarg); |