Fix: Samba config PUT 422 + shadow:format setparm dash escaping

Route /samba/{name} was matching before /samba/config, causing 422 on
PUT /samba/config. Moved static routes before parameterized routes.

Values starting with '-' (shadow: format = -%Y-%m-%d-%H%M) were parsed
as CLI flags by net conf setparm. Added '--' separator to escape them.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-05 16:04:06 +02:00
parent eef4ab09a7
commit 3632991043
2 changed files with 26 additions and 26 deletions
+1 -1
View File
@@ -255,7 +255,7 @@ class SharesManager:
try:
for key, value in parameters.items():
result = subprocess.run(
['/usr/bin/net', 'conf', 'setparm', 'global', key, value],
['/usr/bin/net', 'conf', 'setparm', 'global', key, '--', value],
capture_output=True,
text=True,
timeout=10