saltstack / saltstack/salt

[BUG] minion does not respect systemd UMask 022

Open
#66,055 2 comments 0 reactions 1 assignee View on GitHub

@Akm0d is already working on this.

Since May 8, 2024.

bug needs-triage
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
Posted details of the issue here: https://groups.google.com/g/salt-users/c/5DEzzb5xLq4

I can gladly paste it here if that is the desire.

Setup

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

  • on-prem machine
  • container (master is on docker using pypi)
  • classic packaging (with pypi)

Steps to Reproduce the behavior
Set UMask=022 on the salt-minion.service file, restart the service and see salt minion1 cmd.run 'umask' report 077 instead.
When i create a file on all the minions the permissions are mixed:

salt \* cmd.run "ls -al file1.txt"
jid: 20240213155817815117
<redactedminion_name>:
    -rw-r--r-- 1 root root 0 Feb 13 15:58 file1.txt
<redactedminion_name>:
    -rw-r--r-- 1 root root 0 Feb 13 15:58 file1.txt
<redactedminion_name>:
    -rw------- 1 root root 0 Feb 13 15:58 file1.txt
<redactedminion_name>:
    -rw-r--r-- 1 root root 0 Feb 13 15:58 file1.txt
<redactedminion_name>:
    -rw-r--r-- 1 root root 0 Feb 13 15:58 file1.txt
<redactedminion_name>:
    -rw------- 1 root root 0 Feb 13 15:58 file1.txt
<redactedminion_name>:
    -rw-r--r-- 1 root root 0 Feb 13 15:58 file1.txt
<redactedminion_name>:
    -rw------- 1 root root 0 Feb 13 15:58 file1.txt
<redactedminion_name>:
    -rw-r--r-- 1 root root 0 Feb 13 15:58 file1.txt
<redactedminion_name>:
    -rw-------. 1 root root 0 Feb 13 15:58 file1.txt
<redactedminion_name>:
    -rw-r--r-- 1 root root 0 Feb 13 15:58 file1.txt
<redactedminion_name>:
    -rw-r--r-- 1 root root 0 Feb 13 15:58 file1.txt
<redactedminion_name>:
    -rw-r--r-- 1 root root 0 Feb 13 15:58 file1.txt
<redactedminion_name>:
    -rw------- 1 root root 0 Feb 13 15:58 file1.txt
<redactedminion_name>:
    -rw-r--r-- 1 root root 0 Feb 13 15:58 file1.txt
<redactedminion_name>:
    -rw------- 1 root root 0 Feb 13 15:58 file1.txt
<redactedminion_name>:
    -rw-r--r-- 1 root root 0 Feb 13 15:58 file1.txt
<redactedminion_name>:
    -rw-r--r-- 1 root root 0 Feb 13 15:58 file1.txt
<redactedminion_name>:
    -rw-r--r-- 1 root root 0 Feb 13 15:58 file1.txt
<redactedminion_name>:
    -rw-r--r-- 1 root root 0 Feb 13 15:58 file1.txt
<redactedminion_name>:
    -rw-r--r-- 1 root root 0 Feb 13 15:58 file1.txt
<redactedminion_name>:
    -rw-r--r-- 1 root root 0 Feb 13 15:58 file1.txt
<redactedminion_name>:
    -rw-r--r-- 1 root root 0 Feb 13 15:58 file1.txt
<redactedminion_name>:
    -rw-r--r-- 1 root root 0 Feb 13 15:58 file1.txt
<redactedminion_name>:
    -rw------- 1 root root 0 Feb 13 15:58 file1.txt
<redactedminion_name>:
    -rw------- 1 root root 0 Feb 13 15:57 file1.txt
<redactedminion_name>:
    -rw------- 1 root root 0 Feb 13 15:58 file1.txt
<redactedminion_name>:
    -rw------- 1 root root 0 Feb 13 15:58 file1.txt

Expected behavior
cmd.run 'umask' should report 022 and newly created file permissions should also be according to the umask set. salt minion1 cmd.run 'touch file.txt' , salt minion1 cmd.run 'ls -al file.txt'

Screenshots
If applicable, add screenshots to help explain your problem.

Versions Report

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

Python Version:
        Python: 3.9.18 (main, Jan 27 2024, 07:41:26)

Dependency Versions:
          cffi: 1.16.0
      cherrypy: unknown
      dateutil: 2.8.2
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.3
       libgit2: Not Installed
  looseversion: 1.3.0
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.7
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 23.2
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.20.0
        pygit2: Not Installed
  python-gnupg: Not Installed
        PyYAML: 6.0.1
         PyZMQ: 25.1.2
        relenv: Not Installed
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.4

Salt Extensions:
   salt-nornir: 0.21.0

System Versions:
          dist: alpine 3.19.1
        locale: utf-8
       machine: x86_64
       release: 5.14.0-362.18.1.el9_3.x86_64
        system: Linux
       version: Alpine Linux 3.19.1
salt-minion --versions-report (minion rocky8) (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3006.6

Python Version:
        Python: 3.9.18 (main, Nov 18 2023, 01:00:14)

Dependency Versions:
          cffi: 1.15.1
      cherrypy: 18.8.0
      dateutil: 2.8.2
     docker-py: 6.1.3
         gitdb: 4.0.10
     gitpython: 3.1.31
        Jinja2: 3.1.2
       libgit2: Not Installed
  looseversion: 1.2.0
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.5
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 23.1
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.18.0
        pygit2: Not Installed
  python-gnupg: 0.5.0
        PyYAML: 5.4.1
         PyZMQ: 25.0.2
        relenv: Not Installed
         smmap: 5.0.0
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist: rocky 8.8 Green Obsidian
        locale: utf-8
       machine: x86_64
       release: 4.18.0-477.15.1.el8_8.x86_64
        system: Linux
       version: Rocky Linux 8.8 Green Obsidian
salt-minion --versions-report (minion rocky9) (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3006.6

Python Version:
        Python: 3.9.18 (main, Jan  4 2024, 00:00:00)

Dependency Versions:
          cffi: Not Installed
      cherrypy: Not Installed
      dateutil: 2.8.1
     docker-py: 6.1.3
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.2
       libgit2: Not Installed
  looseversion: 1.3.0
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.5
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 23.1
     pycparser: Not Installed
      pycrypto: Not Installed
  pycryptodome: 3.18.0
        pygit2: Not Installed
  python-gnupg: 0.5.1
        PyYAML: 6.0.1
         PyZMQ: 25.0.2
        relenv: Not Installed
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist: rocky 9.3 Blue Onyx
        locale: utf-8
       machine: x86_64
       release: 5.14.0-362.18.1.el9_3.x86_64
        system: Linux
       version: Rocky Linux 9.3 Blue Onyx

Additional context

As stated in the google groups link, I get mixed results. Sometimes after a service restart or a stop/start, salt-minion report the correct umask as declared in the service file, but other times it does not. I have to continually restart the minion service until it finally consistently reports umask as 022.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.