diff options
author | Julian Pidancet <julian.pidancet@gmail.com> | 2011-10-07 01:13:41 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-10-10 10:00:08 +0100 |
commit | 3010bc0106a259d17c9fdf64c7bc2a10d33289d7 (patch) | |
tree | d32f088aaaa85aae8472bf8e3c52ffed38dbc837 /meta/recipes-connectivity/openssh | |
parent | 73abadd43e457e93b8919fc104dad986ff66448f (diff) | |
download | poky-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/recipes-connectivity/openssh')
-rw-r--r-- | meta/recipes-connectivity/openssh/openssh_5.8p2.bb | 29 |
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" | |||
29 | SRC_URI[md5sum] = "0541579adf9d55abb15ef927048d372e" | 29 | SRC_URI[md5sum] = "0541579adf9d55abb15ef927048d372e" |
30 | SRC_URI[sha256sum] = "5c35ec7c966ce05cc4497ac59c0b54a556e55ae7368165cc8c4129694654f314" | 30 | SRC_URI[sha256sum] = "5c35ec7c966ce05cc4497ac59c0b54a556e55ae7368165cc8c4129694654f314" |
31 | 31 | ||
32 | inherit useradd update-rc.d | ||
33 | |||
34 | USERADD_PACKAGES = "${PN}-sshd" | ||
35 | USERADD_PARAM_${PN}-sshd = "--system --no-create-home --home-dir /var/run/sshd --shell /bin/false --user-group sshd" | ||
36 | INITSCRIPT_PACKAGES = "${PN}-sshd" | ||
37 | INITSCRIPT_NAME_${PN}-sshd = "sshd" | ||
38 | INITSCRIPT_PARAMS_${PN}-sshd = "defaults 9" | ||
39 | |||
32 | inherit autotools | 40 | inherit autotools |
33 | 41 | ||
34 | # LFS support: | 42 | # LFS support: |
@@ -91,16 +99,6 @@ RDEPENDS_${PN} += "${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-keygen" | |||
91 | DEPENDS_${PN}-sshd += "update-rc.d" | 99 | DEPENDS_${PN}-sshd += "update-rc.d" |
92 | RDEPENDS_${PN}-sshd += "update-rc.d ${PN}-keygen" | 100 | RDEPENDS_${PN}-sshd += "update-rc.d ${PN}-keygen" |
93 | 101 | ||
94 | pkg_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 | |||
104 | pkg_postinst_${PN}-scp () { | 102 | pkg_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 | ||
120 | pkg_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 | |||
131 | CONFFILES_${PN}-sshd = "${sysconfdir}/ssh/sshd_config" | 118 | CONFFILES_${PN}-sshd = "${sysconfdir}/ssh/sshd_config" |
132 | CONFFILES_${PN}-ssh = "${sysconfdir}/ssh/ssh_config" | 119 | CONFFILES_${PN}-ssh = "${sysconfdir}/ssh/ssh_config" |