added my Recipes
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
SUMMARY = "a utility to add users/groups to the system"
|
||||
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"
|
||||
|
||||
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[md5sum] = "44ba2475ebdaafc9613236bdda321c97"
|
||||
SRC_URI[sha256sum] = "3e9eea661c9aac6b2c791bfcc1de3a9c6a422d45c8f3d38ed417737ed3166ffc"
|
||||
|
||||
S = "${WORKDIR}/${BPN}"
|
||||
|
||||
inherit cpan-base update-alternatives
|
||||
|
||||
do_install() {
|
||||
install -d ${D}${sbindir}
|
||||
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}/${sysconfdir}
|
||||
install -m 0644 ${S}/*.conf ${D}/${sysconfdir}
|
||||
|
||||
install -d ${D}${mandir}/man5
|
||||
install -m 0644 ${S}/doc/*.conf.5 ${D}${mandir}/man5
|
||||
install -d ${D}${mandir}/man8
|
||||
install -m 0644 ${S}/doc/*.8 ${D}${mandir}/man8
|
||||
install -d ${D}${docdir}/${BPN}
|
||||
cp -rf ${S}/examples ${D}${docdir}/${BPN}
|
||||
}
|
||||
|
||||
RDEPENDS:${PN} += "\
|
||||
shadow \
|
||||
perl-module-getopt-long \
|
||||
perl-module-overloading \
|
||||
perl-module-file-find \
|
||||
perl-module-file-temp \
|
||||
"
|
||||
|
||||
ALTERNATIVE:${PN} = "adduser deluser addgroup delgroup"
|
||||
ALTERNATIVE_PRIORITY = "60"
|
||||
ALTERNATIVE_LINK_NAME[adduser] = "${sbindir}/adduser"
|
||||
ALTERNATIVE_LINK_NAME[deluser] = "${sbindir}/deluser"
|
||||
ALTERNATIVE_LINK_NAME[addgroup] = "${sbindir}/addgroup"
|
||||
ALTERNATIVE_LINK_NAME[delgroup] = "${sbindir}/delgroup"
|
||||
ALTERNATIVE_TARGET[addgroup] = "${sbindir}/adduser.${BPN}"
|
||||
ALTERNATIVE_TARGET[delgroup] = "${sbindir}/deluser.${BPN}"
|
||||
@@ -0,0 +1,34 @@
|
||||
From 75e949bf80bf5e3e5bd8f81b258095e662b705c4 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
|
||||
|
||||
Shell nologin whether provided by shadow or util-linux is installed to
|
||||
/sbin/nologin in oe-core. But the default shell of adduser is
|
||||
/usr/sbin/nologin and will fail to create a new user.
|
||||
|
||||
Set the default shell with /sbin/nologin to fix the issue.
|
||||
|
||||
Upstream-Status: Inappropriate [OE specific]
|
||||
|
||||
Signed-off-by: Kai Kang <kai.kang@windriver.com>
|
||||
---
|
||||
adduser | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/adduser b/adduser
|
||||
index 0f24cc9..ab554d0 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';
|
||||
$undouser = $new_name;
|
||||
my $useradd = &which('useradd');
|
||||
&systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s',
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
From 55a0adfc416ad85dbc440eaa667d98c200a8ce62 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
|
||||
|
||||
The useradd (from package passwd) in debian based system sets -M (--no-create-home) by default,
|
||||
but the one we are using (from package shadow) sets -m (--create-home) by default, so we
|
||||
need to explicitly add -M option for useradd call or it will try to create home twice and
|
||||
throw a confused message:
|
||||
"The home directory `/home/newuser' already exists. Not copying from `/etc/skel'"
|
||||
|
||||
Upstream-Status: Submitted [1]
|
||||
|
||||
[1] https://lists.alioth.debian.org/pipermail/adduser-devel/2016-October/005478.html
|
||||
|
||||
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
|
||||
---
|
||||
adduser | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/adduser b/adduser
|
||||
index a5f83f3..f6cb52c 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
|
||||
|
||||
Reference in New Issue
Block a user