1
0
mirror of https://github.com/altlinux/gpupdate.git synced 2025-03-21 18:50:38 +03:00

Added restriction of access to the connected network catalogs of other users

This commit is contained in:
Valery Sinelnikov 2025-03-04 11:33:09 +04:00
parent 5fe0b6f418
commit 2c66ad9bc1

View File

@ -18,6 +18,7 @@
import jinja2
import os
import pwd
import subprocess
from pathlib import Path
import string
@ -294,6 +295,10 @@ class cifs_applier_user(applier_frontend):
self.auto_master_d.mkdir(parents=True, exist_ok=True)
# Create user's destination mount directory
self.mount_dir.mkdir(parents=True, exist_ok=True)
uid = pwd.getpwnam(self.username).pw_uid if self.username else None
if uid:
os.chown(self.mount_dir, uid=uid, gid=-1)
self.mount_dir.chmod(0o700)
# Add pointer to /etc/auto.master.gpiupdate.d in /etc/auto.master
auto_destdir = '+dir:{}'.format(self.__auto_dir)