monkeysphere: Allow non-root cancel of publishing

Implement killing the publish process from within the action.  Don't let
the killing be too generic to avoid potential security issues.  Kill
process only if it appears as expected.
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2016-09-02 12:00:08 -04:00
1 parent f9bea39483
commit 3454abdc43
2 files changed
+28 -1

No files matched your search

+2 -1
View File
@@ -86,7 +86,8 @@ def cancel(request):
"""Cancel ongoing process."""
global publish_process
if publish_process:
publish_process.terminate()
actions.superuser_run(
'monkeysphere', ['host-cancel-publish', str(publish_process.pid)])
publish_process = None
messages.info(request, _('Cancelled key publishing.'))