Univention Bugzilla – Bug 38688
Don't allow share names with consecutive whitespaces
Last modified: 2017-09-13 16:35:03 CEST
Samba config parser reduces consecutive whitespaces to one.
If a share "a b" is defined "/etc/samba/shares.conf.d/a\ \ \ b" is created and included in "/etc/samba/shares.conf" but samba tries to include "/etc/samba/shares.conf.d/a\ b".
testparm just gives a warning about that but samba-tool testparm dies with "ERROR: Unable to load default file" leading to bug38686
We should reduce consecutive whitespaces (maybe in general, for user and group names etc.?) and/or throw a syntax warning.
In Ticket# 2017021021000308 we had a share configured with double spaces. In this case the UMC should not allow this.
In Ticket# 2017033121000455 we had a share configured with double spaces again. This causes the 'samba-tool drs showrepl' to fail with the following error message:
root@ucsschool:~# samba-tool drs showrepl
ERROR(runtime): uncaught exception - Unable to load default file
File "/usr/lib/python2.7/dist-packages/samba/netcmd/__init__.py", line 176, in _run
return self.run(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/samba/netcmd/drs.py", line 126, in run
self.lp = sambaopts.get_loadparm()
File "/usr/lib/python2.7/dist-packages/samba/getopt.py", line 92, in get_loadparm
Happens again in a school customer environment and it broke the school DC: Tiket #2017090521000618.
I fixed this by encoding the files with urlencoding.
The postinst contains a listener resync. If this is not okay then REOPEN and I will add update code with "mv" to the postinst which encodes all existing filenames.
r82698 | Bug #38688: encode filesystem path of shares
r82699 | YAML Bug #38688
(In reply to Florian Best from comment #5)
> I fixed this by encoding the files with urlencoding.
> The postinst contains a listener resync. If this is not okay then REOPEN and
> I will add update code with "mv" to the postinst which encodes all existing
yes, i dont like this resync, is there a way to change the listener without touching the existing config?
Do we need this for 4.1-4 also?
(In reply to Felix Botner from comment #7)
> Do we need this for 4.1-4 also?
no (only univention-samba4)
Ok, it's manually done in postinst now:
2ed82d5ec081f81ee6e359bdf3d4889b73953a3a | Merge branch 'fbest/38688-samba3-share-name-escaping' into 4.2-2
e497652d599026dbf1b986a81571af51f716c15c | Bug #38688: don't listener resync
OK - YAML
OK - share names
OK - update
please 1 to version (errata4.2-1) in the yaml file
71e28d4c96a53bb88723eb32bc6e989d52729777 | YAML Bug #38688
(In reply to Florian Best from comment #12)
> 71e28d4c96a53bb88723eb32bc6e989d52729777 | YAML Bug #38688