Bug 32018 - broken NFS user share with blanks
broken NFS user share with blanks
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: NFS
UCS 3.1
Other Linux
: P5 normal (vote)
: UCS 4.1-3-errata
Assigned To: Philipp Hahn
Stefan Gohmann
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-18 19:01 CEST by Philipp Hahn
Modified: 2016-10-12 13:06 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.034
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2013-07-18 19:01:21 CEST
A NFS share can be assigned to users as their $HOME directory.
If that directory contains a blank/space, UDM fails to correctly parse the automountInformation LDAP attribute:

services/univention-nfs/nfs-homes.py:83
	unc = automountInformation
	if " " in automountInformation:
		flags, unc = automountInformation.split(" ", 1)
	if ":" in unc:
		host, path = unc.split(':', 1)

OK: "-rw host:/my share" → ("-rw", "host:/my share") → ("host", "/my share")
BUG: "host:/my user" → ("host:/my", "user")


management/univention-directory-manager-modules/modules/univention/admin/handlers/users/user.py:1531
	unc = ''
	try:
		flags, unc = re.split(' *', self.oldattr['automountInformation'][0])
	except ValueError:
		pass
	if unc.find(':') > 1:
		host, path = unc.split(':')
BUG: "-rw host:/my share" → ('-rw', 'host:/my', 'share')
BUG: "host:/my user" → ("host:/my", "user")
FYI: At least use re.split(' +', ..., 1)


base/univention-home-mounter/univention-mount-homedir:165
	host=`echo "$homeattr" | sed 's/.* \([^ ]*\):\([^ ]*\)/\1/'`
	path=`echo "$homeattr" | sed 's/.* \([^ ]*\):\([^ ]*\)/\2/'`

BUG: "-rw host:/my share" → ('host share', '/my share')
BUG: "host:/my user" → ("host:/my share", "host:/my share")
FYI: See Bug #29344 for an updated version of univention-mount-homedir.


FYI: The UDM-users/user-module always creates a value like "-rw $host:$path" for the LDAP attribute "automountInformation". Generally the attribute can contain arbitrary data, see <http://linux.die.net/man/5/autofs>. Therefor the value probably needs to be treated as a shell argument, which would require using "shlex" in Python to parse the string and require proper escaping to generate the value in the UDM module.
Comment 1 Philipp Hahn univentionstaff 2016-09-27 16:03:32 CEST
r72845 | Bug #42491,Bug #32018 home: Fix umount
r72844 | Bug #32018 home: Fix share names with blanks

Package: univention-home-mounter
Version: 7.0.1-2.74.201609271550
Branch: ucs_4.1-0
Scope: errata4.1-3

r72846 | Bug #42491,Bug #32018 home: YAML
 univention-home-mounter.yaml

r72849 | Bug #42491,Bug #32018 home: Fix umount
r72848 | Bug #32018 home: Fix share names with blanks
Comment 2 Stefan Gohmann univentionstaff 2016-10-10 16:38:12 CEST
YAML: OK

Code review: OK

Merge to UCS 4.2: OK

Tests: OK
Comment 3 Janek Walkenhorst univentionstaff 2016-10-12 13:06:40 CEST
<http://errata.software-univention.de/ucs/4.1/283.html>