]> granicus.if.org Git - sudo/commitdiff
Create /usr/lib/tmpfiles.d/sudo.conf when systemd is used.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 25 Feb 2015 23:45:12 +0000 (16:45 -0700)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 25 Feb 2015 23:45:12 +0000 (16:45 -0700)
plugins/sudoers/Makefile.in
sudo.pp

index 3aab586eeb45aa8e90e86fe011143776d8c1e905..d0d99d18244523207695bec7b09fe91e4be0da7c 100644 (file)
@@ -307,6 +307,7 @@ install-dirs:
            `echo $(DESTDIR)$(vardir)|$(SED) 's,/[^/]*$$,,'`
        $(INSTALL) -d $(INSTALL_OWNER) -m 0711 $(DESTDIR)$(rundir)
        $(INSTALL) -d $(INSTALL_OWNER) -m 0711 $(DESTDIR)$(vardir)
+       $(INSTALL) -d $(INSTALL_OWNER) -m 0700 $(DESTDIR)$(vardir)/lectured
 
 install-binaries: visudo sudoreplay install-dirs
        INSTALL_BACKUP='~' $(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_OWNER) -m 0755 sudoreplay $(DESTDIR)$(replaydir)/sudoreplay
diff --git a/sudo.pp b/sudo.pp
index 1008be11c8e011bb1d00f6b8d0ad4c16ef4b33ed..435977e65ace6a22e46112f52a51808aa1ec3183 100644 (file)
--- a/sudo.pp
+++ b/sudo.pp
@@ -272,6 +272,7 @@ still allow people to get their work done."
        $sudoersdir/sudoers.d/  0750 $sudoers_uid:$sudoers_gid
        $rundir/                0711 root:
        $vardir/                0711 root: ignore-others
+       $vardir/lectured/       0700 root:
        $docdir/                0755
        $docdir/sudoers2ldif    0755 optional,ignore-others
 %if [deb]
@@ -398,6 +399,15 @@ still allow people to get their work done."
                ;;
        esac
 
+%post [rpm,deb]
+       # Create /usr/lib/tmpfiles.d/sudo.conf if /lib/systemd exists
+       if [ -d /lib/systemd ]; then
+               cat > /usr/lib/tmpfiles.d/sudo.conf <<-EOF
+               d %{rundir} 0711 root root
+               d %{rundir}/ts 0700 root root
+               EOF
+       fi
+
 %post [aix]
        # Create /etc/rc.d/rc2.d/S90sudo link if /etc/rc.d exists
        if [ -d /etc/rc.d ]; then
@@ -423,6 +433,9 @@ still allow people to get their work done."
            X"`readlink /etc/sudo-ldap.conf 2>/dev/null`" = X"/etc/ldap/ldap.conf"; then
                rm -f /etc/sudo-ldap.conf
        fi
+
+       # Remove systemd tmpfile config
+       rm -f /usr/lib/tmpfiles.d/sudo.conf
 %endif
 %if [rpm]
        case "%{pp_rpm_distro}" in
@@ -430,6 +443,10 @@ still allow people to get their work done."
                # Remove /etc/rc.d/rc2.d/S90sudo link
                rm -f /etc/rc.d/rc2.d/S90sudo
                ;;
+       *)
+               # Remove systemd tmpfile config
+               rm -f /usr/lib/tmpfiles.d/sudo.conf
+               ;;
        esac
 %endif
 %if [aix]