Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1068)

Unified Diff: remoting/host/installer/linux/debian/chrome-remote-desktop.init

Issue 2753243003: Use sudo when starting session as normal user (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/installer/linux/debian/chrome-remote-desktop.init
diff --git a/remoting/host/installer/linux/debian/chrome-remote-desktop.init b/remoting/host/installer/linux/debian/chrome-remote-desktop.init
index 33f6a428b5ee001e5d8f11f7c8133c4d04ef1c97..b39f5d4e996f6b41cbe32db07acfe8611099ef47 100755
--- a/remoting/host/installer/linux/debian/chrome-remote-desktop.init
+++ b/remoting/host/installer/linux/debian/chrome-remote-desktop.init
@@ -59,7 +59,13 @@ run_and_ignore_error() {
set +e
if [ "$action" = "--start" ]; then
- "$USER_SESSION_PATH" --user="$user" --me2me-script="$HOST_PATH"
+ # TODO(rkjnsn): Support starting user-initiated sessions with our PAM
+ # wrapper.
+ if [ "$(whoami)" = "root" ]; then
+ "$USER_SESSION_PATH" --user="$user" --me2me-script="$HOST_PATH"
+ else
+ sudo -u "$user" --login --background "$HOST_PATH" --start
+ fi
else
sudo -u "$user" "$HOST_PATH" "$action"
fi
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698