Univention Bugzilla – Bug 32018
broken NFS user share with blanks
Last modified: 2016-10-12 13:06:40 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.
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
YAML: OK Code review: OK Merge to UCS 4.2: OK Tests: OK
<http://errata.software-univention.de/ucs/4.1/283.html>