Bug 38688 - Don't allow share names with consecutive whitespaces
Don't allow share names with consecutive whitespaces
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - Shares
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.2-2-errata
Assigned To: Florian Best
Felix Botner
:
Depends on:
Blocks: 38689 45338
  Show dependency treegraph
 
Reported: 2015-06-11 17:55 CEST by Janis Meybohm
Modified: 2021-10-06 14:46 CEST (History)
6 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.143
Enterprise Customer affected?: Yes
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2017021021000308, 2017033121000455, 2017090521000618
Bug group (optional): External feedback, Troubleshooting
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Janis Meybohm univentionstaff 2015-06-11 17:55:33 CEST
Ticket#2015061121000295

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.
Comment 1 Arvid Requate univentionstaff 2017-02-21 11:39:23 CET
In Ticket# 2017021021000308 we had a share configured with double spaces. In this case the UMC should not allow this.
Comment 2 Christina Scheinig univentionstaff 2017-04-04 14:16:58 CEST
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
    self._lp.load_default()
Comment 3 Stefan Gohmann univentionstaff 2017-09-05 17:50:03 CEST
Happens again in a school customer environment and it broke the school DC: Tiket #2017090521000618.
Comment 5 Florian Best univentionstaff 2017-09-05 22:09:24 CEST
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.

univention-samba (11.0.1-11):
r82698 | Bug #38688: encode filesystem path of shares

univention-samba.yaml:
r82699 | YAML Bug #38688
Comment 6 Felix Botner univentionstaff 2017-09-07 10:59:32 CEST
(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
> filenames.

yes, i dont like this resync, is there a way to change the listener without touching the existing config?
Comment 7 Felix Botner univentionstaff 2017-09-07 11:00:09 CEST
Do we need this for 4.1-4 also?
Comment 8 Felix Botner univentionstaff 2017-09-07 12:21:25 CEST
(In reply to Felix Botner from comment #7)
> Do we need this for 4.1-4 also?

no (only univention-samba4)
Comment 9 Florian Best univentionstaff 2017-09-08 15:25:27 CEST
Ok, it's manually done in postinst now:

univention-samba (11.0.1-12):
2ed82d5ec081f81ee6e359bdf3d4889b73953a3a | Merge branch 'fbest/38688-samba3-share-name-escaping' into 4.2-2
e497652d599026dbf1b986a81571af51f716c15c | Bug #38688: don't listener resync
Comment 10 Felix Botner univentionstaff 2017-09-11 11:51:18 CEST
OK - YAML
OK - share names
OK - update
Comment 11 Felix Botner univentionstaff 2017-09-11 12:11:12 CEST
please 1 to version (errata4.2-1) in the yaml file
Comment 12 Florian Best univentionstaff 2017-09-12 16:11:57 CEST
71e28d4c96a53bb88723eb32bc6e989d52729777 | YAML Bug #38688
Comment 13 Felix Botner univentionstaff 2017-09-12 16:39:26 CEST
(In reply to Florian Best from comment #12)
> 71e28d4c96a53bb88723eb32bc6e989d52729777 | YAML Bug #38688

ok
Comment 14 Arvid Requate univentionstaff 2017-09-13 16:35:03 CEST
<http://errata.software-univention.de/ucs/4.2/163.html>