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

[BUG] Can't run Salt as a standard (non-admin) user on Windows #61789

Closed
6 tasks
twangboy opened this issue Mar 15, 2022 · 2 comments · Fixed by #63510
Closed
6 tasks

[BUG] Can't run Salt as a standard (non-admin) user on Windows #61789

twangboy opened this issue Mar 15, 2022 · 2 comments · Fixed by #63510
Assignees
Labels
Bug broken, incorrect, or confusing behavior
Milestone

Comments

@twangboy
Copy link
Contributor

Description
Can't run Salt as a standard (non-admin) user on Windows. It tries to read a registry key from HKLM:\SOFTWARE\Salt Project\Salt. Is there a valid reason to lock down this registry key?

Setup
Install Salt using standard installer
Create a config file for the user: C:\Users\<username>\Salt\conf\minion

Please be as specific as possible and give set-up details.

  • on-prem machine
  • VM (Virtualbox, KVM, etc. please specify)
  • VM running on a cloud service, please be explicit and add details
  • container (Kubernetes, Docker, containerd, etc. please specify)
  • or a combination, please be explicit
  • jails if it is FreeBSD

Steps to Reproduce the behavior
Run salt-call: salt-call --local -c "C:\Users\<username>\Salt\conf" test.ping
StackTrace:

C:\Windows\system32>salt-call --local -c "C:\Users\standard.user\Salt\conf" test.ping
Traceback (most recent call last):
  File "C:\Program Files\Salt Project\Salt\bin\Scripts\salt-call", line 4, in <module>
    __import__('pkg_resources').run_script('salt==3004', 'salt-call')
  File "C:\Program Files\Salt Project\Salt\bin\lib\site-packages\pkg_resources\__init__.py", line 656, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "C:\Program Files\Salt Project\Salt\bin\lib\site-packages\pkg_resources\__init__.py", line 1453, in run_script
    exec(code, namespace, namespace)
  File "c:\program files\salt project\salt\bin\lib\site-packages\salt-3004-py3.8.egg\EGG-INFO\scripts\salt-call", line 10, in <module>
    salt_call()
  File "C:\Program Files\Salt Project\Salt\bin\lib\site-packages\salt-3004-py3.8.egg\salt\scripts.py", line 426, in salt_call
    import salt.cli.call
  File "C:\Program Files\Salt Project\Salt\bin\lib\site-packages\salt-3004-py3.8.egg\salt\cli\call.py", line 3, in <module>
    import salt.cli.caller
  File "C:\Program Files\Salt Project\Salt\bin\lib\site-packages\salt-3004-py3.8.egg\salt\cli\caller.py", line 14, in <module>
    import salt.loader
  File "C:\Program Files\Salt Project\Salt\bin\lib\site-packages\salt-3004-py3.8.egg\salt\loader\__init__.py", line 14, in <module>
    import salt.config
  File "C:\Program Files\Salt Project\Salt\bin\lib\site-packages\salt-3004-py3.8.egg\salt\config\__init__.py", line 17, in <module>
    import salt.syspaths
  File "C:\Program Files\Salt Project\Salt\bin\lib\site-packages\salt-3004-py3.8.egg\salt\syspaths.py", line 128, in <module>
    ROOT_DIR = _get_windows_root_dir()
  File "C:\Program Files\Salt Project\Salt\bin\lib\site-packages\salt-3004-py3.8.egg\salt\syspaths.py", line 99, in _get_windows_root_dir
    root_dir = salt.utils.win_reg.read_value(
  File "C:\Program Files\Salt Project\Salt\bin\lib\site-packages\salt-3004-py3.8.egg\salt\utils\win_reg.py", line 537, in read_value
    handle = win32api.RegOpenKeyEx(hkey, local_key, 0, access_mask)
pywintypes.error: (5, 'RegOpenKeyEx', 'Access is denied.')

Expected behavior
Should be able to run salt as a standard (non-admin) user

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3004

Dependency Versions:
          cffi: 1.14.6
      cherrypy: 18.6.1
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: 4.0.7
     gitpython: 3.1.18
        Jinja2: 2.10.1
       libgit2: Not Installed
      M2Crypto: Not Installed
          Mako: 1.1.4
       msgpack: 0.6.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: 2.20
      pycrypto: Not Installed
  pycryptodome: 3.10.1
        pygit2: Not Installed
        Python: 3.8.8 (tags/v3.8.8:024d805, Feb 19 2021, 13:18:16) [MSC v.1928 64 bit (AMD64)]
  python-gnupg: 0.4.7
        PyYAML: 5.4.1
         PyZMQ: 19.0.0
         smmap: 4.0.0
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.2

System Versions:
          dist:
        locale: cp1252
       machine: AMD64
       release: 2016Server
        system: Windows
       version: 2016Server 10.0.14393 SP0 Multiprocessor Free
@twangboy twangboy added Bug broken, incorrect, or confusing behavior needs-triage labels Mar 15, 2022
@waynew waynew added this to the Approved milestone Mar 31, 2022
@waynew waynew removed their assignment Mar 31, 2022
@twangboy
Copy link
Contributor Author

Need to test if we can give the Non-Admin user permissions to the registry key and have Salt run properly.

@nschoonm
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants