]> git.pld-linux.org Git - packages/molly-guard.git/commitdiff
Hack to make it work with our sudo; rel 2, stbr auto/th/molly-guard-0.4.5-2
authorMariusz Mazur <mmazur@axeos.com>
Tue, 11 Mar 2014 16:26:24 +0000 (16:26 +0000)
committerMariusz Mazur <mmazur@axeos.com>
Tue, 11 Mar 2014 16:26:24 +0000 (16:26 +0000)
Previous change made it work in almost all cases except a rather popular
'sudo halt'. Since our sudo enforces a non-overrideable PATH
(--with-sudo-path), the only way for this to work was to put symlinks in
/bin. It ain't pretty, but it works and that's the point of this
package.

Btw: Fedora allows sudo's default behavior of inheriting PATH from
environment. No idea why we do this this way.

molly-guard.spec

index f291ff2db1b1109e9e58efa6e84eea2994131f68..4fcf732735b0567a3253e5d9fed1f3e2c153dc88 100644 (file)
@@ -1,7 +1,7 @@
 Summary:       protects machines from accidental shutdowns/reboots
 Name:          molly-guard
 Version:       0.4.5
-Release:       1
+Release:       2
 License:       Artistic Licence 2.0
 Group:         Applications/System
 Source0:       http://ftp.debian.org/debian/pool/main/m/molly-guard/%{name}_%{version}.orig.tar.gz
@@ -58,6 +58,11 @@ install -d $RPM_BUILD_ROOT
        prefix=%{_prefix} \
        DEST=$RPM_BUILD_ROOT
 
+install -d $RPM_BUILD_ROOT/bin
+for cmd in halt poweroff reboot shutdown; do
+    ln -s %{_datadir}/%{name}/shutdown $RPM_BUILD_ROOT/bin/$cmd
+done
+
 install -d $RPM_BUILD_ROOT/etc/shrc.d
 cp -p %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT/etc/shrc.d
 
@@ -69,15 +74,13 @@ rm -fr $RPM_BUILD_ROOT
 %doc ChangeLog
 %config(noreplace) %verify(not md5 mtime size) /etc/shrc.d/molly-guard.csh
 %config(noreplace) %verify(not md5 mtime size) /etc/shrc.d/molly-guard.sh
+%attr(755,root,root) /bin/*
 %dir %{_sysconfdir}/%{name}
 %dir %{_sysconfdir}/%{name}/run.d
 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/run.d/*
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/rc
 %dir %{_datadir}/%{name}/bin
-%attr(755,root,root) %{_datadir}/%{name}/bin/halt
-%attr(755,root,root) %{_datadir}/%{name}/bin/poweroff
-%attr(755,root,root) %{_datadir}/%{name}/bin/reboot
-%attr(755,root,root) %{_datadir}/%{name}/bin/shutdown
+%attr(755,root,root) %{_datadir}/%{name}/bin/*
 %dir %{_datadir}/%{name}
 %attr(755,root,root) %{_datadir}/%{name}/shutdown
 %{_mandir}/man8/%{name}.8*
This page took 0.1101 seconds and 4 git commands to generate.