From e6e89616ca40bf416dd5c35f42dcab3bbcb8fd22 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Sat, 16 Nov 2013 12:28:49 +0100 Subject: polkit: Only use pkexec when not already root --- NEWS | 2 ++ polkit/Makefile | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 061b14d..84ed2ef 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +- polkit: only use pkexec when not already root + 1.34 - tidy up polkit support diff --git a/polkit/Makefile b/polkit/Makefile index 34e8106..dc7c4ba 100644 --- a/polkit/Makefile +++ b/polkit/Makefile @@ -13,7 +13,7 @@ clean: rm -f $(WRAPPERS) $(POLICY) %: org.mageia.%.policy.in - @echo -e "#!/bin/sh\nexec $(BINDIR)/pkexec $(LIBEXECDIR)/$@ $$""*" > $@ + @echo -e '#!/bin/sh\nif [[ "$$UID" != "0" ]] ; then\n exec $(BINDIR)/pkexec $(LIBEXECDIR)/$@ "$$''@"\nelse\n exec $(LIBEXECDIR)/$@ "$$''@"\nfi\n' > $@ %.policy: %.policy.in intltool-merge --utf8 ../po $< $@ -x -u -c ../po/.intltool-merge-cache -- cgit v1.2.1