All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saul Wold <sgw@linux.intel.com>
To: Patches and discussions about the oe-core layer
	<openembedded-core@lists.openembedded.org>
Cc: Julian Pidancet <julian.pidancet@gmail.com>
Subject: Re: [PATCH] Use useradd and update-rc.d classes in the OpenSSH recipe
Date: Mon, 26 Sep 2011 16:38:42 -0700	[thread overview]
Message-ID: <4E810D02.6080101@linux.intel.com> (raw)
In-Reply-To: <1316955346-12756-1-git-send-email-julian.pidancet@gmail.com>

On 09/25/2011 05:55 AM, Julian Pidancet wrote:
> 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.
>
> Signed-off-by: Julian Pidancet<julian.pidancet@gmail.com>
> ---
>   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 030a83b..c94ec84 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"
>   SRC_URI[md5sum] = "0541579adf9d55abb15ef927048d372e"
>   SRC_URI[sha256sum] = "5c35ec7c966ce05cc4497ac59c0b54a556e55ae7368165cc8c4129694654f314"
>
> +inherit useradd update-rc.d
> +
> +USERADD_PACKAGES = "${PN}-sshd"
> +USERADD_PARAM_${PN}-sshd = "-r -M -d /var/run/sshd -s /bin/false -U sshd"
Is there a reason you did not include the group and --disable-password here?

I think it would be good to leave thelong name options in also.

Sau!

> +INITSCRIPT_PACKAGES = "${PN}-sshd"
> +INITSCRIPT_NAME_${PN}-sshd = "sshd"
> +INITSCRIPT_PARAMS_${PN}-sshd = "defaults 9"
> +
>   inherit autotools
>
>   # LFS support:
> @@ -91,16 +99,6 @@ RDEPENDS_${PN} += "${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-keygen"
>   DEPENDS_${PN}-sshd += "update-rc.d"
>   RDEPENDS_${PN}-sshd += "update-rc.d ${PN}-keygen"
>
> -pkg_postinst_${PN}-sshd () {
> -	if [ "x$D" != "x" ]; then
> -		exit 1
> -	else
> -		addgroup sshd
> -		adduser --system --home /var/run/sshd --no-create-home --disabled-password --ingroup sshd -s /bin/false sshd
> -		update-rc.d sshd defaults 9
> -	fi
> -}
> -
>   pkg_postinst_${PN}-scp () {
>   	update-alternatives --install ${bindir}/scp scp scp.${PN} 90
>   }
> @@ -117,16 +115,5 @@ pkg_postrm_${PN}-scp () {
>   	update-alternatives --remove ${bindir}/scp scp.${PN}
>   }
>
> -pkg_postrm_${PN}-sshd () {
> -	if [ "x$D" != "x" ]; then
> -		exit 1
> -	else
> -		${sysconfdir}/init.d/sshd stop
> -		deluser sshd
> -		delgroup sshd
> -		update-rc.d -f sshd remove
> -	fi
> -}
> -
>   CONFFILES_${PN}-sshd = "${sysconfdir}/ssh/sshd_config"
>   CONFFILES_${PN}-ssh = "${sysconfdir}/ssh/ssh_config"



  reply	other threads:[~2011-09-26 23:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-25 12:55 [PATCH] Use useradd and update-rc.d classes in the OpenSSH recipe Julian Pidancet
2011-09-26 23:38 ` Saul Wold [this message]
2011-09-26 23:59   ` Julian Pidancet
2011-09-27  0:47     ` Julian Pidancet
2011-09-27  0:51       ` Mark Hatle
2011-09-27 20:44       ` Scott Garman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E810D02.6080101@linux.intel.com \
    --to=sgw@linux.intel.com \
    --cc=julian.pidancet@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.