[packages/molly-guard] Hack to make it work with our sudo; rel 2, stbr

mmazur mmazur at pld-linux.org
Tue Mar 11 17:30:59 CET 2014


commit 1788eff878d25c820732e14cf880118f42fbb2f1
Author: Mariusz Mazur <mmazur at axeos.com>
Date:   Tue Mar 11 16:26:24 2014 +0000

    Hack to make it work with our sudo; rel 2, stbr
    
    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 | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/molly-guard.spec b/molly-guard.spec
index f291ff2..4fcf732 100644
--- a/molly-guard.spec
+++ b/molly-guard.spec
@@ -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*
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/molly-guard.git/commitdiff/1788eff878d25c820732e14cf880118f42fbb2f1



More information about the pld-cvs-commit mailing list