From patchwork Sat Jan 25 10:41:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrice Fontaine X-Patchwork-Id: 1229190 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=ZgM3BlFw; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 484XbP5PHgz9sRf for ; Sat, 25 Jan 2020 21:40:33 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0272B877A6; Sat, 25 Jan 2020 10:40:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BZFC5daiinJg; Sat, 25 Jan 2020 10:40:29 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 4429F876F6; Sat, 25 Jan 2020 10:40:29 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 2A8AA1BF3E6 for ; Sat, 25 Jan 2020 10:40:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2762586935 for ; Sat, 25 Jan 2020 10:40:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FE3IB-IdQJsu for ; Sat, 25 Jan 2020 10:40:26 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 5D0E786933 for ; Sat, 25 Jan 2020 10:40:26 +0000 (UTC) Received: by mail-wr1-f47.google.com with SMTP id b6so5120961wrq.0 for ; Sat, 25 Jan 2020 02:40:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FCWi0MMAa6RYCX1UBI7vZw0MWIyVfyKolu/JpqEtVSE=; b=ZgM3BlFwQFIOb01/JixS0/xz5pvQovgih9EZjZ0ouuh+/47FT8xgg5siIWhYlm9cnF ZExE7pMf+ULXUv+15hQGr40v9z74q9/k4cv9YxLa/47UeHF+4IDoR0ynjDh6FQZt5xLg FDNamqEmDs5wRqUnY0FUuwvey6Jeh4UjFt91oA0k0K6VXx9OxRJjH9B0PRLtQOnt0qS6 9EHO50FoaeIW7qP/M43jnhGFlcYxw3DZaZ4t+62A0lhdFdzG8FB1yTgod5sBNG6PX6X1 1Pn1TSg40pVkuNfNrQCnxCQqDFvudE9RHxn7r96ZWGifYEoVpHMNwPLUzLE+YnzdE017 ABJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FCWi0MMAa6RYCX1UBI7vZw0MWIyVfyKolu/JpqEtVSE=; b=WgV7qg32491PO01eAJczWNYDetcKHf83d8FI97ks9fqf5TDaMC5OPckBnTmme2WEbV HQvg/WuCAyTnlV+ZkCS9cioAgOiIvGdzS/PYpyCo2K0Fv6NGa6WfzxhsCx7QMiskvuf4 3tb7umpORU8PvfDQX+U7nGdmPFH0czR37lI9psEfDknCl6tYAbiLVO9/Ddl5ZByvJjqF aQZjX9N0M4PvlmRwFDU7dFa8y2A3vAwMxwJa+4ozytjzwf+TDpCrNs8ITzgetmHL8mBG lPLxVlA2jkYF2V93/1CuK2i0sC44Jt6KFytUIkmDpsRn5yRp1hRpbcz/Za7ikSqH4zGZ fZ1Q== X-Gm-Message-State: APjAAAUfsf/RFotLoAJAlcaBV7oZ2Y+jIjufcbGhwCXn+pYG28HmnOEY +OE8VNKs1BpB5mM9WHF0yhWZTbYk X-Google-Smtp-Source: APXvYqy/XkpPkvHhMyieMSCn0krUlyDJURBly7MtdDhFnvwqC/URRq2VfPb0VrM5R22dwZ5/I8ViFg== X-Received: by 2002:adf:f78e:: with SMTP id q14mr9410854wrp.186.1579948824466; Sat, 25 Jan 2020 02:40:24 -0800 (PST) Received: from kali.home (lfbn-ren-1-602-70.w81-53.abo.wanadoo.fr. [81.53.179.70]) by smtp.gmail.com with ESMTPSA id u14sm10489733wrm.51.2020.01.25.02.40.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Jan 2020 02:40:23 -0800 (PST) From: Fabrice Fontaine To: buildroot@buildroot.org Date: Sat, 25 Jan 2020 11:41:21 +0100 Message-Id: <20200125104121.2095695-1-fontaine.fabrice@gmail.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] package/linux-pam: replace second patch by upstream patch X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fabrice Fontaine Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Fabrice Fontaine --- ...lly-compile-per-ruserok-availability.patch | 49 ------------ ...-ruserok-nor-ruserok_af-is-available.patch | 77 +++++++++++++++++++ 2 files changed, 77 insertions(+), 49 deletions(-) delete mode 100644 package/linux-pam/0002-Conditionally-compile-per-ruserok-availability.patch create mode 100644 package/linux-pam/0002-build-ignore-pam_rhosts-if-neither-ruserok-nor-ruserok_af-is-available.patch diff --git a/package/linux-pam/0002-Conditionally-compile-per-ruserok-availability.patch b/package/linux-pam/0002-Conditionally-compile-per-ruserok-availability.patch deleted file mode 100644 index cec642d845..0000000000 --- a/package/linux-pam/0002-Conditionally-compile-per-ruserok-availability.patch +++ /dev/null @@ -1,49 +0,0 @@ -ruserok is not available/functional in uclibc, provide conditions -for compilation where needed. - -Patch originally by Dmitry Golubovsky - -porting to linux-pam 1.2.1. - -Signed-off-by: Brendan Heading - -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 - diff --git a/package/linux-pam/0002-build-ignore-pam_rhosts-if-neither-ruserok-nor-ruserok_af-is-available.patch b/package/linux-pam/0002-build-ignore-pam_rhosts-if-neither-ruserok-nor-ruserok_af-is-available.patch new file mode 100644 index 0000000000..8e9710c799 --- /dev/null +++ b/package/linux-pam/0002-build-ignore-pam_rhosts-if-neither-ruserok-nor-ruserok_af-is-available.patch @@ -0,0 +1,77 @@ +From 1d1d3b59af50c40efcc74f9c3f37b446a921e83e Mon Sep 17 00:00:00 2001 +From: Yousong Zhou +Date: Wed, 17 Jun 2015 18:19:23 +0800 +Subject: [PATCH] build: ignore pam_rhosts if neither ruserok nor ruserok_af is + available. + +* configure.ac: check for ruserok and ruserok_af +* modules/Makefile.am: ignore pam_rhosts/ if it's disabled +* modules/pam_rhosts/pam_rhosts.c: include stdlib.h for malloc and free + +Signed-off-by: Yousong Zhou +[Retrieved from: +https://github.com/linux-pam/linux-pam/commit/1d1d3b59af50c40efcc74f9c3f37b446a921e83e] +Signed-off-by: Fabrice Fontaine +--- + configure.ac | 5 ++++- + modules/Makefile.am | 11 ++++++++--- + modules/pam_rhosts/pam_rhosts.c | 1 + + 3 files changed, 13 insertions(+), 4 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 3012ceb5..69748614 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -532,7 +532,10 @@ 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) ++AC_CHECK_FUNCS([ruserok_af ruserok], [break]) ++ ++AM_CONDITIONAL([COND_BUILD_PAM_RHOSTS], [test "$ac_cv_func_ruserok_af" = yes -o "$ac_cv_func_ruserok" = yes]) + + AC_CHECK_FUNCS(unshare, [UNSHARE=yes], [UNSHARE=no]) + AM_CONDITIONAL([HAVE_UNSHARE], [test "$UNSHARE" = yes]) +diff --git a/modules/Makefile.am b/modules/Makefile.am +index 0c80cea9..9ad26a9b 100644 +--- a/modules/Makefile.am ++++ b/modules/Makefile.am +@@ -2,16 +2,21 @@ + # Copyright (c) 2005, 2006, 2008 Thorsten Kukuk + # + +-SUBDIRS = pam_access pam_cracklib pam_debug pam_deny pam_echo \ ++if COND_BUILD_PAM_RHOSTS ++ MAYBE_PAM_RHOSTS = pam_rhosts ++endif ++ ++SUBDIRS := pam_access pam_cracklib pam_debug pam_deny pam_echo \ + pam_env pam_exec pam_faildelay pam_filter pam_ftp \ + pam_group pam_issue pam_keyinit pam_lastlog pam_limits \ + pam_listfile pam_localuser pam_loginuid pam_mail \ + pam_mkhomedir pam_motd pam_namespace pam_nologin \ +- pam_permit pam_pwhistory pam_rhosts pam_rootok pam_securetty \ ++ pam_permit pam_pwhistory pam_rootok pam_securetty \ + pam_selinux pam_sepermit pam_shells pam_stress \ + pam_succeed_if pam_tally pam_tally2 pam_time pam_timestamp \ + pam_tty_audit pam_umask \ +- pam_unix pam_userdb pam_warn pam_wheel pam_xauth ++ pam_unix pam_userdb pam_warn pam_wheel pam_xauth \ ++ $(MAYBE_PAM_RHOSTS) + + CLEANFILES = *~ + +diff --git a/modules/pam_rhosts/pam_rhosts.c b/modules/pam_rhosts/pam_rhosts.c +index ed98d630..60c9e854 100644 +--- a/modules/pam_rhosts/pam_rhosts.c ++++ b/modules/pam_rhosts/pam_rhosts.c +@@ -35,6 +35,7 @@ + #include + #include + #include ++#include + #include + + #define PAM_SM_AUTH /* only defines this management group */