]> granicus.if.org Git - sudo/commitdiff
Include parent directories in case they don't already exist. This
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 13 Jan 2012 14:50:03 +0000 (09:50 -0500)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 13 Jan 2012 14:50:03 +0000 (09:50 -0500)
fixes a directory permissions problem with the AIX package when the
/usr/local directories don't already exist.

--HG--
branch : 1.7

sudo.pp

diff --git a/sudo.pp b/sudo.pp
index d384d1375d36123bca9c33eef497153e2cef5b08..3e1599ad8a012224e31c6e9f4980ec8f83911cd6 100644 (file)
--- a/sudo.pp
+++ b/sudo.pp
@@ -12,7 +12,7 @@ limited root privileges to users and log root activity.  \
 The basic philosophy is to give as few privileges as possible but \
 still allow people to get their work done."
        vendor="Todd C. Miller"
-       copyright="(c) 1993-1996,1998-2011 Todd C. Miller"
+       copyright="(c) 1993-1996,1998-2012 Todd C. Miller"
 
 %if [aix]
        # AIX package summary is limited to 40 characters
@@ -176,7 +176,20 @@ still allow people to get their work done."
        EOF
 %endif
 
+       # OS-level directories that should generally exist but might not.
+       extradirs=`echo ${pp_destdir}/${mandir}/[mc]* | sed "s#${pp_destdir}/##g"`
+       extradirs="$extradirs `dirname $docdir` `dirname $timedir`"
+       test -d ${pp_destdir}/etc/pam.d && extradirs="${extradirs} /etc/pam.d"
+       for dir in $bindir $sbindir $libexecdir $extradirs; do
+               while test "$dir" != "/"; do
+                       osdirs="${osdirs}${osdirs+ }$dir/"
+                       dir=`dirname $dir`
+               done
+       done
+       osdirs=`echo $osdirs | tr " " "\n" | sort -u`
+
 %files
+       $osdirs                -
        $bindir/sudo        4111 root:
        $bindir/sudoedit    4111 root:
        $sbindir/visudo     0111