Skip to content

Commit

Permalink
convert to absolute paths before daemonizing
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@13507 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Aug 30, 2016
1 parent da5f08e commit b1057d4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
13 changes: 13 additions & 0 deletions src/xpra/scripts/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,18 @@ def fixup_clipboard(options):
warn(" specify 'to-server', 'to-client' or 'both'")
options.clipboard_direction = "disabled"

def abs_paths(options):
#convert to absolute paths before we daemonize
for k in ("clipboard-filter-file",
"tcp-encryption-keyfile", "encryption-keyfile",
"log-dir", "log-file",
"download-path", "exec-wrapper",
"ssl-key", "ssl-cert", "ssl-ca-certs"):
f = k.replace("-", "_")
v = getattr(options, f)
if v and (k!="ssl-ca-certs" or v!="default"):
setattr(options, f, os.path.abspath(v))

def fixup_options(options, defaults={}):
fixup_encodings(options)
fixup_compression(options)
Expand All @@ -1018,6 +1030,7 @@ def fixup_options(options, defaults={}):
fixup_socketdirs(options, defaults)
fixup_clipboard(options)
fixup_keyboard(options)
abs_paths(options)
#remote-xpra is meant to be a list, but the user can specify a string using the command line,
#in which case we replace all the default values with this single entry:
if not isinstance(options.remote_xpra, (list, tuple)):
Expand Down
5 changes: 3 additions & 2 deletions src/xpra/scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,9 @@ def do_parse_cmdline(cmdline, defaults):
parser = ModifiedOptionParser(version="xpra v%s" % XPRA_VERSION,
usage="\n" + "".join(command_options))
hidden_options = {
"display" : defaults.display,
"wm_name" : defaults.wm_name,
"display" : defaults.display,
"wm_name" : defaults.wm_name,
"download_path" : defaults.download_path,
}
def replace_option(oldoption, newoption):
do_replace_option(cmdline, oldoption, newoption)
Expand Down

0 comments on commit b1057d4

Please sign in to comment.