From patchwork Sun Jan 14 21:03:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Naour X-Patchwork-Id: 860528 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zKTVl4hR9z9s7n for ; Mon, 15 Jan 2018 08:03:59 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id C05CE2F375; Sun, 14 Jan 2018 21:03:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bgV4O9mExOS8; Sun, 14 Jan 2018 21:03:54 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 877FC2F35C; Sun, 14 Jan 2018 21:03:54 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 01D421C2C7A for ; Sun, 14 Jan 2018 21:03:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id EEDAA2F35C for ; Sun, 14 Jan 2018 21:03:52 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id woOb7keVJHid for ; Sun, 14 Jan 2018 21:03:51 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from idris.smile.fr (idris.smile.fr [91.216.209.19]) by silver.osuosl.org (Postfix) with ESMTPS id 719652739F for ; Sun, 14 Jan 2018 21:03:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by idris.smile.fr (Postfix) with ESMTP id D2F381EE23BC; Sun, 14 Jan 2018 22:03:49 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at smile.fr Received: from idris.smile.fr ([127.0.0.1]) by localhost (bluemind-mta.prod.vitry.intranet [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QpsgmTdgPLBn; Sun, 14 Jan 2018 22:03:49 +0100 (CET) Received: from localhost.localdomain (gam75-1-81-57-22-125.fbx.proxad.net [81.57.22.125]) by idris.smile.fr (Postfix) with ESMTPSA id 893391EE23B6; Sun, 14 Jan 2018 22:03:49 +0100 (CET) From: Romain Naour To: buildroot@buildroot.org Date: Sun, 14 Jan 2018 22:03:29 +0100 Message-Id: <1515963815-5843-2-git-send-email-romain.naour@smile.fr> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515963815-5843-1-git-send-email-romain.naour@smile.fr> References: <1515963815-5843-1-git-send-email-romain.naour@smile.fr> Subject: [Buildroot] [PATCH 1/7] package/skeleton-init-common: add /bin/sh to /etc/shells X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Romain Naour MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Add the default shell /bin/sh to /etc/shells only if BR2_SYSTEM_BIN_SH_NONE is not selected. Add an empty /etc/shells in the rootfs skeleton. Signed-off-by: Romain Naour --- package/skeleton-init-common/skeleton-init-common.mk | 7 +++++++ system/skeleton/etc/shells | 1 + 2 files changed, 8 insertions(+) create mode 100644 system/skeleton/etc/shells diff --git a/package/skeleton-init-common/skeleton-init-common.mk b/package/skeleton-init-common/skeleton-init-common.mk index 8228a81..707f1aa 100644 --- a/package/skeleton-init-common/skeleton-init-common.mk +++ b/package/skeleton-init-common/skeleton-init-common.mk @@ -79,6 +79,12 @@ define SKELETON_INIT_COMMON_SET_BIN_SH rm -f $(TARGET_DIR)/bin/sh endef else +# Add /bin/sh to /etc/shells otherwise some login tools like dropbear +# can reject the user connexion. See man shells. +define SKELETON_INIT_COMMON_ADD_SH_TO_SHELLS + grep -qsE '^/bin/sh' $(TARGET_DIR)/etc/shells \ + || echo "/bin/sh" >> $(TARGET_DIR)/etc/shells +endef ifneq ($(SKELETON_INIT_COMMON_BIN_SH),) define SKELETON_INIT_COMMON_SET_BIN_SH ln -sf $(SKELETON_INIT_COMMON_BIN_SH) $(TARGET_DIR)/bin/sh @@ -86,5 +92,6 @@ endef endif endif SKELETON_INIT_COMMON_TARGET_FINALIZE_HOOKS += SKELETON_INIT_COMMON_SET_BIN_SH +SKELETON_INIT_COMMON_POST_INSTALL_TARGET_HOOKS += SKELETON_INIT_COMMON_ADD_SH_TO_SHELLS $(eval $(generic-package)) diff --git a/system/skeleton/etc/shells b/system/skeleton/etc/shells new file mode 100644 index 0000000..b5fd584 --- /dev/null +++ b/system/skeleton/etc/shells @@ -0,0 +1 @@ +# /etc/shells: valid login shells