summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorJulian Pidancet <julian.pidancet@gmail.com>2011-10-07 01:13:41 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-10-10 10:00:08 +0100
commit3010bc0106a259d17c9fdf64c7bc2a10d33289d7 (patch)
treed32f088aaaa85aae8472bf8e3c52ffed38dbc837 /meta
parent73abadd43e457e93b8919fc104dad986ff66448f (diff)
downloadpoky-3010bc0106a259d17c9fdf64c7bc2a10d33289d7.tar.gz
Use useradd and update-rc.d classes in the OpenSSH recipe
The current sshd postinst and postrm scripts in the OpenSSH make the package dependant of the adduser/addgroup scripts which may not be available on all systems. This patch replaces the sshd postinst and postrm scripts with proper usage of the useradd and update-rc.d classes. This patch had been modified from the previous proposed version to use useradd long options for more clarity. (From OE-Core rev: 6b7f399d595ef58e759dab211f4ece155119a680) Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-connectivity/openssh/openssh_5.8p2.bb29
1 files changed, 8 insertions, 21 deletions
diff --git a/meta/recipes-connectivity/openssh/openssh_5.8p2.bb b/meta/recipes-connectivity/openssh/openssh_5.8p2.bb
index 030a83b91f..5f5f0bc396 100644
--- a/meta/recipes-connectivity/openssh/openssh_5.8p2.bb
+++ b/meta/recipes-connectivity/openssh/openssh_5.8p2.bb
@@ -29,6 +29,14 @@ PAM_SRC_URI = "file://sshd"
29SRC_URI[md5sum] = "0541579adf9d55abb15ef927048d372e" 29SRC_URI[md5sum] = "0541579adf9d55abb15ef927048d372e"
30SRC_URI[sha256sum] = "5c35ec7c966ce05cc4497ac59c0b54a556e55ae7368165cc8c4129694654f314" 30SRC_URI[sha256sum] = "5c35ec7c966ce05cc4497ac59c0b54a556e55ae7368165cc8c4129694654f314"
31 31
32inherit useradd update-rc.d
33
34USERADD_PACKAGES = "${PN}-sshd"
35USERADD_PARAM_${PN}-sshd = "--system --no-create-home --home-dir /var/run/sshd --shell /bin/false --user-group sshd"
36INITSCRIPT_PACKAGES = "${PN}-sshd"
37INITSCRIPT_NAME_${PN}-sshd = "sshd"
38INITSCRIPT_PARAMS_${PN}-sshd = "defaults 9"
39
32inherit autotools 40inherit autotools
33 41
34# LFS support: 42# LFS support:
@@ -91,16 +99,6 @@ RDEPENDS_${PN} += "${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-keygen"
91DEPENDS_${PN}-sshd += "update-rc.d" 99DEPENDS_${PN}-sshd += "update-rc.d"
92RDEPENDS_${PN}-sshd += "update-rc.d ${PN}-keygen" 100RDEPENDS_${PN}-sshd += "update-rc.d ${PN}-keygen"
93 101
94pkg_postinst_${PN}-sshd () {
95 if [ "x$D" != "x" ]; then
96 exit 1
97 else
98 addgroup sshd
99 adduser --system --home /var/run/sshd --no-create-home --disabled-password --ingroup sshd -s /bin/false sshd
100 update-rc.d sshd defaults 9
101 fi
102}
103
104pkg_postinst_${PN}-scp () { 102pkg_postinst_${PN}-scp () {
105 update-alternatives --install ${bindir}/scp scp scp.${PN} 90 103 update-alternatives --install ${bindir}/scp scp scp.${PN} 90
106} 104}
@@ -117,16 +115,5 @@ pkg_postrm_${PN}-scp () {
117 update-alternatives --remove ${bindir}/scp scp.${PN} 115 update-alternatives --remove ${bindir}/scp scp.${PN}
118} 116}
119 117
120pkg_postrm_${PN}-sshd () {
121 if [ "x$D" != "x" ]; then
122 exit 1
123 else
124 ${sysconfdir}/init.d/sshd stop
125 deluser sshd
126 delgroup sshd
127 update-rc.d -f sshd remove
128 fi
129}
130
131CONFFILES_${PN}-sshd = "${sysconfdir}/ssh/sshd_config" 118CONFFILES_${PN}-sshd = "${sysconfdir}/ssh/sshd_config"
132CONFFILES_${PN}-ssh = "${sysconfdir}/ssh/ssh_config" 119CONFFILES_${PN}-ssh = "${sysconfdir}/ssh/ssh_config"