From patchwork Thu Jun 16 16:23:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Pavlidis X-Patchwork-Id: 1644498 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=googlemail.com header.i=@googlemail.com header.a=rsa-sha256 header.s=20210112 header.b=hl3+7+RK; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LP6vF1QKmz9sG0 for ; Fri, 17 Jun 2022 02:24:24 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id EDCA941023; Thu, 16 Jun 2022 16:24:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id S-pp13cVYWYZ; Thu, 16 Jun 2022 16:24:19 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id BC2044102A; Thu, 16 Jun 2022 16:24:18 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 419E91BF44C for ; Thu, 16 Jun 2022 16:24:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 2FDF441023 for ; Thu, 16 Jun 2022 16:24:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KoE7wOyA4lBI for ; Thu, 16 Jun 2022 16:24:16 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by smtp2.osuosl.org (Postfix) with ESMTPS id CC7D540CE5 for ; Thu, 16 Jun 2022 16:24:15 +0000 (UTC) Received: by mail-ed1-x52a.google.com with SMTP id n28so2892978edb.9 for ; Thu, 16 Jun 2022 09:24:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XbNB3U5uqqYPMSgiDwknFBSQ5Hu1xNoAhqzL8bPIAz8=; b=hl3+7+RKh5csYoP4HfKaVpp/+mJAV0vsJAzXPOUOYDDr4Fvy3qUXC/jiiwS+fxg/1h XqL2s5ZET9d9g6LcMSjkbmISmpuqu4yKK3SyJW4nWBbtFE0p28R7WqjC/4GIB8q4ikcC H2+NGH3dhuicIhgLmf9j+9k0oK2Iz1JCxpucLlGXHIwz1hmbkLV1MaKrM/Yfy/lvXUNY H4wcA1DTdKuUH3JYiPGo9znzCZd6Waqjh9Ms9vUU10vrq3BdNkIN/zzhIhvDgutGbFRL T8E3IVYQYZ2UlGYaJjI8q2KcltGOiJ7JycefkqeO2j8ZM7O4Ng9Wy0oT4VScGckByYiD 95Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XbNB3U5uqqYPMSgiDwknFBSQ5Hu1xNoAhqzL8bPIAz8=; b=PU3fO9QFqUyp9t+6l8P9TmQmccIujnVhNjcjt3g9TYqoRS8xrPvYj235ech7sMw/pQ mSQfEhLF4D2V8hymlLMvWqgSBAn9JVxhY82u4fGROzVTukDtQOq2IdUg+/GXPUP1dUC4 596Mql5dfA5E2p2r4JaTBRfYjIv5WxLLwIrHVpEKdZ7ubA5PlLALVG3VuodicS3lnIat 8vaHo+aYWspwFalN4zE8qDYwSwo8NRFyo/tXl7dvQhP7L79qjrMyHoI87hGD25yqOkWe P1G+0FBwMDFhu6HkXB4ybxNvC5hrCyVar4BJF8IaSk3LmBPKYITlNJN06Z9ShWTsbIbP tx6A== X-Gm-Message-State: AJIora9xh+LYSFoiOdj4twgMocIYSfvHQ47lI+DOLMF+oObKyUeu2LTC CT0Q1FnCddGCxTSspgR3w03YHTdQnT+cHsH1 X-Google-Smtp-Source: AGRyM1s6/afqRQ7CMmCFYoPzVAJ4sJUx68RCzgujkgUej5YpA/L8krsg0ml60vdCxGJcLUwBkB5h5Q== X-Received: by 2002:aa7:c952:0:b0:434:edcc:f247 with SMTP id h18-20020aa7c952000000b00434edccf247mr7420231edt.412.1655396653911; Thu, 16 Jun 2022 09:24:13 -0700 (PDT) Received: from LinkTed.fritz.box ([2a02:8070:41a4:2c00:5e48:90c:7bda:e6d5]) by smtp.gmail.com with ESMTPSA id z6-20020a17090665c600b0070bdc059ab2sm962253ejn.138.2022.06.16.09.24.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jun 2022 09:24:13 -0700 (PDT) X-Google-Original-From: Raphael Pavlidis To: buildroot@buildroot.org Date: Thu, 16 Jun 2022 18:23:58 +0200 Message-Id: <20220616162358.3142-1-raphael.pavlidis@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v1 1/1] package/shadow: new package X-BeenThere: buildroot@buildroot.org 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: , X-Patchwork-Original-From: Raphael Pavlidis via buildroot From: Raphael Pavlidis Reply-To: Raphael Pavlidis Cc: Raphael Pavlidis , Thomas Petazzoni Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" shadow provides utilities to deal with user accounts. Signed-off-by: Raphael Pavlidis --- package/Config.in | 1 + package/shadow/Config.in | 81 ++++++++++++++++++ package/shadow/shadow.hash | 3 + package/shadow/shadow.mk | 171 +++++++++++++++++++++++++++++++++++++ 4 files changed, 256 insertions(+) create mode 100644 package/shadow/Config.in create mode 100644 package/shadow/shadow.hash create mode 100644 package/shadow/shadow.mk diff --git a/package/Config.in b/package/Config.in index 3b089166da..c281a01a5d 100644 --- a/package/Config.in +++ b/package/Config.in @@ -2591,6 +2591,7 @@ menu "System tools" source "package/sdbus-cpp/Config.in" source "package/sdbusplus/Config.in" source "package/seatd/Config.in" + source "package/shadow/Config.in" source "package/smack/Config.in" source "package/start-stop-daemon/Config.in" source "package/supervisor/Config.in" diff --git a/package/shadow/Config.in b/package/shadow/Config.in new file mode 100644 index 0000000000..616f002618 --- /dev/null +++ b/package/shadow/Config.in @@ -0,0 +1,81 @@ +menuconfig BR2_PACKAGE_SHADOW + bool "shadow" + depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14 + help + Utilities to deal with user accounts. + + https://github.com/shadow-maint/shadow + +if BR2_PACKAGE_SHADOW + +config BR2_PACKAGE_SHADOW_SHADOWGRP + bool "shadowgrp" + default y + help + Enable shadow group support. + +if BR2_PACKAGE_LINUX_PAM + +config BR2_PACKAGE_SHADOW_ACCOUNT_TOOLS_SETUID + bool "account-tools-setuid" + help + Install the user and group management tools setuid and authenticate the + callers. + +endif # BR2_PACKAGE_LINUX_PAM + +config BR2_PACKAGE_SHADOW_UTMPX + bool "utmpx" + help + Enable loggin in utmpx / wtmpx. + +config BR2_PACKAGE_SHADOW_SUBORDINATE_IDS + bool "subordinate-ids" + default y + help + Support subordinate ids. + +config BR2_PACKAGE_SHADOW_SHA_CRYPT + bool "sha-crypt" + default y + help + Allow the SHA256 and SHA512 password encryption algorithms. + +config BR2_PACKAGE_SHADOW_BCRYPT + bool "bcrypt" + help + Allow the bcrypt password encryption algorithm. + +config BR2_PACKAGE_SHADOW_YESCRYPT + bool "yescrypt" + help + Allow the yescrypt password encryption algorithm. + +config BR2_PACKAGE_SHADOW_NSCD + bool "nscd" + default y + help + Enable support for nscd. + +config BR2_PACKAGE_SHADOW_SSSD + bool "sssd" + default y + help + Define to support flushing of sssd caches. + +config BR2_PACKAGE_SHADOW_GROUP_NAME_MAX_LENGTH + int "group-name-max-length" + default 16 + help + Set max group name length. (0 equals infinity) + +config BR2_PACKAGE_SHADOW_SU + bool "su" + default y + help + Build and install su program. + +endif # BR2_PACKAGE_SHADOW + +comment "shadow needs a toolchain w/ headers >= 4.14" + depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14 diff --git a/package/shadow/shadow.hash b/package/shadow/shadow.hash new file mode 100644 index 0000000000..6b9faac10f --- /dev/null +++ b/package/shadow/shadow.hash @@ -0,0 +1,3 @@ +# Locally computed +sha256 41f093ce58b2ae5f389a1c5553e0c18bc73e6fe27f66273891991198a7707c95 shadow-4.11.1.tar.xz +sha256 3d25ab8f43fdc14624296a56ff8dc3e72e499ad35f32ae0c803f4959cfe17c0a COPYING diff --git a/package/shadow/shadow.mk b/package/shadow/shadow.mk new file mode 100644 index 0000000000..140d830cb9 --- /dev/null +++ b/package/shadow/shadow.mk @@ -0,0 +1,171 @@ +################################################################################ +# +# shadow +# +################################################################################ + +SHADOW_VERSION = 4.11.1 +SHADOW_SITE = https://github.com/shadow-maint/shadow/releases/download/v$(SHADOW_VERSION) +SHADOW_SOURCE = shadow-$(SHADOW_VERSION).tar.xz +SHADOW_LICENSE = BSD-3-Clause +SHADOW_LICENSE_FILES = COPYING + +SHADOW_CONF_OPTS += \ + --disable-man \ + --without-btrfs \ + --without-skey \ + --without-tcb + +ifeq ($(BR2_STATIC_LIBS),y) +SHADOW_CONF_OPTS += --enable-static +else +SHADOW_CONF_OPTS += --disable-static +endif + +ifeq ($(BR2_SHARED_LIBS),y) +SHADOW_CONF_OPTS += --enable-shared +else +SHADOW_CONF_OPTS += --disable-shared +endif + +ifeq ($(BR2_PACKAGE_SHADOW_SHADOWGRP),y) +SHADOW_CONF_OPTS += --enable-shadowgrp +else +SHADOW_CONF_OPTS += --disable-shadowgrp +endif + +ifeq ($(BR2_PACKAGE_SHADOW_ACCOUNT_TOOLS_SETUID),y) +SHADOW_CONF_OPTS += --enable-account-tools-setuid +SHADOW_ACCOUNT_TOOLS_SETUID = \ + /usr/sbin/chgpasswd f 4755 0 0 - - - - - \ + /usr/sbin/chpasswd f 4755 0 0 - - - - - \ + /usr/sbin/groupadd f 4755 0 0 - - - - - \ + /usr/sbin/groupdel f 4755 0 0 - - - - - \ + /usr/sbin/groupmod f 4755 0 0 - - - - - \ + /usr/sbin/newusers f 4755 0 0 - - - - - \ + /usr/sbin/useradd f 4755 0 0 - - - - - \ + /usr/sbin/usermod f 4755 0 0 - - - - - +else +SHADOW_CONF_OPTS += --disable-account-tools-setuid +endif + +ifeq ($(BR2_PACKAGE_SHADOW_UTMPX),y) +SHADOW_CONF_OPTS += --enable-utmpx +else +SHADOW_CONF_OPTS += --disable-utmpx +endif + +ifeq ($(BR2_PACKAGE_SHADOW_SUBORDINATE_IDS),y) +SHADOW_CONF_OPTS += --enable-subordinate-ids +SHADOW_SUBORDINATE_IDS_PERMISSIONS = \ + /usr/bin/newuidmap f 4755 0 0 - - - - - \ + /usr/bin/newgidmap f 4755 0 0 - - - - - +else +SHADOW_CONF_OPTS += --disable-subordinate-ids +endif + +ifeq ($(BR2_PACKAGE_ACL),y) +SHADOW_CONF_OPTS += --with-acl +SHADOW_DEPENDENCIES += acl +else +SHADOW_CONF_OPTS += --without-acl +endif + +ifeq ($(BR2_PACKAGE_ATTR),y) +SHADOW_CONF_OPTS += --with-attr +SHADOW_DEPENDENCIES += attr +else +SHADOW_CONF_OPTS += --without-attr +endif + +ifeq ($(BR2_PACKAGE_AUDIT),y) +SHADOW_CONF_OPTS += --with-audit +SHADOW_DEPENDENCIES += audit +else +SHADOW_CONF_OPTS += --without-audit +endif + +ifeq ($(BR2_PACKAGE_CRACKLIB),y) +SHADOW_CONF_OPTS += --with-libcrack +SHADOW_DEPENDENCIES += cracklib +else +SHADOW_CONF_OPTS += --without-libcrack +endif + +ifeq ($(BR2_PACKAGE_LIBSELINUX),y) +SHADOW_CONF_OPTS += --with-selinux +SHADOW_DEPENDENCIES += libselinux libsemanage +else +SHADOW_CONF_OPTS += --without-selinux +endif + +ifeq ($(BR2_PACKAGE_LINUX_PAM),y) +SHADOW_CONF_OPTS += --with-libpam +SHADOW_DEPENDENCIES += linux-pam +else +SHADOW_CONF_OPTS += --without-libpam +endif + +ifeq ($(BR2_ENABLE_LOCALE),y) +SHADOW_CONF_OPTS += --enable-nls +else +SHADOW_CONF_OPTS += --disable-nls +endif + +ifeq ($(BR2_PACKAGE_SHADOW_SHA_CRYPT),y) +SHADOW_CONF_OPTS += --with-sha-crypt +else +SHADOW_CONF_OPTS += --without-sha-crypt +endif + +ifeq ($(BR2_PACKAGE_SHADOW_BCRYPT),y) +SHADOW_CONF_OPTS += --with-bcrypt +else +SHADOW_CONF_OPTS += --without-bcrypt +endif + +ifeq ($(BR2_PACKAGE_SHADOW_YESCRYPT),y) +SHADOW_CONF_OPTS += --with-yescrypt +else +SHADOW_CONF_OPTS += --without-yescrypt +endif + +ifeq ($(BR2_PACKAGE_SHADOW_NSCD),y) +SHADOW_CONF_OPTS += --with-nscd +else +SHADOW_CONF_OPTS += --without-nscd +endif + +ifeq ($(BR2_PACKAGE_SHADOW_SSSD),y) +SHADOW_CONF_OPTS += --with-sssd +else +SHADOW_CONF_OPTS += --without-sssd +endif + +ifeq ($(BR2_PACKAGE_SHADOW_GROUP_NAME_MAX_LENGTH),0) +SHADOW_CONF_OPTS += --without-group-name-max-length +else +SHADOW_CONF_OPTS += --with-group-name-max-length=$(BR2_PACKAGE_SHADOW_GROUP_NAME_MAX_LENGTH) +endif + +ifeq ($(BR2_PACKAGE_SHADOW_SU),y) +SHADOW_CONF_OPTS += --with-su +SHADOW_SU_PERMISSIONS = /bin/su f 4755 0 0 - - - - - +else +SHADOW_CONF_OPTS += --without-su +endif + +define SHADOW_PERMISSIONS + /usr/bin/chage f 4755 0 0 - - - - - + /usr/bin/chfn f 4755 0 0 - - - - - + /usr/bin/chsh f 4755 0 0 - - - - - + /usr/bin/expiry f 4755 0 0 - - - - - + /usr/bin/gpasswd f 4755 0 0 - - - - - + /usr/bin/newgrp f 4755 0 0 - - - - - + /usr/bin/passwd f 4755 0 0 - - - - - + $(SHADOW_ACCOUNT_TOOLS_SETUID) + $(SHADOW_SUBORDINATE_IDS_PERMISSIONS) + $(SHADOW_SU_PERMISSIONS) +endef + +$(eval $(autotools-package))