From 478fd72662658c982588928c4df07a099f6d2177 Mon Sep 17 00:00:00 2001 From: Miloslav Trmač Date: May 03 2013 16:49:42 +0000 Subject: Use the correct $(bindir) in 50-pkla.rules --- diff --git a/src/polkitbackend/50-pkla.rules b/src/polkitbackend/50-pkla.rules deleted file mode 100644 index c133d77..0000000 --- a/src/polkitbackend/50-pkla.rules +++ /dev/null @@ -1,26 +0,0 @@ -polkit.addAdminRule(function(action, subject) { - //polkit.log('Starting pkla-admin-identities\n'); - // Let exception, if any, propagate to the JS authority - var res = polkit.spawn(['/usr/bin/pkla-admin-identities']); - //polkit.log('Got "' + res.replace(/\n/g, '\\n') + '"\n'); - if (res == '') - return null; - var identities = res.split('\n'); - //polkit.log('Identities: ' + identities.join(',') + '\n'); - if (identities[identities.length - 1] == '') - identities.pop() - //polkit.log('Returning: ' + identities.join(',') + '\n'); - return identities; -}); - -polkit.addRule(function(action, subject) { - var params = ['/usr/bin/pkla-check-authorization', - subject.user, subject.local ? 'true' : 'false', - subject.active ? 'true' : 'false', action.id]; - //polkit.log('Starting ' + params.join(' ') + '\n'); - var res = polkit.spawn(params); - //polkit.log('Got "' + res.replace(/\n/g, '\\n') + '"\n'); - if (res == '') - return null; - return res.replace(/\n$/, ''); -}); diff --git a/src/polkitbackend/50-pkla.rules.in b/src/polkitbackend/50-pkla.rules.in new file mode 100644 index 0000000..b7dbf0c --- /dev/null +++ b/src/polkitbackend/50-pkla.rules.in @@ -0,0 +1,26 @@ +polkit.addAdminRule(function(action, subject) { + //polkit.log('Starting pkla-admin-identities\n'); + // Let exception, if any, propagate to the JS authority + var res = polkit.spawn(['@bindir@/pkla-admin-identities']); + //polkit.log('Got "' + res.replace(/\n/g, '\\n') + '"\n'); + if (res == '') + return null; + var identities = res.split('\n'); + //polkit.log('Identities: ' + identities.join(',') + '\n'); + if (identities[identities.length - 1] == '') + identities.pop() + //polkit.log('Returning: ' + identities.join(',') + '\n'); + return identities; +}); + +polkit.addRule(function(action, subject) { + var params = ['@bindir@/pkla-check-authorization', + subject.user, subject.local ? 'true' : 'false', + subject.active ? 'true' : 'false', action.id]; + //polkit.log('Starting ' + params.join(' ') + '\n'); + var res = polkit.spawn(params); + //polkit.log('Got "' + res.replace(/\n/g, '\\n') + '"\n'); + if (res == '') + return null; + return res.replace(/\n$/, ''); +}); diff --git a/src/polkitbackend/Makefile.am b/src/polkitbackend/Makefile.am index c178dd4..63325d7 100644 --- a/src/polkitbackend/Makefile.am +++ b/src/polkitbackend/Makefile.am @@ -1,5 +1,11 @@ rulesdir = $(sysconfdir)/polkit-1/rules.d -dist_rules_DATA = 50-pkla.rules +rules_DATA = 50-pkla.rules +EXTRA_DIST = 50-pkla.rules.in + +CLEANFILES = $(rules_DATA) + +50-pkla.rules: 50-pkla.rules.in Makefile + sed 's,@bindir@,$(bindir),g' < $(srcdir)/50-pkla.rules.in > $@ # ----------------------------------------------------------------------------------------------------