Univention Bugzilla – Bug 41072
udm cli --remove doesn't work if spaces are in the key or value
Last modified: 2021-05-25 16:03:21 CEST
Having a shares/share object with the following attributes: univentionShareSambaCustomSetting: admin users = administrator join-backup univentionShareSambaCustomSetting: follow symlinks = yes The handler has this in self.info['sambaCustomSettings']: [['admin users', 'administrator join-backup'], ['follow symlinks', 'yes']] It's not possible to remove one of the value because they have spaces in their key. udm shares/share modify --dn "cn=Team-Folder,cn=shares,$ldap_base" --remove sambaCustomSettings='follow symlinks = yes' udm shares/share modify --dn "cn=Team-Folder,cn=shares,$ldap_base" --remove sambaCustomSettings='"follow symlinks = yes"' The syntax is a "complex" syntax so the code splits at '"' if present otherwise it splits at ' ' (which would be correct) but the problem is that there are spaces in the key name. The effective code calls: object.remove(['follow', 'symlinks', 'yes']) instead of: object.remove(['follow symlinks', 'yes']) A solution would be to use the syntax class for splitting?!
see also Ticket#2016041921000291
Experienced this today, too: > udm policies/registry modify --dn "cn=foo,cn=policies,ou=schule01,dc=example,dc=org" --remove 'registry="grub/ default Univention Corporate Server, with Linux 3.10.0-ucs139-amd64"' > test_val=['', 'grub/default', ' ', 'Univention Corporate Server, with Linux 3.10.0-ucs139-amd64', ''] > WARNING: cannot remove ['"grub/default"', '"Univention Corporate Server, with Linux 3.10.0-ucs139-amd64"'] from registry, value does not exist
*** This bug has been marked as a duplicate of bug 43562 ***
The bug is still present. eval "$(ucr shell)" udm shares/share create --set name=Team-Folder --position cn=shares,$ldap_base --set host=localhost --set path=/asdf/ --set sambaCustomSettings='"follow symlinks" "yes"' udm shares/share modify --dn "cn=Team-Folder,cn=shares,$ldap_base" --remove sambaCustomSettings='"follow symlinks" "yes"' test_val=['', 'follow symlinks', ' ', 'yes', ''] WARNING: cannot remove ['"follow symlinks"', '"yes"'] from sambaCustomSettings, value does not exist No modification: cn=Team-Folder,cn=shares,dc=school,dc=local *** This bug has been marked as a duplicate of bug 43286 ***
Added a test script: r80659 | Bug #41072: add 59_udm/14_remove_values_from_share_sambaCustomSettings
This also affected portal/entry:link and has therefor been fixed (Bug #51197). The test case has been enabled. univention-directory-manager-modules (15.0.9-1) f5b4f895bd1c | Bug #41072: fix removal of values with complex syntax ucs-test (7.0.22-11) r80659 | Bug #41072: add 59_udm/14_remove_values_from_share_sambaCustomSettings ucs-test (10.0.5-9) f5b4f895bd1c | Bug #41072: fix removal of values with complex syntax changelog-5.0-0.xml 9ab9fa746bcb | Changlog Bug #41072
Works great. Already used in univention-portal and univention-server-overview
UCS 5.0 has been released: https://docs.software-univention.de/release-notes-5.0-0-en.html https://docs.software-univention.de/release-notes-5.0-0-de.html If this error occurs again, please use "Clone This Bug".