Mailinglist Archive: yast-commit (2114 mails)

< Previous Next >
[yast-commit] <rest-service> master : Add comments
  • From: Klaus Kämpf <kkaempf@xxxxxxx>
  • Date: Tue, 29 Sep 2009 14:07:09 +0200
  • Message-id: <E1MsbU9-0006WS-Fg@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit 861e2ef4fe85cc94d34e5ce00464fdc822afde7e
Author: Klaus Kämpf <kkaempf@xxxxxxx>
Date: Tue Sep 29 14:07:09 2009 +0200

Add comments
---
webservice/package/policyKit-rights.rb | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/webservice/package/policyKit-rights.rb
b/webservice/package/policyKit-rights.rb
old mode 100644
new mode 100755
index e3e780d..c2a249b
--- a/webservice/package/policyKit-rights.rb
+++ b/webservice/package/policyKit-rights.rb
@@ -57,16 +57,21 @@ usage "--action parameter (show|grant|revoke) missing"
unless action
begin
SuseString = "org.opensuse.yast"
if action == "grant"
+ # run "polkit-action" to list all registered policies
IO.popen( "polkit-action", 'r+' ) do |pipe|
loop do
break if pipe.eof?
l = pipe.read
+ # polkit-action prints one policy per line
policies = l.split("\n")
+ # now 'blindly' grant org.opensuse.yast.*
policies.each do |policy|
if policy.include? SuseString and not policy.include? ".scr"
STDOUT.puts "granting: #{policy}"
command = "polkit-auth --user " + user + " --grant " + policy
- system (command)
+ unless system (command)
+ STDERR.puts "#{command} failed !"
+ end
end
end
end
@@ -86,7 +91,9 @@ begin
if policy.include? SuseString and not policy.include?
".scr"
STDOUT.puts "revoking: #{policy}"
command = "polkit-auth --user " + user + " --revoke " +
policy
- system (command)
+ unless system (command)
+ STDERR.puts "#{command} failed !"
+ end
end
end
end
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages