hc
2023-11-06 15ade055295d13f95d49e3d99b09f3bbfb4a43e7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
ruserok is not available/functional in uclibc, provide conditions
for compilation where needed.
 
Patch originally by Dmitry Golubovsky <golubovsky@gmail.com> -
porting to linux-pam 1.2.1.
 
Signed-off-by: Brendan Heading <brendanheading@gmail.com>
 
Upstream-status: pending
 
---
 configure.ac                    | 2 +-
 modules/pam_rhosts/pam_rhosts.c | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
 
diff --git a/configure.ac b/configure.ac
index 08e4530..fd2fd23 100644
--- a/configure.ac
+++ b/configure.ac
@@ -542,7 +542,7 @@ AC_CHECK_FUNCS(fseeko getdomainname gethostname gettimeofday lckpwdf mkdir selec
 AC_CHECK_FUNCS(strcspn strdup strspn strstr strtol uname)
 AC_CHECK_FUNCS(getutent_r getpwnam_r getpwuid_r getgrnam_r getgrgid_r getspnam_r)
 AC_CHECK_FUNCS(getgrouplist getline getdelim)
-AC_CHECK_FUNCS(inet_ntop inet_pton innetgr ruserok_af)
+AC_CHECK_FUNCS(inet_ntop inet_pton innetgr ruserok_af ruserok)
 
 AC_CHECK_FUNCS(unshare, [UNSHARE=yes], [UNSHARE=no])
 AM_CONDITIONAL([HAVE_UNSHARE], [test "$UNSHARE" = yes])
diff --git a/modules/pam_rhosts/pam_rhosts.c b/modules/pam_rhosts/pam_rhosts.c
index bc9e76f..909db29 100644
--- a/modules/pam_rhosts/pam_rhosts.c
+++ b/modules/pam_rhosts/pam_rhosts.c
@@ -114,8 +114,12 @@ int pam_sm_authenticate (pam_handle_t *pamh, int flags, int argc,
 #ifdef HAVE_RUSEROK_AF
     retval = ruserok_af (rhost, as_root, ruser, luser, PF_UNSPEC);
 #else
+  #ifdef HAVE_RUSEROK
     retval = ruserok (rhost, as_root, ruser, luser);
-#endif
+  #else
+    retval = -1;
+  #endif  /* HAVE_RUSEROK */
+#endif  /*HAVE_RUSEROK_AF */
     if (retval != 0) {
       if (!opt_silent || opt_debug)
     pam_syslog(pamh, LOG_WARNING, "denied access to %s@%s as %s",
-- 
2.4.3