Skip to content

Commit

Permalink
#3276 fallback to current user credentials if the ones specified are …
Browse files Browse the repository at this point in the history
…invalid
  • Loading branch information
totaam committed Sep 24, 2021
1 parent 0f5a81d commit ccc61c7
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions xpra/scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1579,12 +1579,21 @@ def get_sockpath(display_desc, error_cb, timeout=CONNECT_TIMEOUT):
sockpath = display_desc.get("socket_path")
if not sockpath:
#find the socket using the display:
# if uid, gid or username are missing or not found on the local system,
# use the uid, gid and username of the current user:
uid = display_desc.get("uid", getuid())
gid = display_desc.get("gid", getgid())
username = display_desc.get("username", get_username_for_uid(uid))
if not username:
uid = getuid()
gid = getgid()
username = get_username_for_uid(uid)
dotxpra = DotXpra(
display_desc.get("socket_dir"),
display_desc.get("socket_dirs"),
display_desc.get("username", ""),
display_desc.get("uid", 0),
display_desc.get("gid", 0),
username,
uid,
gid,
)
display = display_desc["display"]
def socket_details(state=DotXpra.LIVE):
Expand Down

0 comments on commit ccc61c7

Please sign in to comment.