sudo.inc:Add directory "/var/lib" to sudo.inc in the stage of do_install_prepend
cover sudo.inc:Add directory "/var/lib" to sudo.inc in the stage of do_install_prepend
From: Xiaofeng Yan <[email protected]>
Hi Saul & Richard
I have added some comment in the recipe about why this is necessary as
someone could easily look at it and decide it wasn't needed according to Richard's requirement.
Pervious email content:
I submit this patch to fix [YOCTO #1092].
LSB Test Suite check access permission of directory "/var/lib". The current access permission is "0700". This is because:
$(SHELL) $(srcdir)/mkinstalldirs -m 0700 $(DESTDIR)$(timedir)
and the timedir=/var/lib/sudo
but if /var/lib doesn't exist, the mkinstalldirs would create it and set the mode to 0700 recursively, so all of the /var, /var/lib and /var/lib/sudo would be set to 0700, but what sudo needs is only set /var/lib/sudo to 0700.
So LSB Test Suite recognizes it as a bug. Other images including sudo could have no this problem because after installing sudo package other package operate on directory "/var/lib" but for lsb image sudo package is the last package which operate on directory "/var/lib"
Pull URL: git://git.pokylinux.org/poky-contrib.git
Branch: xiaofeng/sudo
Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=xiaofeng/sudo
Thanks,
Xiaofeng Yan <[email protected]>
---
Xiaofeng Yan (1):
sudo.inc: Add do_install_prepend () to sudo.inc
meta/recipes-extended/sudo/sudo.inc | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
PATCH 1/1 sudo.inc: Add do_install_prepend () to sudo.inc
From: Xiaofeng Yan <[email protected]>
Fix bug [YOCTO #1092]
Own a directory "/var/lib" before do_install() because if there isn't this directory during installing, \
then script "mkinstalldirs" from "sudo package" will create directory "/var/lib/sudo" by recursion with mode "0700" \
which will cause bug [YOCTO #1092]. So I add do_install_prepend() to create a "/var/lib" which can be accessed \
by common user before installing files.
--- meta/recipes-extended/sudo/sudo.inc | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
meta/recipes-extended/sudo/sudo.inc +11 -0
@@ -23,6 +23,17 @@ do_configure_prepend () { fi } +#The script "mkinstalldirs" from package "sudo" will create directory "/var/lib/sudo" +#by recursion with mode "0700" during installing files.That is to say, +#"var" "var/lib", and "var/lib/sudo" will have access authority with mode "0700". +#It cause that directory "var" and "var/lib" can't be accessed by common user. +#Creating directory "/var/lib" before installing files can resolve this problem. + +do_install_prepend (){ + mkdir -p ${D}/${localstatedir}/lib +} + + pkg_postinst_${PN} () { if [ "x$D" != "x" ]; then exit 1
Signature · 1 line
1.7.0.4