summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rlogind/rlogind.c17
-rw-r--r--libexec/rshd/rshd.c10
2 files changed, 4 insertions, 23 deletions
diff --git a/libexec/rlogind/rlogind.c b/libexec/rlogind/rlogind.c
index 817f6c8..11cf1c1 100644
--- a/libexec/rlogind/rlogind.c
+++ b/libexec/rlogind/rlogind.c
@@ -597,21 +597,8 @@ do_rlogin(dest)
return (-1);
/* XXX why don't we syslog() failure? */
- af = dest->su_family;
- switch (af) {
- case AF_INET:
- addr = (char *)&dest->su_sin.sin_addr;
- break;
-#ifdef INET6
- case AF_INET6:
- addr = (char *)&dest->su_sin6.sin6_addr;
- break;
-#endif
- default:
- return -1; /*EAFNOSUPPORT*/
- }
-
- return (iruserok_af(addr, pwd->pw_uid == 0, rusername, lusername, af));
+ return (iruserok_sa(dest, dest->su_len, pwd->pw_uid == 0, rusername,
+ lusername));
}
void
diff --git a/libexec/rshd/rshd.c b/libexec/rshd/rshd.c
index e5e07a4..cdc2ce1 100644
--- a/libexec/rshd/rshd.c
+++ b/libexec/rshd/rshd.c
@@ -408,14 +408,8 @@ doit(fromp)
if (errorstr ||
(pwd->pw_expire && time(NULL) >= pwd->pw_expire) ||
(pwd->pw_passwd != 0 && *pwd->pw_passwd != '\0' &&
- iruserok_af(
-#ifdef INET6
- (af == AF_INET6)
- ? (void *)&fromp->su_sin6.sin6_addr :
-#endif
- (void *)&fromp->su_sin.sin_addr,
- pwd->pw_uid == 0,
- remuser, locuser, af) < 0)) {
+ iruserok_sa(fromp, fromp->su_len, pwd->pw_uid == 0,
+ remuser, locuser) < 0)) {
if (__rcmd_errstr)
syslog(LOG_INFO|LOG_AUTH,
"%s@%s as %s: permission denied (%s). cmd='%.80s'",
OpenPOWER on IntegriCloud