Skip to contentSkip to conversation

Use ALTERNATIVES to manage 'nologin'

PATCH In review Chen Qi 2 participants 4 messages Nov 21, 2014 – Nov 9, 2015

lore
Share & tools
lore

Chen Qi

author
#0 lore raw

v2 cover Use ALTERNATIVES to manage 'nologin'

The following changes since commit 4a888b2ab61662c7f749b5d1e64af92ed613d8eb:

gtk+: drop part of patch adding useless file (2014-11-20 14:08:57 +0000)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib ChenQi/nologin-alternatives
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=ChenQi/nologin-alternatives

Chen Qi (2):
util-linux: use ALTERNATIVE mechanism to manage 'nologin'
shadow: use ALTERNATIVE to manage 'nologin'

 meta/recipes-core/util-linux/util-linux.inc | 3 ++-
 meta/recipes-extended/shadow/shadow.inc     | 7 ++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH v2 1/2 util-linux: use ALTERNATIVE mechanism to manage 'nologin'

Both shadow and util-linux provide 'nologin' command, so use the ALTERNATIVE mechanism in OE to manage it.

---
 meta/recipes-core/util-linux/util-linux.inc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-core/util-linux/util-linux.inc +2 -1
index a37efe9..1c45485 100644
@@ -170,7 +170,7 @@ ALTERNATIVE_PRIORITY = "100"
 
 ALTERNATIVE_${PN}  = "dmesg kill more mkswap blockdev pivot_root"
 ALTERNATIVE_${PN} += "mkfs.minix hexdump last logger mesg renice wall"
-ALTERNATIVE_${PN} += "setsid chrt flock utmpdump eject sulogin"
+ALTERNATIVE_${PN} += "setsid chrt flock utmpdump eject sulogin nologin"
 
 ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg"
 ALTERNATIVE_LINK_NAME[kill] = "${base_bindir}/kill"
@@ -181,6 +181,7 @@ ALTERNATIVE_LINK_NAME[pivot_root] = "${base_sbindir}/pivot_root"
 ALTERNATIVE_LINK_NAME[mkfs.minix] = "${base_sbindir}/mkfs.minix"
 ALTERNATIVE_LINK_NAME[eject] = "${bindir}/eject"
 ALTERNATIVE_LINK_NAME[sulogin] = "${base_sbindir}/sulogin"
+ALTERNATIVE_LINK_NAME[nologin] = "${sbindir}/nologin"
 
 ALTERNATIVE_${PN}-doc = "mountpoint.1 last.1 mesg.1 wall.1 sulogin.8 utmpdump.1 reset.1"
 
Signature · 1 line
1.9.1
author
#2 lore raw

PATCH v2 2/2 shadow: use ALTERNATIVE to manage 'nologin'

In reply to Chen Qi

Both util-linux and shadow provide 'nologin', so use the ALTERNATIVE mechanism in OE to manage it.

---
 meta/recipes-extended/shadow/shadow.inc | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
meta/recipes-extended/shadow/shadow.inc +6 -1
index 14c7281..81924e2 100644
@@ -146,18 +146,23 @@ do_install_append() {
 	# Handle link properly after rename, otherwise missing files would
 	# lead rpm failed dependencies.
 	ln -sf newgrp.${BPN} ${D}${bindir}/sg
+
+	# mv nologin to nologin.${BPN}
+	mv ${D}${base_sbindir}/nologin ${D}${base_sbindir}/nologin.${BPN}
 }
 
 inherit update-alternatives
 
 ALTERNATIVE_PRIORITY = "200"
 
-ALTERNATIVE_${PN} = "passwd chfn newgrp chsh groups chpasswd login vipw vigr su"
+ALTERNATIVE_${PN} = "passwd chfn newgrp chsh groups chpasswd login vipw vigr su nologin"
 ALTERNATIVE_LINK_NAME[chpasswd] = "${sbindir}/chpasswd"
 ALTERNATIVE_LINK_NAME[login] = "${base_bindir}/login"
 ALTERNATIVE_LINK_NAME[vipw] = "${base_sbindir}/vipw"
 ALTERNATIVE_LINK_NAME[vigr] = "${base_sbindir}/vigr"
 ALTERNATIVE_LINK_NAME[su] = "${base_bindir}/su"
+ALTERNATIVE_LINK_NAME[nologin] = "${sbindir}/nologin"
+ALTERNATIVE_TARGET[nologin] = "${base_sbindir}/nologin.${BPN}"
 
 ALTERNATIVE_${PN}-doc = "passwd.5 getspnam.3"
 ALTERNATIVE_LINK_NAME[passwd.5] = "${mandir}/man5/passwd.5"
Signature · 1 line
1.9.1
#3 lore raw
In reply to Chen Qi
Quoted 9 lines · Chen Qi

The following changes since commit 4a888b2ab61662c7f749b5d1e64af92ed613d8eb:

gtk+: drop part of patch adding useless file (2014-11-20 14:08:57 +0000)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib ChenQi/nologin-alternatives
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=ChenQi/nologin-alternatives

Quoted 7 lines

Chen Qi (2):
util-linux: use ALTERNATIVE mechanism to manage 'nologin'
shadow: use ALTERNATIVE to manage 'nologin'

 meta/recipes-core/util-linux/util-linux.inc | 3 ++-
 meta/recipes-extended/shadow/shadow.inc     | 7 ++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

These patches never seem to make it into master as far as I can see. I couldn't find any posted objections.

They now require some minor tweaks to apply but appear to work correctly for me and solve my -dbg package conflicts.

Is there any chance of them being applied?

Thanks.

Mike.