Univention Bugzilla – Bug 29680
remove of last group member leads to an empty uniqueMember attribute
Last modified: 2013-11-19 06:42:44 CET
Folgende Schritte sind unternommen worden: Samba-Gruppe angelegt Samba-Computer angelegt mit dieser Gruppe als primärer Aus der Samba-Gruppe diesen Computer aus "enthaltene Computer" gelöscht Jetzt gibt ein udm/get u.a. das zurück: "users": [""] Das macht einen Eintrag in "enthaltene Benutzer". Und zwar einen leeren (d.h. CheckBox ist da, Name fehlt). root@master:~# univention-ldapsearch -LLL cn=mygroup dn: cn=mygroup,cn=groups,dc=dirk,dc=ucs31,dc=qa sambaGroupType: 2 cn: mygroup objectClass: top objectClass: posixGroup objectClass: univentionGroup objectClass: sambaGroupMapping objectClass: univentionObject univentionObjectType: groups/group gidNumber: 8039 sambaSID: S-1-4-8039 uniqueMember: Es _könnte_ sich um Bug #13946 handeln.
Die Primary Group ist eine eigene Eigenschaft für sich, weitere Gruppen sind über die Eigenschaft "groups" gespeichert. root@master55:~# udm users/user list --filter uid=testuser | grep -e DN -e group DN: uid=testuser,cn=users,dc=ucs31,dc=qa groups: cn=Domain Users,cn=groups,dc=ucs31,dc=qa primaryGroup: cn=testgroup,cn=groups,dc=ucs31,dc=qa Das Herauslöschen eines Mitgliedes einer Gruppe wirkt sich nicht auf seine Primary Group aus.
(In reply to comment #1) > Die Primary Group ist eine eigene Eigenschaft für sich, weitere Gruppen sind > über die Eigenschaft "groups" gespeichert. > Das Herauslöschen eines Mitgliedes einer Gruppe wirkt sich nicht auf seine > Primary Group aus. Das ist doch aber gar nicht das Problem. Das Problem ist, dass bei udm/get für die Gruppe auf einmal "users": [""] zurückgegeben wird, obwohl die Gruppe gar keine Benutzer hat (und schon gar keinen mit leerem Namen). Nachzustellen, indem man einen Computer wieder aus "enthaltene Computer" löscht. Tatsächlich bleibt in diesem Fall die Primary Group des Rechners auf "mygroup". Das kann auch nicht ganz korrekt sein.
(In reply to comment #2) > Das ist doch aber gar nicht das Problem. Das Problem ist, dass bei udm/get für > die Gruppe auf einmal "users": [""] zurückgegeben wird, obwohl die Gruppe gar > keine Benutzer hat (und schon gar keinen mit leerem Namen). Nachzustellen, > indem man einen Computer wieder aus "enthaltene Computer" löscht. Ok, das hatte ich missverstanden. [""] ist wahrscheinlich noch ein Relikt aus UDM < 3.0, wo leere Listen häufiger so zurückgegeben wurden.
*** Bug 30265 has been marked as a duplicate of this bug. ***
Siehe Screenshot aus Bug#30265
The Bug has been reported by a customer (2013090621001846) and is more generic: After removing the last group member (independent of its type) using UMC an empty uniqueMember attribute is left, in the example I removed the last user in the group: ----------------- # testgruppe, groups, dhcptest.local dn: cn=testgruppe,cn=groups,dc=dhcptest,dc=local sambaGroupType: 2 cn: testgruppe objectClass: top objectClass: posixGroup objectClass: univentionGroup objectClass: sambaGroupMapping objectClass: univentionObject univentionObjectType: groups/group gidNumber: 5037 sambaSID: S-1-5-21-1139408302-3084351321-3475345008-1115 uniqueMember: ----------------- This is displayed as an "empty" user-membership in UMC. Removing the Member using UDM commandline the attribute uniqueMember fully removed, the bug only occures using the UMC module.
(In reply to Ingo Steuwer from comment #6) > The Bug has been reported by a customer (2013090621001846) and is more > generic: > > After removing the last group member (independent of its type) using UMC an > empty uniqueMember attribute is left, in the example I removed the last user > in the group: Something similar happens, if the last IP address gets removed from a windows client (other computer type have not been tested yet): an empty aRecord attribute remains. ---[cut]--- dn: cn=foobar,cn=computers,dc=example,dc=com univentionServerRole: windows_client displayName: foobar cn: foobar objectClass: top objectClass: person objectClass: univentionHost [...] uid: foobar$ gidNumber: 1005 aRecord: ---[cut]---
I would vote for completely removing any [""] for empty multi values. Do we know in advance whether this could this harm any other code parts in UDM?
Changed the default for MULTI-VALUE properties to [], not [''] in univention-directory-manager-modules 9.0.52-1.1111.201310091658 [''] is used throughout UDM, but mostly when working with raw ldap data. I hope this patch does not break anything. At least the test results are the same with and without the patch. This either means my patch is fine or we have weak code coverage. Or both.
Hmm, there are about 200 things which rely on this(!?!): >>> c = univention.uldap.getMachineConnection() >>> g=univention.admin.handlers.groups.group.lookup(None, c, 'cn=noobs')[0] >>> g.open() >>> g.get('users', ['']) [] >>> g.get('users', [''])[0] Traceback (most recent call last): File "<stdin>", line 1, in <module> IndexError: list index out of range $ cd ~/svn/dev/branches/ucs-3.2/ucs-3.2-0 $ ack "\['']"
(In reply to Florian Best from comment #10) > Hmm, there are about 200 things which rely on this(!?!): > > >>> c = univention.uldap.getMachineConnection() > >>> g=univention.admin.handlers.groups.group.lookup(None, c, 'cn=noobs')[0] > >>> g.open() > >>> g.get('users', ['']) > [] > >>> g.get('users', [''])[0] > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > IndexError: list index out of range > > $ cd ~/svn/dev/branches/ucs-3.2/ucs-3.2-0 > $ ack "\['']" no, they are all either no multivalue fields or a check "if not value" is done.
seems to work, no problems detected. Changelog OK
Code-review: * oxse4ucs OK * zarafa4ucs OK * asterisk4ucs OK
UCS 3.2 has been released: http://docs.univention.de/release-notes-3.2-en.html http://docs.univention.de/release-notes-3.2-de.html If this error occurs again, please use "Clone This Bug".