[X2Go-Commits] [x2gobroker] 01/01: always drop privileges in x2gobroker-testagent
git-admin at x2go.org
git-admin at x2go.org
Tue Mar 18 23:45:17 CET 2014
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository x2gobroker.
commit 2052121390fd9bb1efeace9cae73632cae9d53d4
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Tue Mar 18 23:45:20 2014 +0100
always drop privileges in x2gobroker-testagent
---
sbin/x2gobroker-testagent | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sbin/x2gobroker-testagent b/sbin/x2gobroker-testagent
index 4c6a26e..29ca0ed 100755
--- a/sbin/x2gobroker-testagent
+++ b/sbin/x2gobroker-testagent
@@ -50,7 +50,6 @@ setproctitle.setproctitle("%s %s" % (PROG_NAME, " ".join(PROG_OPTIONS)))
if __name__ == "__main__":
agent_options = [
- {'args':['--drop-privileges'], 'default': False, 'action': 'store_true', 'help': 'Drop privileges to user {x2gobroker} (recommended)'.format(x2gobroker=x2gobroker.defaults.X2GOBROKER_DAEMON_USER), },
{'args':['-H','--host'], 'default': 'LOCAL', 'metavar': 'HOSTNAME', 'help': 'Test X2Go Session Broker Agent on this host (default: LOCAL)', },
{'args':['-p','--port'], 'default': 22, 'metavar': 'PORT', 'help': 'For remote agent calls (via SSH) use this port as SSH port (default: 22)', },
{'args':['-u','--username', '--user'], 'default': None, 'metavar': 'USERNAME', 'help': 'When testing the broker agent, test on behalf of this user (default: none)', },
@@ -85,9 +84,6 @@ if __name__ == "__main__":
if cmdline_args.config_file is not None:
x2gobroker.defaults.X2GOBROKER_CONFIG = cmdline_args.config_file
- if cmdline_args.drop_privileges:
- drop_privileges(uid=x2gobroker.defaults.X2GOBROKER_DAEMON_USER, gid=x2gobroker.defaults.X2GOBROKER_DAEMON_GROUP)
-
if cmdline_args.debug:
x2gobroker.defaults.X2GOBROKER_DEBUG = cmdline_args.debug
# raise log level to DEBUG if requested...
@@ -102,6 +98,7 @@ if __name__ == "__main__":
list_tasks = cmdline_args.list_tasks
+
local_agent = (hostname == 'LOCAL')
query_mode = local_agent and 'LOCAL' or 'SSH'
if local_agent: remote_agent = None
@@ -120,6 +117,9 @@ def call_agent(task):
if __name__ == "__main__":
+ # drop root privileges and run as X2GOBROKER_DAEMON_USER
+ drop_privileges(uid=x2gobroker.defaults.X2GOBROKER_DAEMON_USER, gid=x2gobroker.defaults.X2GOBROKER_DAEMON_GROUP)
+
if not local_agent and not x2gobroker.agent.has_remote_broker_agent_setup():
print "This instance of X2Go Session Broker is not able to contact any remote"
--
Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2gobroker.git
More information about the x2go-commits
mailing list