Initial commit.

This commit is contained in:
2021-05-24 22:18:33 +03:00
commit e2954d55f4
3701 changed files with 330017 additions and 0 deletions

View 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$/, '');
});

View 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"];
});