[neon/neon/settings/Neon/stable] /: setup support bits for samba usershares
Carlos De Maine
null at kde.org
Sun May 31 06:34:27 BST 2026
Git commit 81f2754a060000158b2c07f6a456116d1f9977d1 by Carlos De Maine.
Committed on 31/05/2026 at 05:34.
Pushed by carlosdem into branch 'Neon/stable'.
setup support bits for samba usershares
(cherry picked from commit a314942dc14f191b119249bdb432fdb11786bff4)
M +22 -0 debian/neon-settings-2.postinst
A +6 -0 etc/samba/neon-usershares-smb.conf
https://invent.kde.org/neon/neon/settings/-/commit/81f2754a060000158b2c07f6a456116d1f9977d1
diff --git a/debian/neon-settings-2.postinst b/debian/neon-settings-2.postinst
index ef47872..cf15d90 100644
--- a/debian/neon-settings-2.postinst
+++ b/debian/neon-settings-2.postinst
@@ -82,4 +82,26 @@ fi
# returns the correct string to identify neon. set here to make sure it's correct.
ln -sf /etc/dpkg/origins/neon /etc/dpkg/origins/default
+# check/add config for samba usershare support
+grep -qxF "include = /etc/samba/neon-usershares-smb.conf" /etc/samba/smb.conf || echo "include = /etc/samba/neon-usershares-smb.conf" >> /etc/samba/smb.conf
+
+# check/add directory and permissions required for samba usershare support
+DIR="/var/lib/samba/usershares"
+REQUIRED_PERM="1755"
+REQUIRED_OWNERS="root:sambashare"
+
+if [ ! -d "$DIR" ]; then
+ mkdir -p "$DIR"
+fi
+
+CURRENT_PERM=$(stat -c "%a" "$DIR")
+if [ ! "$CURRENT_PERM" = "$REQUIRED_PERM" ]; then
+ chmod "$REQUIRED_PERM" "$DIR"
+fi
+
+CURRENT_OWNERS=$(stat -c '%U:%G' "$DIR")
+if [ ! "$CURRENT_OWNERS" = "$REQUIRED_OWNERS" ]; then
+ chown "$REQUIRED_OWNERS" "$DIR"
+fi
+
exit 0
diff --git a/etc/samba/neon-usershares-smb.conf b/etc/samba/neon-usershares-smb.conf
new file mode 100644
index 0000000..9e36d8f
--- /dev/null
+++ b/etc/samba/neon-usershares-smb.conf
@@ -0,0 +1,6 @@
+[globals]
+
+ usershare path = /var/lib/samba/sambashares
+ usershare max shares = 100
+ usershare allow guests = yes # optional line
+ usershare owner only = yes
More information about the Neon-commits
mailing list