Univention Bugzilla – Bug 45207
modifying share raises IndexError: string index out of range
Last modified: 2019-11-13 06:34:25 CET
Execution of command 'udm/put shares/share' has failed: Traceback (most recent call last): File "%PY2.7%/notifier/threads.py", line 82, in _run tmp = self._function() File "%PY2.7%/notifier/__init__.py", line 104, in __call__ return self._function( *tmp, **self._kwargs ) File "%PY2.7%/univention/management/console/modules/udm/__init__.py", line 409, in _thread module.modify(properties) File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 82, in _decorated return method(*args, **kwargs) File "%PY2.7%/univention/management/console/ldap.py", line 143, in _decorated result = func(*args, **kwargs) File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 453, in modify obj.modify() File "%PY2.7%/univention/admin/handlers/__init__.py", line 347, in modify dn = self._modify(modify_childs, ignore_license=ignore_license, response=response) File "%PY2.7%/univention/admin/handlers/__init__.py", line 849, in _modify self._call_checkLdap_on_all_property_syntaxes() File "%PY2.7%/univention/admin/handlers/__init__.py", line 1143, in _call_checkLdap_on_all_property_syntaxes if not self.exists() or self.hasChanged(pname): File "%PY2.7%/univention/admin/handlers/__init__.py", line 159, in hasChanged return not univention.admin.mapping.mapCmp(self.mapping, key, self.oldinfo.get(key, ''), self.info.get(key, '')) File "%PY2.7%/univention/admin/mapping.py", line 330, in mapCmp return map[1](old) == map[1](new) File "%PY2.7%/univention/admin/handlers/shares/share.py", line 743, in insertQuotes if new_entry[0] == "@": IndexError: string index out of range
Version: 4.2-1 errata122 (Lesum) - UCS@school 4.2 v2 Remark: Ich möchte die Schreibberechtigungen bei einem Share auf die Gruppe der lehrer-$OU beschränken. Ich kann aber hier keinen Benutzer oder Gruppe eintragen. Es kommt immer die Fehlermeldung - auch, wenn ich hier root eintrage.
Remark: Trying to get a group share up and running and I've had ZERO luck with any documentation or forum posts. :(
The code path exists since Bug #37081.
The exception happens when changing 'sambaWriteList' / 'univentionShareSambaWriteList' and the new or old values is empty. univention-directory-manager-modules (12.0.18-9): r82124 | Bug #45207: fix mapping of sambaWriteList in shares when the value is empty univention-directory-manager-modules.yaml: r82125 | YAML Bug #45207
OK no traceback. tested with: udm shares/share create --set name=bar --set host="master40.mydomain.intranet" --set path="/bar" udm shares/share modify --dn cn=bar,dc=mydomain,dc=intranet --set sambaWriteList=foo udm shares/share modify --dn cn=bar,dc=mydomain,dc=intranet --set sambaWriteList=newFoo udm shares/share modify --dn cn=bar,dc=mydomain,dc=intranet --remove sambaWriteList YAML: OK -> verified
Reported again, 4.2-1 errata133 (Lesum). Bitte nehmen Sie sich einen Augenblick Zeit, um die folgenden Informationen bereitzustellen: 1) Schritte, um den Fehler zu reproduzieren In einer Samba Freigabe ist unter Erweiterte Einstellungen -> Samba Rechte -> Schreibberechtigungen auf diese Benutzer/Gruppen beschränken gesetzt: @"Domain Users" Dies soll entfernt werden. 2) erwartetes Ergebnis Übernahme des leeren Parameters 3) beobachtetes Ergebnis Parameter wird nicht übernommen.
<http://errata.software-univention.de/ucs/4.2/140.html>
In Python, a string is a single-dimensional array of characters. The string index out of range means that the index you are trying to access does not exist. In a string, that means you're trying to get a character from the string at a given point. If that given point does not exist , then you will be trying to get a character that is not inside of the string. Indexes in Python programming start at 0. This means that the maximum index for any string will always be length-1. There are several ways to account for this. Knowing the length of your string (using len() function)could certainly help you to avoid going over the index. More: http://net-informations.com/python/err/range.htm