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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user