All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] openssh: use volatiles for managing /var/run/sshd
@ 2013-09-13  9:10 Ming Liu
  2013-09-16  8:54 ` Stanacar, StefanX
  0 siblings, 1 reply; 3+ messages in thread
From: Ming Liu @ 2013-09-13  9:10 UTC (permalink / raw)
  To: openembedded-core

It fixes the following failure:
"fatal: Missing privilege separation directory: /var/run/sshd"

when sshd is started through xinetd.

Signed-off-by: Ming Liu <ming.liu@windriver.com>
---
 .../openssh/openssh-6.2p2/volatiles.99_sshd        |    1 +
 meta/recipes-connectivity/openssh/openssh_6.2p2.bb |    8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-connectivity/openssh/openssh-6.2p2/volatiles.99_sshd

diff --git a/meta/recipes-connectivity/openssh/openssh-6.2p2/volatiles.99_sshd b/meta/recipes-connectivity/openssh/openssh-6.2p2/volatiles.99_sshd
new file mode 100644
index 0000000..86e7f6f
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh-6.2p2/volatiles.99_sshd
@@ -0,0 +1 @@
+d sshd sshd 0755 /var/run/sshd none
diff --git a/meta/recipes-connectivity/openssh/openssh_6.2p2.bb b/meta/recipes-connectivity/openssh/openssh_6.2p2.bb
index 3a7f50d..bb5c79e 100644
--- a/meta/recipes-connectivity/openssh/openssh_6.2p2.bb
+++ b/meta/recipes-connectivity/openssh/openssh_6.2p2.bb
@@ -29,7 +29,8 @@ SRC_URI = "ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar.
            ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
            file://sshd.socket \
            file://sshd@.service \
-           file://sshdgenkeys.service "
+           file://sshdgenkeys.service \
+           file://volatiles.99_sshd "
 
 PAM_SRC_URI = "file://sshd"
 
@@ -92,6 +93,9 @@ do_install_append () {
 	install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/sshd
 	rm -f ${D}${bindir}/slogin ${D}${datadir}/Ssh.bin
 	rmdir ${D}${localstatedir}/run/sshd ${D}${localstatedir}/run ${D}${localstatedir}
+	install -d ${D}/${sysconfdir}/default/volatiles
+	install -m 644 ${WORKDIR}/volatiles.99_sshd ${D}/${sysconfdir}/default/volatiles/99_sshd
+
         # Create config files for read-only rootfs
 	install -d ${D}${sysconfdir}/ssh
 	install -m 644 ${WORKDIR}/sshd_config ${D}${sysconfdir}/ssh/sshd_config_readonly
@@ -116,7 +120,7 @@ PACKAGES =+ "${PN}-keygen ${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-sftp ${PN}-misc $
 FILES_${PN}-scp = "${bindir}/scp.${BPN}"
 FILES_${PN}-ssh = "${bindir}/ssh.${BPN} ${sysconfdir}/ssh/ssh_config"
 FILES_${PN}-sshd = "${sbindir}/sshd ${sysconfdir}/init.d/sshd"
-FILES_${PN}-sshd += "${sysconfdir}/ssh/moduli ${sysconfdir}/ssh/sshd_config ${sysconfdir}/ssh/sshd_config_readonly"
+FILES_${PN}-sshd += "${sysconfdir}/ssh/moduli ${sysconfdir}/ssh/sshd_config ${sysconfdir}/ssh/sshd_config_readonly ${sysconfdir}/default/volatiles/99_sshd"
 FILES_${PN}-sftp = "${bindir}/sftp"
 FILES_${PN}-sftp-server = "${libexecdir}/sftp-server"
 FILES_${PN}-misc = "${bindir}/ssh* ${libexecdir}/ssh*"
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] openssh: use volatiles for managing /var/run/sshd
  2013-09-13  9:10 [PATCH] openssh: use volatiles for managing /var/run/sshd Ming Liu
@ 2013-09-16  8:54 ` Stanacar, StefanX
  2013-09-16  9:17   ` Ming Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Stanacar, StefanX @ 2013-09-16  8:54 UTC (permalink / raw)
  To: Ming Liu; +Cc: openembedded-core

Hi Ming,

On Fri, 2013-09-13 at 17:10 +0800, Ming Liu wrote:
> It fixes the following failure:
> "fatal: Missing privilege separation directory: /var/run/sshd"
> 
> when sshd is started through xinetd.

With this patch applied, openssh doesn't start anymore in standard
images (e.g. core-image-sato-sdk)

root@qemux86-64:~# /etc/init.d/sshd restart
/var/run/sshd must be owned by root and not group or world-writable.

Cheers,

Stefan

> 
> Signed-off-by: Ming Liu <ming.liu@windriver.com>
> ---
>  .../openssh/openssh-6.2p2/volatiles.99_sshd        |    1 +
>  meta/recipes-connectivity/openssh/openssh_6.2p2.bb |    8 ++++++--
>  2 files changed, 7 insertions(+), 2 deletions(-)
>  create mode 100644 meta/recipes-connectivity/openssh/openssh-6.2p2/volatiles.99_sshd
> 
> diff --git a/meta/recipes-connectivity/openssh/openssh-6.2p2/volatiles.99_sshd b/meta/recipes-connectivity/openssh/openssh-6.2p2/volatiles.99_sshd
> new file mode 100644
> index 0000000..86e7f6f
> --- /dev/null
> +++ b/meta/recipes-connectivity/openssh/openssh-6.2p2/volatiles.99_sshd
> @@ -0,0 +1 @@
> +d sshd sshd 0755 /var/run/sshd none
> diff --git a/meta/recipes-connectivity/openssh/openssh_6.2p2.bb b/meta/recipes-connectivity/openssh/openssh_6.2p2.bb
> index 3a7f50d..bb5c79e 100644
> --- a/meta/recipes-connectivity/openssh/openssh_6.2p2.bb
> +++ b/meta/recipes-connectivity/openssh/openssh_6.2p2.bb
> @@ -29,7 +29,8 @@ SRC_URI = "ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar.
>             ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
>             file://sshd.socket \
>             file://sshd@.service \
> -           file://sshdgenkeys.service "
> +           file://sshdgenkeys.service \
> +           file://volatiles.99_sshd "
>  
>  PAM_SRC_URI = "file://sshd"
>  
> @@ -92,6 +93,9 @@ do_install_append () {
>  	install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/sshd
>  	rm -f ${D}${bindir}/slogin ${D}${datadir}/Ssh.bin
>  	rmdir ${D}${localstatedir}/run/sshd ${D}${localstatedir}/run ${D}${localstatedir}
> +	install -d ${D}/${sysconfdir}/default/volatiles
> +	install -m 644 ${WORKDIR}/volatiles.99_sshd ${D}/${sysconfdir}/default/volatiles/99_sshd
> +
>          # Create config files for read-only rootfs
>  	install -d ${D}${sysconfdir}/ssh
>  	install -m 644 ${WORKDIR}/sshd_config ${D}${sysconfdir}/ssh/sshd_config_readonly
> @@ -116,7 +120,7 @@ PACKAGES =+ "${PN}-keygen ${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-sftp ${PN}-misc $
>  FILES_${PN}-scp = "${bindir}/scp.${BPN}"
>  FILES_${PN}-ssh = "${bindir}/ssh.${BPN} ${sysconfdir}/ssh/ssh_config"
>  FILES_${PN}-sshd = "${sbindir}/sshd ${sysconfdir}/init.d/sshd"
> -FILES_${PN}-sshd += "${sysconfdir}/ssh/moduli ${sysconfdir}/ssh/sshd_config ${sysconfdir}/ssh/sshd_config_readonly"
> +FILES_${PN}-sshd += "${sysconfdir}/ssh/moduli ${sysconfdir}/ssh/sshd_config ${sysconfdir}/ssh/sshd_config_readonly ${sysconfdir}/default/volatiles/99_sshd"
>  FILES_${PN}-sftp = "${bindir}/sftp"
>  FILES_${PN}-sftp-server = "${libexecdir}/sftp-server"
>  FILES_${PN}-misc = "${bindir}/ssh* ${libexecdir}/ssh*"


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] openssh: use volatiles for managing /var/run/sshd
  2013-09-16  8:54 ` Stanacar, StefanX
@ 2013-09-16  9:17   ` Ming Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Ming Liu @ 2013-09-16  9:17 UTC (permalink / raw)
  To: Stanacar, StefanX; +Cc: openembedded-core

On 09/16/2013 04:54 PM, Stanacar, StefanX wrote:
> Hi Ming,
>
> On Fri, 2013-09-13 at 17:10 +0800, Ming Liu wrote:
>> It fixes the following failure:
>> "fatal: Missing privilege separation directory: /var/run/sshd"
>>
>> when sshd is started through xinetd.
> With this patch applied, openssh doesn't start anymore in standard
> images (e.g. core-image-sato-sdk)
>
> root@qemux86-64:~# /etc/init.d/sshd restart
> /var/run/sshd must be owned by root and not group or world-writable.
Sorry, I made a mistake, this patch is a little modifiled to which my 
test based on, and I didn't notice that, I will send the V1 soon.

Thanks,
Ming
>
> Cheers,
>
> Stefan
>
>> Signed-off-by: Ming Liu <ming.liu@windriver.com>
>> ---
>>   .../openssh/openssh-6.2p2/volatiles.99_sshd        |    1 +
>>   meta/recipes-connectivity/openssh/openssh_6.2p2.bb |    8 ++++++--
>>   2 files changed, 7 insertions(+), 2 deletions(-)
>>   create mode 100644 meta/recipes-connectivity/openssh/openssh-6.2p2/volatiles.99_sshd
>>
>> diff --git a/meta/recipes-connectivity/openssh/openssh-6.2p2/volatiles.99_sshd b/meta/recipes-connectivity/openssh/openssh-6.2p2/volatiles.99_sshd
>> new file mode 100644
>> index 0000000..86e7f6f
>> --- /dev/null
>> +++ b/meta/recipes-connectivity/openssh/openssh-6.2p2/volatiles.99_sshd
>> @@ -0,0 +1 @@
>> +d sshd sshd 0755 /var/run/sshd none
>> diff --git a/meta/recipes-connectivity/openssh/openssh_6.2p2.bb b/meta/recipes-connectivity/openssh/openssh_6.2p2.bb
>> index 3a7f50d..bb5c79e 100644
>> --- a/meta/recipes-connectivity/openssh/openssh_6.2p2.bb
>> +++ b/meta/recipes-connectivity/openssh/openssh_6.2p2.bb
>> @@ -29,7 +29,8 @@ SRC_URI = "ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar.
>>              ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
>>              file://sshd.socket \
>>              file://sshd@.service \
>> -           file://sshdgenkeys.service "
>> +           file://sshdgenkeys.service \
>> +           file://volatiles.99_sshd "
>>   
>>   PAM_SRC_URI = "file://sshd"
>>   
>> @@ -92,6 +93,9 @@ do_install_append () {
>>   	install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/sshd
>>   	rm -f ${D}${bindir}/slogin ${D}${datadir}/Ssh.bin
>>   	rmdir ${D}${localstatedir}/run/sshd ${D}${localstatedir}/run ${D}${localstatedir}
>> +	install -d ${D}/${sysconfdir}/default/volatiles
>> +	install -m 644 ${WORKDIR}/volatiles.99_sshd ${D}/${sysconfdir}/default/volatiles/99_sshd
>> +
>>           # Create config files for read-only rootfs
>>   	install -d ${D}${sysconfdir}/ssh
>>   	install -m 644 ${WORKDIR}/sshd_config ${D}${sysconfdir}/ssh/sshd_config_readonly
>> @@ -116,7 +120,7 @@ PACKAGES =+ "${PN}-keygen ${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-sftp ${PN}-misc $
>>   FILES_${PN}-scp = "${bindir}/scp.${BPN}"
>>   FILES_${PN}-ssh = "${bindir}/ssh.${BPN} ${sysconfdir}/ssh/ssh_config"
>>   FILES_${PN}-sshd = "${sbindir}/sshd ${sysconfdir}/init.d/sshd"
>> -FILES_${PN}-sshd += "${sysconfdir}/ssh/moduli ${sysconfdir}/ssh/sshd_config ${sysconfdir}/ssh/sshd_config_readonly"
>> +FILES_${PN}-sshd += "${sysconfdir}/ssh/moduli ${sysconfdir}/ssh/sshd_config ${sysconfdir}/ssh/sshd_config_readonly ${sysconfdir}/default/volatiles/99_sshd"
>>   FILES_${PN}-sftp = "${bindir}/sftp"
>>   FILES_${PN}-sftp-server = "${libexecdir}/sftp-server"
>>   FILES_${PN}-misc = "${bindir}/ssh* ${libexecdir}/ssh*"



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-09-16  9:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-13  9:10 [PATCH] openssh: use volatiles for managing /var/run/sshd Ming Liu
2013-09-16  8:54 ` Stanacar, StefanX
2013-09-16  9:17   ` Ming Liu

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.