buildroot/package/linux-pam/0002-Conditionally-compile-per-ruserok-availability.patch
Brendan Heading 2bf63505eb package/linux-pam: bump version to 1.2.1
Move to the latest release of linux-pam. This allows us to remove
a number of patches and consolidate the existing ones :

- 0001-configure.patch
- 0007-rhosts.patch

these two patches deal with the ruserok function, which is not
usable with uclibc. Consolidated into
0002-Conditionally-compile-per-ruserok-availability.patch.

- 0003-group.patch
- 0005-succeed.patch
- 0006-time.patch

these three patches deal with the innetgr function, which is not
usable with uclibc. Consolidated into
0003-Conditionally-compile-per-innetgr-availability.patch.

- 0004-mkdir.patch

Fixed in upstream, no longer required.

- 0002-doc-makefile-am.patch

renamed to 0001-doc-makefile-am.patch.

- 0008-fix-CVE-2014-2583.patch
- 0009-fix-CVE-2013-7041.patch

These patches are already included in the new release and so
can be safely deleted.

Signed-off-by: Brendan Heading <brendanheading@gmail.com>
Tested-by: Carlos Santos <casantos@datacom.ind.br>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-03-05 16:52:26 +01:00

50 lines
1.7 KiB
Diff

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