diff options
author | John Estabrook <jestabro@vyos.io> | 2023-04-10 14:04:00 -0500 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2023-12-16 20:37:10 -0600 |
commit | 077c66613494cc7a4e8a30b6420e757ae62330e6 (patch) | |
tree | 354061ef3082d457fad4a2db4713801803a5fc5b /python/vyos/utils | |
parent | c1d02ab5a2594d945e3f7aed18a1c18f296d65e2 (diff) | |
download | vyos-1x-077c66613494cc7a4e8a30b6420e757ae62330e6.tar.gz vyos-1x-077c66613494cc7a4e8a30b6420e757ae62330e6.zip |
image: T4516: correct permissions on creation of config directory
(cherry picked from commit 74b00c1f6961d1bd3a59768021f154bdb64c154e)
Diffstat (limited to 'python/vyos/utils')
-rw-r--r-- | python/vyos/utils/file.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/python/vyos/utils/file.py b/python/vyos/utils/file.py index 667a2464b..9f27a7fb9 100644 --- a/python/vyos/utils/file.py +++ b/python/vyos/utils/file.py @@ -134,6 +134,12 @@ def chmod_755(path): S_IROTH | S_IXOTH chmod(path, bitmask) +def chmod_2775(path): + """ user/group permissions with set-group-id bit set """ + from stat import S_ISGID, S_IRWXU, S_IRWXG, S_IROTH, S_IXOTH + + bitmask = S_ISGID | S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH + chmod(path, bitmask) def makedir(path, user=None, group=None): if os.path.exists(path): |