Patchwork [CONSOLIDATED,PULL,25/32] sudo.inc: Add do_install_prepend () to sudo.inc

login
register
mail settings
Submitter Saul Wold
Date June 1, 2011, 6:21 a.m.
Message ID <43ba264bf3edbfd59995703ba48e99ce925f1a15.1306909184.git.sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/5183/
State New, archived
Headers show

Comments

Saul Wold - June 1, 2011, 6:21 a.m.
From: Xiaofeng Yan <xiaofeng.yan@windriver.com>

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.

Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
---
 meta/recipes-extended/sudo/sudo.inc |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

Patch

diff --git a/meta/recipes-extended/sudo/sudo.inc b/meta/recipes-extended/sudo/sudo.inc
index 6a04a9c..fd68057 100644
--- a/meta/recipes-extended/sudo/sudo.inc
+++ b/meta/recipes-extended/sudo/sudo.inc
@@ -23,6 +23,18 @@  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 possess 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