summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-08-02 10:13:36 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-08-02 10:13:36 +0000
commit9242a74a784638d6d832b211e1455f682a88933b (patch)
treee742e62c8723a6376dcebd2abf8859b4459d7af5 /libexec
parentb6bca3a1b026b17bc53833284603bedab10561d8 (diff)
local_domain/topdomain unneeded
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rlogind/rlogind.c44
1 files changed, 1 insertions, 43 deletions
diff --git a/libexec/rlogind/rlogind.c b/libexec/rlogind/rlogind.c
index 77043204c91..cf016a9397e 100644
--- a/libexec/rlogind/rlogind.c
+++ b/libexec/rlogind/rlogind.c
@@ -39,7 +39,7 @@ static char copyright[] =
#ifndef lint
/* from: static char sccsid[] = "@(#)rlogind.c 8.1 (Berkeley) 6/4/93"; */
-static char *rcsid = "$Id: rlogind.c,v 1.7 1996/07/31 09:25:46 deraadt Exp $";
+static char *rcsid = "$Id: rlogind.c,v 1.8 1996/08/02 10:13:35 deraadt Exp $";
#endif /* not lint */
/*
@@ -719,45 +719,3 @@ usage()
syslog(LOG_ERR, "usage: rlogind [-aln]");
#endif
}
-
-/*
- * Check whether host h is in our local domain,
- * defined as sharing the last two components of the domain part,
- * or the entire domain part if the local domain has only one component.
- * If either name is unqualified (contains no '.'),
- * assume that the host is local, as it will be
- * interpreted as such.
- */
-int
-local_domain(h)
- char *h;
-{
- char localhost[MAXHOSTNAMELEN];
- char *p1, *p2;
-
- localhost[0] = 0;
- (void) gethostname(localhost, sizeof(localhost));
- p1 = topdomain(localhost);
- p2 = topdomain(h);
- if (p1 == NULL || p2 == NULL || !strcasecmp(p1, p2))
- return (1);
- return (0);
-}
-
-char *
-topdomain(h)
- char *h;
-{
- register char *p;
- char *maybe = NULL;
- int dots = 0;
-
- for (p = h + strlen(h); p >= h; p--) {
- if (*p == '.') {
- if (++dots == 2)
- return (p);
- maybe = p;
- }
- }
- return (maybe);
-}