Initial commit.
This commit is contained in:
26
polkit-1/rules.d/49-polkit-pkla-compat.rules
Normal file
26
polkit-1/rules.d/49-polkit-pkla-compat.rules
Normal file
@@ -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(['/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$/, '');
|
||||
});
|
||||
12
polkit-1/rules.d/50-default.rules
Normal file
12
polkit-1/rules.d/50-default.rules
Normal file
@@ -0,0 +1,12 @@
|
||||
/* -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- */
|
||||
|
||||
// DO NOT EDIT THIS FILE, it will be overwritten on update
|
||||
//
|
||||
// Default rules for polkit
|
||||
//
|
||||
// See the polkit(8) man page for more information
|
||||
// about configuring polkit.
|
||||
|
||||
polkit.addAdminRule(function(action, subject) {
|
||||
return ["unix-group:wheel"];
|
||||
});
|
||||
Reference in New Issue
Block a user