diff options
author | David Zeuthen <davidz@redhat.com> | 2012-05-24 11:26:34 -0400 |
---|---|---|
committer | David Zeuthen <davidz@redhat.com> | 2012-05-24 11:26:34 -0400 |
commit | be4c87252e8031c3427ca14ad036981f09fd6369 (patch) | |
tree | 54c5cad2694a7b5e5a2ee90bcbca3f8b9637f753 /test/data | |
parent | d11c872dc2f14fb4b1661740e311087aa188263d (diff) | |
download | polkit-be4c87252e8031c3427ca14ad036981f09fd6369.tar.gz |
Terminate runaway scripts
Signed-off-by: David Zeuthen <davidz@redhat.com>
Diffstat (limited to 'test/data')
-rw-r--r-- | test/data/etc/polkit-1/rules.d/10-testing.rules | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/data/etc/polkit-1/rules.d/10-testing.rules b/test/data/etc/polkit-1/rules.d/10-testing.rules index 4a35e48..1dba38a 100644 --- a/test/data/etc/polkit-1/rules.d/10-testing.rules +++ b/test/data/etc/polkit-1/rules.d/10-testing.rules @@ -134,3 +134,19 @@ polkit.addRule(function(action, subject, details) { } } }); + +polkit.addRule(function(action, subject, details) { + if (action == "net.company.run_away_script") { + try { + // The following code will never terminate so the runaway + // script killer will step in after 15 seconds and throw + // an exception... + while (true) + ; + } catch (error) { + if (error == "Terminating runaway script") + return "yes" + return "no"; + } + } +}); |