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] "PermissionError: [Errno 13] Permission denied: '.'" when running 'salt-key' from user's '$HOME' on NFS #65093

Closed
2 tasks done
rjc opened this issue Aug 31, 2023 · 0 comments
Assignees
Labels
Bug broken, incorrect, or confusing behavior needs-triage

Comments

@rjc
Copy link
Contributor

rjc commented Aug 31, 2023

Description

$ cd $HOME && sudo salt-key -L

The above command run in user's home directory with very strict access permissions and which residing on NFS, causes the error below:

$ cd $HOME && sudo salt-key -L
Usage: salt-key [options]

salt-key: error: Error while processing <function SaltKeyOptionParser.__create_keys_dir at 0x7f64642035e0>: Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/salt/utils/parsers.py", line 212, in parse_args
    mixin_after_parsed_func(self)
  File "/usr/lib/python3/dist-packages/salt/utils/parsers.py", line 2777, in __create_keys_dir
    os.makedirs(self.config["gen_keys_dir"])
  File "/usr/lib/python3.8/os.py", line 223, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '.'

Please read #31507 as this is exactly the same issue but, unfortunatelly, that one just got closed as completed.

Setup
User, who has admin permissions granted via sudo and $HOME on an NFS server with permission not allowing the local root user to view it.

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

  • VM (Virtualbox, KVM, etc. please specify)
  • classic packaging

Steps to Reproduce the behavior

  1. Set up an NFS server with 0700 permissions on user's $HOME directories.
  2. On a client machine, which is not the NFS root, run cd $HOME && sudo salt-key -L - user obviously has local admin rights via sudo.
  3. Get the above error message.
  4. cd / && sudo salt-key -L works as expected and obviously doesn't display the message as there are no NFS access constraints on local /, which is then the $PWD.

Expected behavior

$ cd $HOME && sudo salt-key -L

run in user's $HOME directory, which resides on NFS and has strict access permissions (0700) should still display the list of keys.

Versions Report

salt --versions-report
$ salt --versions-report
Salt Version:
          Salt: 3005.2

Dependency Versions:
          cffi: Not Installed
      cherrypy: Not Installed
      dateutil: 2.7.3
     docker-py: Not Installed
         gitdb: 2.0.6
     gitpython: 3.0.7
        Jinja2: 2.10.1
       libgit2: 0.28.3
      M2Crypto: Not Installed
          Mako: 1.1.0
       msgpack: 0.6.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: Not Installed
      pycrypto: 2.6.1
  pycryptodome: 3.6.1
        pygit2: 1.0.3
        Python: 3.8.10 (default, May 26 2023, 14:05:08)
  python-gnupg: 0.4.5
        PyYAML: 5.3.1
         PyZMQ: 20.0.0
         smmap: 2.0.5
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.2

System Versions:
          dist: ubuntu 20.04 focal
        locale: utf-8
       machine: x86_64
       release: 5.15.0-72-generic
        system: Linux
       version: Ubuntu 20.04 focal

Additional context
Add any other context about the problem here.

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 needs-triage
Projects
None yet
Development

No branches or pull requests

3 participants