Bug 18499 - LDAP_Search Syntax via UCR verwenden
LDAP_Search Syntax via UCR verwenden
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 2.3
Other Linux
: P5 normal (vote)
: UCS 2.4
Assigned To: Stefan Gohmann
Sönke Schwardt-Krummrich
:
: 19427 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-27 11:46 CEST by Stefan Gohmann
Modified: 2010-08-31 13:22 CEST (History)
3 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
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 Stefan Gohmann univentionstaff 2010-05-27 11:46:06 CEST
Es ist derzeit nicht möglich eine LDAP_Search Syntax zu verwenden, wenn das Attribut per UCR gesetzt wird.

Bspw.:

root@qamaster:~# ldapsearch -x cn=thinClientAutostart -LLL  | ldapsearch-wrapper
dn: cn=thinClientAutostart,cn=Thin Client,cn=custom attributes,cn=univention,dc=univention,dc=qa
univentionSyntaxLDAPFilter: objectClass=univentionThinClientAutostart
objectClass: top
objectClass: univentionSyntax
univentionSyntaxLDAPAttribute: univentionThinClientAutostartName
univentionSyntaxViewOnly: FALSE
univentionSyntaxLDAPValue: univentionThinClientAutostartCommand
cn: thinClientAutostart


ucr set directory/manager/web/modules/policies/autostart/properties/autostartScript/syntax=thinClientAutostart
Comment 1 Stefan Gohmann univentionstaff 2010-05-27 13:40:07 CEST
fixed
Comment 2 Stefan Gohmann univentionstaff 2010-05-27 15:00:50 CEST
Es gibt noch ein Problem wenn die die Richtlinie direkt am Objekt bearbeitet wird:

Traceback (most recent call last):
File "/usr/share/univention-webui/modules/requests.py", line 262, in run_request self.dialog.init(got_input, self.xmlin, self.xmlin.documentElement)
File "./unidialog.py", line 63, in init uniconf.init(self,a,b,c)
File "/usr/share/univention-webui/modules/uniconf.py", line 183, in init obj.init(input,xmlob,self.find_id(node,obj.id))
File "/usr/share/univention-webui/modules/uniconf.py", line 162, in init self.myinit()
File "/usr/share/univention-directory-manager/uniconf/modedit.py", line 4750, in myinit filter = property._replace( property.syntax.filter, self.object )
AttributeError: LDAP_Search instance has no attribute 'filter'
Comment 3 Stefan Gohmann univentionstaff 2010-07-23 07:35:33 CEST
Ist mittlerweile angepasst.
Comment 4 Felix Botner univentionstaff 2010-08-11 16:26:14 CEST
Die UCR Vorgabe für die Syntax von UDM Attributen klappt i.M. nicht. Z.B wird für die private Adresse trotz

-> ucr get directory/manager/web/modules/users/user/properties/homePostalAddress/syntax
postalAddress

nicht die komplexe Syntax verwendet.

Im log file sieht man:
08.07.10 17:06:35  ADMIN       ( ERROR   ) : ucr_overwrite_properties: failed to set property attribute: string instance has no __call__ method

Wenn ich den try expect Block aus admin/__init__.py entferne, gibt es folgenden Traceback:

Traceback (most recent call last):
  File "/usr/share/univention-directory-manager-tools/univention-cli-server", line 233, in doit
    output = univention.admincli.admin.doit(arglist)
  File "/usr/lib/python2.4/site-packages/univention/admincli/admin.py", line 553, in doit
    univention.admin.modules.init(lo,position,module)
  File "/usr/lib/python2.4/site-packages/univention/admin/modules.py", line 90, in init
    univention.admin.ucr_overwrite_properties( module, lo )
  File "/usr/lib/python2.4/site-packages/univention/admin/__init__.py", line 76, in ucr_overwrite_properties
    setattr( module.property_descriptions[ prop ], attr, syntax() )
AttributeError: string instance has no __call__ method

Ich vermute es hat etwas hiermit zu tun.

if attr in ( 'syntax', ):
    ...
    if hasattr(univention.admin.syntax, baseConfig[ var ]) and False:
        syntax = getattr( univention.admin.syntax, baseConfig[ var ] )
        setattr( module.property_descriptions[ prop ], attr, syntax() )
    else:
        if lo.search( filter = uni

Per UCR habe ich ja eine syntax definiert. Aber in den if zweig kommt er wegen "and False" wohl nie.
Comment 5 Stefan Gohmann univentionstaff 2010-08-11 22:09:03 CEST
(In reply to comment #4)
> Die UCR Vorgabe für die Syntax von UDM Attributen klappt i.M. nicht. Z.B wird
> für die private Adresse trotz
> 
> -> ucr get
> directory/manager/web/modules/users/user/properties/homePostalAddress/syntax
> postalAddress
> 
> nicht die komplexe Syntax verwendet.
> 
> Im log file sieht man:
> 08.07.10 17:06:35  ADMIN       ( ERROR   ) : ucr_overwrite_properties: failed
> to set property attribute: string instance has no __call__ method
> 
> Wenn ich den try expect Block aus admin/__init__.py entferne, gibt es folgenden
> Traceback:
> 
> Traceback (most recent call last):
>   File "/usr/share/univention-directory-manager-tools/univention-cli-server",
> line 233, in doit
>     output = univention.admincli.admin.doit(arglist)
>   File "/usr/lib/python2.4/site-packages/univention/admincli/admin.py", line
> 553, in doit
>     univention.admin.modules.init(lo,position,module)
>   File "/usr/lib/python2.4/site-packages/univention/admin/modules.py", line 90,
> in init
>     univention.admin.ucr_overwrite_properties( module, lo )
>   File "/usr/lib/python2.4/site-packages/univention/admin/__init__.py", line
> 76, in ucr_overwrite_properties
>     setattr( module.property_descriptions[ prop ], attr, syntax() )
> AttributeError: string instance has no __call__ method
> 
> Ich vermute es hat etwas hiermit zu tun.
> 
> if attr in ( 'syntax', ):
>     ...
>     if hasattr(univention.admin.syntax, baseConfig[ var ]) and False:
>         syntax = getattr( univention.admin.syntax, baseConfig[ var ] )
>         setattr( module.property_descriptions[ prop ], attr, syntax() )
>     else:
>         if lo.search( filter = uni
> 
> Per UCR habe ich ja eine syntax definiert. Aber in den if zweig kommt er wegen
> "and False" wohl nie.

Ist angepasst.
Comment 6 Roman Asendorf univentionstaff 2010-08-13 08:49:42 CEST
*** Bug 19427 has been marked as a duplicate of this bug. ***
Comment 7 Sönke Schwardt-Krummrich univentionstaff 2010-08-17 17:54:27 CEST
Funktioniert. Das Überschreiben der Syntax für eine Property mit einer im LDAP definierten LDAPSearch-Syntax funktioniert sowohl bei "normalen" Properties als auch bei solchen, die über eine Policy an das Objekt vererbt werden.

Changelogeintrag ist vorhanden.
Comment 8 Stefan Gohmann univentionstaff 2010-08-31 13:22:07 CEST
UCS 2.4 wurde veröffentlicht. Sollte der hier beschriebene Bug mit einer
neueren Version von UCS erneut auftreten, so sollte der Bug dupliziert werden:
"Clone This Bug".