Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rdpadengined spawned as uid 65535 #631

Open
kernelpanic3 opened this issue Nov 28, 2020 · 2 comments
Open

rdpadengined spawned as uid 65535 #631

kernelpanic3 opened this issue Nov 28, 2020 · 2 comments

Comments

@kernelpanic3
Copy link

kernelpanic3 commented Nov 28, 2020

Hi there!

Found a bit of an odd issue just now. When started using rdservice / the systemd script, while everything else runs as root, rdpadengined winds up running under user 65535 (or nobody). This breaks Python in fairly exciting ways:

Failed to import the site module
Traceback (most recent call last):
  File "/usr/lib/python3.6/site.py", line 561, in <module>
    main()
  File "/usr/lib/python3.6/site.py", line 547, in main
    known_paths = addusersitepackages(known_paths)
  File "/usr/lib/python3.6/site.py", line 288, in addusersitepackages
    user_site = getusersitepackages()
  File "/usr/lib/python3.6/site.py", line 264, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/usr/lib/python3.6/site.py", line 254, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/usr/lib/python3.6/sysconfig.py", line 607, in get_config_var
    return get_config_vars().get(name)
  File "/usr/lib/python3.6/sysconfig.py", line 558, in get_config_vars
    _CONFIG_VARS['userbase'] = _getuserbase()
  File "/usr/lib/python3.6/sysconfig.py", line 205, in _getuserbase
    return joinuser("~", ".local")
  File "/usr/lib/python3.6/sysconfig.py", line 184, in joinuser
    return os.path.expanduser(os.path.join(*args))
  File "/usr/lib/python3.6/posixpath.py", line 249, in expanduser
    userhome = pwd.getpwuid(os.getuid()).pw_dir
KeyError: 'getpwuid(): uid not found: 65535'

This is with a fresh build of 3.4.1 on Ubuntu 18.04, albeit inside a systemd-nspawn container on an Arch host. (I had also reproduced this on another Arch install, but no longer seem to be able to, for reasons I'm not sure of.)

Thanks in advance for any advice / fix!

@kernelpanic3
Copy link
Author

kernelpanic3 commented Nov 29, 2020

As an update, I traced another problem back to the same core issue: when attempting to import files, rdxport.cgi is also being spawned as uid 65535. I was able to work around this for the moment by chmod 777'ing /var/snd. Unfortunately, the kludge my partner and I tried for rdpadengined - changing the uid/gid of nobody/nogroup from 65534 to 65535 to give Python something to work with - just makes it so that the engine crashes as soon as it tries to run a script, and on top of that, makes rdxport run mind-numbingly slow (it seems the script is idling/hanging for some time before actually managing to start the import?).

@kernelpanic3
Copy link
Author

kernelpanic3 commented Aug 10, 2022

Just popping in again to say that this is still happening on a testbed I just spun up with 4.0.0beta3int3 from the Paravel repo on Ubuntu 22.04, this time inside a full VM as opposed to a container. I had eventually managed to work around it on 3.x by (if my memory's right) simply running everything as a normal user, but 4.x has added a check against that in rdservice, so I'm a bit stuck ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant