From patchwork Wed Sep 5 03:16:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitry Golubovsky X-Patchwork-Id: 181717 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 9C45B2C008F for ; Wed, 5 Sep 2012 13:17:01 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 7CC1680045; Wed, 5 Sep 2012 03:16:59 +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 iVXLJwB5Bz8l; Wed, 5 Sep 2012 03:16:48 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 386998065B; Wed, 5 Sep 2012 03:16:44 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 0E3C78F75E for ; Wed, 5 Sep 2012 03:16:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 44E53804FC for ; Wed, 5 Sep 2012 03:16:38 +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 xGX5376yJRS7 for ; Wed, 5 Sep 2012 03:16:35 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from www.golubovsky.org (www.golubovsky.org [66.92.54.88]) by whitealder.osuosl.org (Postfix) with ESMTP id 159038065B for ; Wed, 5 Sep 2012 03:16:35 +0000 (UTC) Received: by www.golubovsky.org (Postfix, from userid 1002) id 9EEDFE8B10; Tue, 4 Sep 2012 23:16:34 -0400 (EDT) From: Dmitry To: buildroot@busybox.net Date: Tue, 4 Sep 2012 23:16:29 -0400 Message-Id: <1346814989-17138-2-git-send-email-golubovsky@gmail.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1346814989-17138-1-git-send-email-golubovsky@gmail.com> References: <1346814989-17138-1-git-send-email-golubovsky@gmail.com> Cc: Dmitry Subject: [Buildroot] [PATCH 2/2] PAM support in Busybox if linux-pam is built X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Signed-off-by: Dmitry Acked-by: "Yann E. MORIN" --- package/busybox/Config.in | 15 +++++++++++++++ package/busybox/busybox.mk | 12 ++++++++++++ 2 files changed, 27 insertions(+), 0 deletions(-) diff --git a/package/busybox/Config.in b/package/busybox/Config.in index dedcf18..21ff3fb 100644 --- a/package/busybox/Config.in +++ b/package/busybox/Config.in @@ -62,6 +62,21 @@ config BR2_PACKAGE_BUSYBOX_WATCHDOG Install the watchdog daemon startup script, that just start at the boot the busybox watchdog daemon. +config BR2_PACKAGE_BUSYBOX_PAM + bool "Enable PAM support in Busybox" + default n + depends on BR2_PACKAGE_LINUX_PAM + help + If this item is selected, Busybox login will use the PAM stack + for local logins. Local logins with null password are allowed + for users with records in /etc/passwd ("default" and "root") + per the /etc/pam.d/login file. + The default PAM configuration file /etc/pam.d/default requires + user accounts with nonzero length passwords. + These files are provided by the linux-pam package. Buildroot + users opting to use PAM are strongly advised to supply their + own PAM configuration files for proper authentication model. + if BR2_PACKAGE_BUSYBOX_WATCHDOG config BR2_PACKAGE_BUSYBOX_WATCHDOG_PERIOD diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk index 33f8633..21942c6 100644 --- a/package/busybox/busybox.mk +++ b/package/busybox/busybox.mk @@ -164,6 +164,17 @@ define BUSYBOX_INSTALL_WATCHDOG_SCRIPT endef endif +ifeq ($(BR2_PACKAGE_BUSYBOX_PAM),y) +BUSYBOX_DEPENDENCIES += linux-pam +define BUSYBOX_ENABLE_PAM + $(call KCONFIG_ENABLE_OPT,CONFIG_PAM,$(BUSYBOX_BUILD_CONFIG)) +endef +else +define BUSYBOX_ENABLE_PAM + $(call KCONFIG_DISABLE_OPT,CONFIG_PAM,$(BUSYBOX_BUILD_CONFIG)) +endef +endif + # We do this here to avoid busting a modified .config in configure BUSYBOX_POST_EXTRACT_HOOKS += BUSYBOX_COPY_CONFIG @@ -179,6 +190,7 @@ define BUSYBOX_CONFIGURE_CMDS $(BUSYBOX_DISABLE_MMU_APPLETS) $(BUSYBOX_SET_INIT) $(BUSYBOX_SET_WATCHDOG) + $(BUSYBOX_ENABLE_PAM) @yes "" | $(MAKE) ARCH=$(KERNEL_ARCH) CROSS_COMPILE="$(TARGET_CROSS)" \ -C $(@D) oldconfig endef