Skip to content

Commit

Permalink
#1690: allow 'exec' auth on win32, with minor fixes
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@17783 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Dec 29, 2017
1 parent 69bf997 commit 8ed67b5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/xpra/platform/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
CLIPBOARD_GREEDY = envbool("XPRA_CLIPBOARD_GREEDY")
CLIPBOARD_NATIVE_CLASS = None

EXECUTABLE_EXTENSION = ""

UI_THREAD_POLLING = 0
OPEN_COMMAND = []

Expand Down Expand Up @@ -69,6 +71,7 @@
"CLIPBOARD_WANT_TARGETS",
"CLIPBOARD_GREEDY",
"CLIPBOARD_NATIVE_CLASS",
"EXECUTABLE_EXTENSION",
"UI_THREAD_POLLING",
"CLIENT_MODULES",
"INPUT_DEVICES",
Expand Down
2 changes: 2 additions & 0 deletions src/xpra/platform/win32/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
CLIPBOARD_GREEDY = True
CLIPBOARD_NATIVE_CLASS = "xpra.clipboard.translated_clipboard.TranslatedClipboardProtocolHelper"

EXECUTABLE_EXTENSION = "exe"

#these don't make sense on win32:
DEFAULT_PULSEAUDIO_COMMAND = ""
DEFAULT_PULSEAUDIO_CONFIGURE_COMMANDS = []
Expand Down
10 changes: 6 additions & 4 deletions src/xpra/server/auth/exec_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import os
from subprocess import Popen

from xpra.os_util import POSIX
from xpra.util import envint
from xpra.child_reaper import getChildReaper
from xpra.server.auth.sys_auth_base import SysAuthenticator, init, log
from xpra.platform.features import EXECUTABLE_EXTENSION
from xpra.gtk_common.gobject_compat import import_glib

glib = import_glib()
Expand All @@ -24,9 +24,6 @@ class Authenticator(SysAuthenticator):

def __init__(self, username, **kwargs):
log("exec.Authenticator(%s, %s)", username, kwargs)
if not POSIX:
log.warn("Warning: exec authentication is not supported on %s", os.name)
return
self.command = kwargs.pop("command", "")
self.timeout = kwargs.pop("timeout", TIMEOUT)
self.timer = None
Expand All @@ -37,9 +34,14 @@ def __init__(self, username, **kwargs):
from xpra.platform.paths import get_libexec_dir
libexec = get_libexec_dir()
xpralibexec = os.path.join(libexec, "xpra")
log("libexec=%s, xpralibexec=%s", libexec, xpralibexec)
if os.path.exists(xpralibexec):
libexec = xpralibexec
auth_dialog = os.path.join(libexec, "auth_dialog")
if EXECUTABLE_EXTENSION:
#ie: add ".exe" on MS Windows
auth_dialog += ".%s" % EXECUTABLE_EXTENSION
log("auth_dialog=%s", auth_dialog)
if os.path.exists(auth_dialog):
self.command = auth_dialog
assert self.command, "exec authentication module is not configured correctly: no command specified"
Expand Down

0 comments on commit 8ed67b5

Please sign in to comment.