summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/chrome-remote-desktop/files')
-rw-r--r--net-misc/chrome-remote-desktop/files/chrome-remote-desktop-41.0.2272.41-always-sudo.patch18
-rw-r--r--net-misc/chrome-remote-desktop/files/chrome-remote-desktop-44.0.2403.44-always-sudo.patch20
-rw-r--r--net-misc/chrome-remote-desktop/files/chrome-remote-desktop.conf.d10
-rwxr-xr-xnet-misc/chrome-remote-desktop/files/chrome-remote-desktop.rc73
4 files changed, 121 insertions, 0 deletions
diff --git a/net-misc/chrome-remote-desktop/files/chrome-remote-desktop-41.0.2272.41-always-sudo.patch b/net-misc/chrome-remote-desktop/files/chrome-remote-desktop-41.0.2272.41-always-sudo.patch
new file mode 100644
index 000000000000..39e9d27e9d3a
--- /dev/null
+++ b/net-misc/chrome-remote-desktop/files/chrome-remote-desktop-41.0.2272.41-always-sudo.patch
@@ -0,0 +1,18 @@
+https://bugs.gentoo.org/541708
+
+just use `sudo` for everything
+
+--- a/opt/google/chrome-remote-desktop/chrome-remote-desktop
++++ b/opt/google/chrome-remote-desktop/chrome-remote-desktop
+@@ -1092,10 +1092,7 @@
+ except KeyError:
+ logging.info("Group '%s' not found." % CHROME_REMOTING_GROUP_NAME)
+
+- if os.getenv("DISPLAY"):
+- sudo_command = "gksudo --description \"Chrome Remote Desktop\""
+- else:
+- sudo_command = "sudo"
++ 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,
diff --git a/net-misc/chrome-remote-desktop/files/chrome-remote-desktop-44.0.2403.44-always-sudo.patch b/net-misc/chrome-remote-desktop/files/chrome-remote-desktop-44.0.2403.44-always-sudo.patch
new file mode 100644
index 000000000000..d303e5e753f9
--- /dev/null
+++ b/net-misc/chrome-remote-desktop/files/chrome-remote-desktop-44.0.2403.44-always-sudo.patch
@@ -0,0 +1,20 @@
+https://bugs.gentoo.org/541708
+
+just use `sudo` for everything
+
+--- a/opt/google/chrome-remote-desktop/chrome-remote-desktop
++++ b/opt/google/chrome-remote-desktop/chrome-remote-desktop
+@@ -1092,12 +1092,7 @@
+ logging.info("Group '%s' not found." % CHROME_REMOTING_GROUP_NAME)
+
+ command = [SCRIPT_PATH, '--add-user-as-root', user]
+- if os.getenv("DISPLAY"):
+- # TODO(rickyz): Add a Polkit policy that includes a more friendly message
+- # about what this command does.
+- command = ["/usr/bin/pkexec"] + command
+- else:
+- command = ["/usr/bin/sudo", "-k", "--"] + command
++ command = ["/usr/bin/sudo", "-k", "--"] + command
+
+ # Run with an empty environment out of paranoia, though if an attacker
+ # controls the environment this script is run under, we're already screwed
diff --git a/net-misc/chrome-remote-desktop/files/chrome-remote-desktop.conf.d b/net-misc/chrome-remote-desktop/files/chrome-remote-desktop.conf.d
new file mode 100644
index 000000000000..9830f2cbda37
--- /dev/null
+++ b/net-misc/chrome-remote-desktop/files/chrome-remote-desktop.conf.d
@@ -0,0 +1,10 @@
+# /etc/conf.d/chrome-remote-desktop: config file for /etc/init.d/chrome-remote-desktop
+
+# List of users to start Chrome Remote Desktop for.
+CHROME_REMOTING_USERS=''
+
+# Default resolutions to make available to the session.
+#CHROME_REMOTE_DESKTOP_DEFAULT_DESKTOP_SIZES='1600x1200,3840x1600'
+
+# Directory to use for storing log files.
+#CHROME_REMOTE_DESKTOP_LOG_DIR='/var/log'
diff --git a/net-misc/chrome-remote-desktop/files/chrome-remote-desktop.rc b/net-misc/chrome-remote-desktop/files/chrome-remote-desktop.rc
new file mode 100755
index 000000000000..4cd148d9506b
--- /dev/null
+++ b/net-misc/chrome-remote-desktop/files/chrome-remote-desktop.rc
@@ -0,0 +1,73 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+extra_started_commands="checkconfig reload"
+
+CRD=/opt/google/chrome-remote-desktop/chrome-remote-desktop
+
+depend() {
+ need net
+ use logger
+}
+
+checkconfig() {
+ local ret=0
+ if [ -z "${CHROME_REMOTING_USERS}" ] ; then
+ eerror "You must set CHROME_REMOTING_USERS in /etc/conf.d/${SVCNAME} first"
+ ret=1
+ else
+ local user
+ for user in ${CHROME_REMOTING_USERS} ; do
+ if ! id "${user}" >/dev/null ; then
+ eerror "Invalid user found in CHROME_REMOTING_USERS: ${user}"
+ ret=1
+ fi
+ done
+ fi
+ return ${ret}
+}
+
+for_users() {
+ local user ret msg log
+ msg=$1; shift
+
+ set -- -- "$@"
+ [ "${CHROME_REMOTE_DESKTOP_DEFAULT_DESKTOP_SIZES+set}" = "set" ] \
+ && set -- -e CHROME_REMOTE_DESKTOP_DEFAULT_DESKTOP_SIZES="${CHROME_REMOTE_DESKTOP_DEFAULT_DESKTOP_SIZES}" "$@"
+ : ${CHROME_REMOTE_DESKTOP_LOG_DIR:=/var/log}
+
+ for user in ${CHROME_REMOTING_USERS} ; do
+ ebegin "${msg} ${SVCNAME} for ${user}"
+
+ log="${CHROME_REMOTE_DESKTOP_LOG_DIR}/${SVCNAME}.${user}.log"
+ checkpath -f -m 0600 -o "${user}" "${log}"
+
+ # We need to background the app as it won't fork until the network
+ # (including DNS) is available.
+ start-stop-daemon \
+ -b \
+ -u "${user}" \
+ -x "${CRD}" \
+ -e "CHROME_REMOTE_DESKTOP_LOG_FILE=${log}" \
+ "$@"
+ eend $?
+ : $(( ret += $? ))
+ done
+
+ return ${ret}
+}
+
+start() {
+ checkconfig || return
+ for_users Starting --start
+}
+
+stop() {
+ for_users Stopping --stop
+}
+
+reload() {
+ for_users Reloading --reload
+}