From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from eddie.linux-mips.org ([148.251.95.138] helo=cvs.linux-mips.org) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1iw09Z-0005R3-8h for ptxdist@pengutronix.de; Mon, 27 Jan 2020 09:53:53 +0100 Received: (from localhost user: 'ladis' uid#1021 fake: STDIN (ladis@eddie.linux-mips.org)) by eddie.linux-mips.org id S23992495AbgA0IxxAgetM (ORCPT ); Mon, 27 Jan 2020 09:53:53 +0100 Date: Mon, 27 Jan 2020 09:53:50 +0100 From: Ladislav Michl Message-ID: <20200127085350.GD901743@lenoch> References: <20200127085111.GA901743@lenoch> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200127085111.GA901743@lenoch> Subject: [ptxdist] [PATCH v2 3/4] shadow: new package List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de Signed-off-by: Ladislav Michl --- Changes: -v2: Avoid conflicting with Busybox, simplify menuconfig rules/shadow.in | 26 ++++++++++ rules/shadow.make | 121 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 147 insertions(+) create mode 100644 rules/shadow.in create mode 100644 rules/shadow.make diff --git a/rules/shadow.in b/rules/shadow.in new file mode 100644 index 000000000..8e1fa2270 --- /dev/null +++ b/rules/shadow.in @@ -0,0 +1,26 @@ +## SECTION=shell_and_console +comment "BusyBox' loginutils selected!" + depends on BUSYBOX_ADDUSER || BUSYBOX_ADDGROUP || BUSYBOX_LOGIN || BUSYBOX_PASSWD || BUSYBOX_SU + +menuconfig SHADOW + tristate + depends on (!BUSYBOX_ADDUSER && !BUSYBOX_ADDGROUP && !BUSYBOX_LOGIN && !BUSYBOX_PASSWD && !BUSYBOX_SU) || ALLYES + select LIBC_CRYPT + select LIBSELINUX if GLOBAL_SELINUX + select PAM if GLOBAL_PAM + prompt "shadow " + help + Password and account management tool suite with support + for shadow files and PAM. + +if SHADOW + +config SHADOW_ADMIN + bool + prompt "install account administration commands" + help + Enable this option if you want to install commands + which manipulate user accout (administer /etc/passwd, + /etc/shadow and /etc/group, /etc/gshadow ...) + +endif diff --git a/rules/shadow.make b/rules/shadow.make new file mode 100644 index 000000000..d9319806f --- /dev/null +++ b/rules/shadow.make @@ -0,0 +1,121 @@ +# -*-makefile-*- +# +# Copyright (C) 2020 by Ladislav Michl +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +PACKAGES-$(PTXCONF_SHADOW) += shadow + +# +# Paths and names +# +SHADOW_VERSION := 4.8.1 +SHADOW_MD5 := 4b05eff8a427cf50e615bda324b5bc45 +SHADOW := shadow-$(SHADOW_VERSION) +SHADOW_SUFFIX := tar.xz +SHADOW_URL := https://github.com/shadow-maint/shadow/releases/download/$(SHADOW_VERSION)/$(SHADOW).$(SHADOW_SUFFIX) +SHADOW_SOURCE := $(SRCDIR)/$(SHADOW).$(SHADOW_SUFFIX) +SHADOW_DIR := $(BUILDDIR)/$(SHADOW) +SHADOW_LICENSE := BSD-3-Clause + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +# +# autoconf +# +SHADOW_CONF_TOOL := autoconf +SHADOW_CONF_OPT := \ + $(CROSS_AUTOCONF_USR) \ + --bindir=/usr/bin \ + --sbindir=/usr/sbin \ + $(GLOBAL_LARGE_FILE_OPTION) \ + --enable-shadowgrp \ + --disable-man \ + --$(call ptx/endis, PTXCONF_GLOBAL_PAM)-account-tools-setuid \ + --disable-utmpx \ + --enable-subordinate-ids \ + --disable-nls \ + --disable-rpath \ + --without-audit \ + --$(call ptx/wwo, PTXCONF_GLOBAL_PAM)-libpam \ + --without-btrfs \ + --$(call ptx/wwo, PTXCONF_GLOBAL_SELINUX)-selinux \ + --without-acl \ + --without-attr \ + --without-skey \ + --without-tcb \ + --without-libcrack \ + --with-sha-crypt \ + --without-nscd \ + --without-sssd \ + --with-su \ + --without-fcaps + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +SHADOW_ADMIN_BIN_PROGS := \ + chage chfn chsh expiry gpasswd newgidmap newgrp newuidmap passwd +SHADOW_ADMIN_SBIN_PROGS := \ + chgpasswd chpasswd \ + groupadd groupdel groupmems groupmod grpck grpconv grpunconv \ + newusers pwck pwconv pwunconv useradd userdel usermod vipw +SHADOW_ADMIN_PAMD := \ + chage chfn chgpasswd chpasswd chsh \ + groupadd groupdel groupmems groupmod \ + newusers passwd useradd userdel usermod + +$(STATEDIR)/shadow.targetinstall: + @$(call targetinfo) + + @$(call install_init, shadow) + @$(call install_fixup, shadow,PRIORITY,optional) + @$(call install_fixup, shadow,SECTION,base) + @$(call install_fixup, shadow,AUTHOR,"Ladislav Michl ") + @$(call install_fixup, shadow,DESCRIPTION,missing) + + @$(call install_copy, shadow, 0, 0, 0755, -, /usr/bin/faillog) + @$(call install_copy, shadow, 0, 0, 0755, -, /usr/bin/groups) + @$(call install_copy, shadow, 0, 0, 0755, -, /usr/bin/lastlog) + @$(call install_copy, shadow, 0, 0, 0755, -, /usr/bin/login) + @$(call install_copy, shadow, 0, 0, 4755, -, /usr/bin/su) + @$(call install_copy, shadow, 0, 0, 0755, -, /usr/sbin/nologin) + + @$(call install_alternative, shadow, 0, 0, 0644, /etc/login.defs) +ifdef PTXCONF_GLOBAL_PAM + @$(call install_alternative, shadow, 0, 0, 0644, /etc/pam.d/login) + @$(call install_alternative, shadow, 0, 0, 0644, /etc/pam.d/su) +endif + +ifdef PTXCONF_SHADOW_ADMIN + @$(foreach prog, $(SHADOW_ADMIN_BIN_PROGS), \ + $(call install_copy, shadow, 0, 0, 4755, -, \ + /usr/bin/$(prog))$(ptx/nl)) + @$(call install_link, shadow, newgrp, /usr/bin/sg) + + @$(foreach prog, $(SHADOW_ADMIN_SBIN_PROGS), \ + $(call install_copy, shadow, 0, 0, 0755, -, \ + /usr/sbin/$(prog))$(ptx/nl)) + @$(call install_link, shadow, vipw, /usr/sbin/wigr) + + @$(call install_alternative, shadow, 0, 0, 0644, /etc/default/useradd) +ifdef PTXCONF_GLOBAL_PAM + @$(foreach pam, $(SHADOW_ADMIN_PAMD), \ + $(call install_alternative, shadow, 0, 0, 0644, \ + /etc/pam.d/$(pam))$(ptx/nl)) +endif +endif + + @$(call install_finish, shadow) + + @$(call touch) + +# vim: syntax=make -- 2.25.0 _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de