summaryrefslogtreecommitdiffstats
path: root/remoting/tools
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-09 05:58:34 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-09 05:58:34 +0000
commit8e9e6455523393bf8b6a94046515e93e90f21c20 (patch)
tree168511bf7273a7d702066f9c82a3df4594a6767c /remoting/tools
parent2e2917c9acc57a1c71399fc4d0b46cd109ad7837 (diff)
downloadchromium_src-8e9e6455523393bf8b6a94046515e93e90f21c20.zip
chromium_src-8e9e6455523393bf8b6a94046515e93e90f21c20.tar.gz
chromium_src-8e9e6455523393bf8b6a94046515e93e90f21c20.tar.bz2
Improve gksudo prompt when enabling chromoting host.
1. gksudo prompt timeout has been increased to 5 minutes, 2. gksudo is killed when the timeout expires, 3. gksudo is launched with -D instead of -m. BUG=155920,167791 Review URL: https://chromiumcodereview.appspot.com/12207086 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181599 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/tools')
-rwxr-xr-xremoting/tools/me2me_virtual_host.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/remoting/tools/me2me_virtual_host.py b/remoting/tools/me2me_virtual_host.py
index 3327981..132cfca 100755
--- a/remoting/tools/me2me_virtual_host.py
+++ b/remoting/tools/me2me_virtual_host.py
@@ -852,16 +852,17 @@ Web Store: https://chrome.google.com/remotedesktop"""
return 0
if options.add_user:
- sudo_command = "gksudo --message" if os.getenv("DISPLAY") else "sudo -p"
- command = ("sudo -k && %(sudo)s "
- "\"Please enter your password to enable "
- "Chrome Remote Desktop: \" "
- "-- sh -c "
+ if os.getenv("DISPLAY"):
+ sudo_command = "gksudo --description \"Chrome Remote Desktop\""
+ else:
+ sudo_command = "sudo"
+ command = ("sudo -k && exec %(sudo)s -- sh -c "
"\"groupadd -f %(group)s && gpasswd --add %(user)s %(group)s\"" %
{ 'group': CHROME_REMOTING_GROUP_NAME,
'user': getpass.getuser(),
'sudo': sudo_command })
- return os.system(command) >> 8
+ os.execv("/bin/sh", ["/bin/sh", "-c", command])
+ return 1
if options.host_version:
# TODO(sergeyu): Also check RPM package version once we add RPM package.