similarity index 72%
rename from meta-perl/recipes-perl/adduser/adduser_3.118.bb
rename to meta-perl/recipes-perl/adduser/adduser_3.159.bb
@@ -3,20 +3,20 @@ DESCRIPTION = "adduser, addgroup - add a user or group to the system"
HOMEPAGE = "https://salsa.debian.org/debian/adduser"
SECTION = "base/utils"
-LICENSE = "GPL-2.0-only"
-LIC_FILES_CHKSUM = "file://debian/copyright;md5=caed49ab166f22ef31bf1127f558d0ef"
+LICENSE = "GPL-2.0-or-later"
+LIC_FILES_CHKSUM = "file://debian/copyright;md5=9e982a4577268e2f3982abceafde3067"
SRC_URI = "https://launchpad.net/debian/+archive/primary/+sourcefiles/adduser/${PV}/${BPN}_${PV}.tar.xz \
file://adduser-add-M-option-for-useradd.patch \
file://0001-adduser-set-default-shell-with-sbin-nologin.patch \
"
-SRC_URI[sha256sum] = "3e9eea661c9aac6b2c791bfcc1de3a9c6a422d45c8f3d38ed417737ed3166ffc"
+SRC_URI[sha256sum] = "f732ec215661c4f1d36593493852d29fb5b17ebc4e7614730fea47dab2a888cd"
UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/a/adduser"
UPSTREAM_CHECK_REGEX = "adduser_(?P<pver>\d+(\.\d+)+)"
-S = "${UNPACKDIR}/${BPN}"
+S = "${UNPACKDIR}/work"
inherit cpan-base update-alternatives
@@ -25,8 +25,9 @@ do_install() {
install -m 0755 ${S}/adduser ${D}${sbindir}
install -m 0755 ${S}/deluser ${D}${sbindir}
- install -D -m 0644 ${S}/AdduserCommon.pm ${D}${libdir}/perl5/${@get_perl_version(d)}/Debian/AdduserCommon.pm
- sed -i -e "s/VERSION/${PV}/" ${D}${sbindir}/*
+ install -d ${D}${libdir}/perl5/${@get_perl_version(d)}/Debian
+ install -m 0644 ${S}/Adduser*.pm ${D}${libdir}/perl5/${@get_perl_version(d)}/Debian
+ sed -i -e "s/DVERSION/${PV}/" ${D}${sbindir}/*
install -d ${D}/${sysconfdir}
install -m 0644 ${S}/*.conf ${D}/${sysconfdir}
@@ -41,10 +42,17 @@ do_install() {
RDEPENDS:${PN} += "\
shadow \
- perl-module-getopt-long \
- perl-module-overloading \
+ perl-module-constant \
+ perl-module-encode \
+ perl-module-fcntl \
perl-module-file-find \
perl-module-file-temp \
+ perl-module-getopt-long \
+ perl-module-i18n-langinfo \
+ perl-module-parent \
+ perl-module-posix \
+ perl-module-utf8 \
+ perl-module-version \
"
ALTERNATIVE:${PN} = "adduser deluser addgroup delgroup"
@@ -1,4 +1,4 @@
-From 75e949bf80bf5e3e5bd8f81b258095e662b705c4 Mon Sep 17 00:00:00 2001
+From cf91c9420d2305ed585675811ac5528fe03c6464 Mon Sep 17 00:00:00 2001
From: Kai Kang <kai.kang@windriver.com>
Date: Thu, 9 Jan 2020 13:51:28 +0800
Subject: [PATCH] adduser: set default shell with /sbin/nologin
@@ -13,22 +13,51 @@ Upstream-Status: Inappropriate [OE specific]
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
- adduser | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ adduser | 6 +++---
+ deluser | 2 +-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/adduser b/adduser
-index 0f24cc9..ab554d0 100755
+index e7cad37..62cbe72 100755
--- a/adduser
+++ b/adduser
-@@ -431,7 +431,7 @@ if ($action eq "addsysuser") {
- printf gtx("Adding new user `%s' (UID %d) with group `%s' ...\n"),$new_name,$new_uid,$ingroup_name
- if $verbose;
- $home_dir = $special_home || &homedir($new_name, $ingroup_name);
-- $shell = $special_shell || '/usr/sbin/nologin';
-+ $shell = $special_shell || '/sbin/nologin';
+@@ -729,7 +729,7 @@ if ($action eq "addsysuser") {
+ $home_dir = $special_home || $uid_pool{$new_name}{'home'} || '/nonexistent';
+ $no_create_home = $home_dir =~ /^\/+nonexistent(\/|$)/ ? 1 : $no_create_home;
+
+- $shell = $special_shell || $uid_pool{$new_name}{'shell'} || '/usr/sbin/nologin';
++ $shell = $special_shell || $uid_pool{$new_name}{'shell'} || '/sbin/nologin';
$undouser = $new_name;
- my $useradd = &which('useradd');
- &systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s',
-2.17.1
-
+
+ my $useradd = which('useradd');
+@@ -1002,7 +1002,7 @@ if ($action eq "adduser") {
+ if( !$disabled_login ) {
+ $shell = $special_shell || $uid_pool{$new_name}{'shell'} || $config{"dshell"};
+ } else {
+- $shell = $special_shell || $uid_pool{$new_name}{'shell'} || "/usr/sbin/nologin";
++ $shell = $special_shell || $uid_pool{$new_name}{'shell'} || "/sbin/nologin";
+ }
+ log_debug( "creating new user %s with home_dir %s and shell %s", $new_name, $home_dir, $shell );
+ $undouser = $new_name;
+@@ -1298,7 +1298,7 @@ sub unlock_user {
+ my $ret = existing_user_status(\%config, $user_name, undef);
+ if ($ret & EXISTING_FOUND) {
+ if ($ret & EXISTING_LOCKED) {
+- my $default_shell = $system ? "/usr/sbin/nologin" : "/bin/bash";
++ my $default_shell = $system ? "/sbin/nologin" : "/bin/bash";
+
+ # Get current shell state if available
+ my $shell = get_state_value($user_name, "shell") // $default_shell;
+diff --git a/deluser b/deluser
+index 4b2d430..5a85580 100755
+--- a/deluser
++++ b/deluser
+@@ -339,7 +339,7 @@ if($action eq "deluser") {
+ acquire_lock();
+ set_state_value($user, "shell", $egpwn_shell);
+ set_state_value($user, "locked", 1);
+- my $lock_ret = &systemcall('usermod', "-e", 1, "-f", 0, "-L", "-s", "/usr/sbin/nologin", $user);
++ my $lock_ret = &systemcall('usermod', "-e", 1, "-f", 0, "-L", "-s", "/sbin/nologin", $user);
+ if( $lock_ret == 0 ) {
+ log_info( mtx("user `%s' successfully locked.\n", $user) );
+ } else {
@@ -1,4 +1,4 @@
-From 55a0adfc416ad85dbc440eaa667d98c200a8ce62 Mon Sep 17 00:00:00 2001
+From 03c388835a10c67ca5ad5ec288a1a8b3e0c6fa40 Mon Sep 17 00:00:00 2001
From: Jackie Huang <jackie.huang@windriver.com>
Date: Thu, 18 Dec 2014 17:23:37 +0800
Subject: [PATCH] adduser: add -M option for useradd
@@ -15,31 +15,26 @@ Upstream-Status: Submitted [1]
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
- adduser | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ adduser | 2 ++
+ 1 file changed, 2 insertions(+)
diff --git a/adduser b/adduser
-index a5f83f3..f6cb52c 100755
+index 9f195bc..e7cad37 100755
--- a/adduser
+++ b/adduser
-@@ -435,7 +435,7 @@ if ($action eq "addsysuser") {
- $undouser = $new_name;
- my $useradd = &which('useradd');
- &systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s',
-- $shell, '-u', $new_uid, $new_name);
-+ $shell, '-u', $new_uid, '-M', $new_name);
- if(!$disabled_login) {
- my $usermod = &which('usermod');
- &systemcall($usermod, '-p', '*', $new_name);
-@@ -525,7 +525,7 @@ if ($action eq "adduser") {
- $undouser = $new_name;
- my $useradd = &which('useradd');
- &systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s',
-- $shell, '-u', $new_uid, $new_name);
-+ $shell, '-u', $new_uid, '-M', $new_name);
- &invalidate_nscd();
-
- create_homedir (1); # copy skeleton data
-1.8.5.2
-
+@@ -742,6 +742,7 @@ if ($action eq "addsysuser") {
+ '-g', $ingroup_name,
+ '-s', $shell,
+ '-u', $new_uid,
++ '-M',
+ $new_name);
+ if( $ua_ret == RET_INVALID_NAME_FROM_USERADD ) {
+ $returnvalue = RET_INVALID_NAME_FROM_USERADD;
+@@ -1012,6 +1013,7 @@ if ($action eq "adduser") {
+ '-g', $primary_gid,
+ '-s', $shell,
+ '-u', $new_uid,
++ '-M',
+ $new_name);
+ if( $ret == RET_INVALID_NAME_FROM_USERADD ) {
+ $returnvalue = RET_INVALID_NAME_FROM_USERADD;
The code is now split into several Debian::Adduser* modules, install all of them, and substitute DVERSION instead of VERSION, which now also appears in the module version checks. The tarball unpacks to work/. Refresh both patches, the nologin one also covers the new default shell uses in adduser and deluser. Update RDEPENDS for the modules the new code loads, overloading is no longer used. License-Update: debian/copyright is now machine readable. All files are GPL-2+, as the old text already said, so correct LICENSE to GPL-2.0-or-later. AI-Generated: Uses Claude Code Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com> --- .../{adduser_3.118.bb => adduser_3.159.bb} | 24 +++++--- ...-set-default-shell-with-sbin-nologin.patch | 59 ++++++++++++++----- .../adduser-add-M-option-for-useradd.patch | 45 +++++++------- 3 files changed, 80 insertions(+), 48 deletions(-) rename meta-perl/recipes-perl/adduser/{adduser_3.118.bb => adduser_3.159.bb} (72%)