summaryrefslogtreecommitdiff
path: root/python/vyos/utils
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2023-04-10 14:04:00 -0500
committerJohn Estabrook <jestabro@vyos.io>2023-11-15 11:29:04 -0600
commit74b00c1f6961d1bd3a59768021f154bdb64c154e (patch)
tree507eaa2485959c0bee07269977e4ab0e9c55af7b /python/vyos/utils
parent8f94262e8fa2477700c50303ea6e2c6ddad72adb (diff)
downloadvyos-1x-74b00c1f6961d1bd3a59768021f154bdb64c154e.tar.gz
vyos-1x-74b00c1f6961d1bd3a59768021f154bdb64c154e.zip
image: T4516: correct permissions on creation of config directory
Diffstat (limited to 'python/vyos/utils')
-rw-r--r--python/vyos/utils/file.py6
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):