diff --git a/plinth/modules/samba/__init__.py b/plinth/modules/samba/__init__.py index da213d0b1..6a4c9e910 100644 --- a/plinth/modules/samba/__init__.py +++ b/plinth/modules/samba/__init__.py @@ -41,7 +41,7 @@ class SambaApp(app_module.App): app_id = 'samba' - _version = 4 + _version = 5 def __init__(self) -> None: """Create components for the app.""" @@ -82,11 +82,6 @@ class SambaApp(app_module.App): (445, 'tcp6')]) self.add(daemon) - daemon_nmbd = Daemon('daemon-samba-nmbd', 'nmbd', - listen_ports=[(137, 'udp4'), (138, 'udp4')]) - - self.add(daemon_nmbd) - users_and_groups = UsersAndGroups('users-and-groups-samba', groups=groups) self.add(users_and_groups) diff --git a/plinth/modules/samba/data/usr/lib/systemd/system/nmbd.service.d/freedombox.conf b/plinth/modules/samba/data/usr/lib/systemd/system/nmbd.service.d/freedombox.conf deleted file mode 100644 index c178ad6a1..000000000 --- a/plinth/modules/samba/data/usr/lib/systemd/system/nmbd.service.d/freedombox.conf +++ /dev/null @@ -1,16 +0,0 @@ -[Service] -LockPersonality=yes -MemoryDenyWriteExecute=yes -NoNewPrivileges=yes -PrivateDevices=yes -PrivateMounts=yes -PrivateTmp=yes -ProtectControlGroups=yes -ProtectHome=yes -ProtectKernelLogs=yes -ProtectKernelModules=yes -ProtectKernelTunables=yes -ProtectSystem=full -RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK -RestrictRealtime=yes -SystemCallArchitectures=native diff --git a/plinth/modules/samba/manifest.py b/plinth/modules/samba/manifest.py index 8c336ea7a..810fe9e11 100644 --- a/plinth/modules/samba/manifest.py +++ b/plinth/modules/samba/manifest.py @@ -85,9 +85,4 @@ clients = [{ }] }] -backup = { - 'data': { - 'files': [SHARES_CONF_BACKUP_FILE] - }, - 'services': ['smbd', 'nmbd'] -} +backup = {'data': {'files': [SHARES_CONF_BACKUP_FILE]}, 'services': ['smbd']} diff --git a/plinth/modules/samba/privileged.py b/plinth/modules/samba/privileged.py index c29e2f6cf..77664adc0 100644 --- a/plinth/modules/samba/privileged.py +++ b/plinth/modules/samba/privileged.py @@ -285,6 +285,13 @@ def setup(): _use_config_file(CONF_PATH) os.makedirs('/var/lib/freedombox', exist_ok=True) os.chmod('/var/lib/freedombox', 0o0755) + + # Disable NetBIOS Service, used with now deprecated SMB1 protocol + if action_utils.service_is_running('nmbd'): + action_utils.service_stop('nmbd') + action_utils.service_disable('nmbd') + action_utils.service_mask('nmbd') + if action_utils.service_is_running('smbd'): action_utils.service_restart('smbd')