Bug 38614 - sqlite: near "bar": syntax error
sqlite: near "bar": syntax error
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: S4 Connector
UCS 4.0
Other Linux
: P5 normal (vote)
: UCS 4.0-2-errata
Assigned To: Stefan Gohmann
Arvid Requate
:
Depends on:
Blocks: 38619 38704
  Show dependency treegraph
 
Reported: 2015-05-28 06:11 CEST by Stefan Gohmann
Modified: 2015-06-12 16:58 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
1.diff (610 bytes, patch)
2015-05-28 13:44 CEST, Arvid Requate
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2015-05-28 06:11:14 CEST
Ticket #2015052521000289

The connector is unable to synchronize users with a ' in the username. 

23.05.2015 02:09:05,52 LDAP        (INFO   ): _ignore_object: Do not ignore uid=foo'bar,dc=deadlock40,dc=intranet
23.05.2015 02:09:05,52 LDAP        (INFO   ): __sync_file_from_ucs: objected was added: uid=foo'bar,dc=deadlock40,dc=intranet
23.05.2015 02:09:05,53 LDAP        (INFO   ): _ignore_object: Do not ignore uid=foo'bar,dc=deadlock40,dc=intranet
23.05.2015 02:09:05,53 LDAP        (INFO   ): _object_mapping: map with key user and type ucs
23.05.2015 02:09:05,54 LDAP        (INFO   ): _dn_type ucs
23.05.2015 02:09:05,55 LDAP        (WARNING): sqlite: near "bar": syntax error
23.05.2015 02:09:05,55 LDAP        (WARNING): sqlite: near "bar": syntax error
23.05.2015 02:09:05,56 LDAP        (WARNING): sync failed, saved as rejected 
        /var/lib/univention-connector/s4/1432339740.806956
23.05.2015 02:09:05,56 LDAP        (WARNING): Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/univention/s4connector/__init__.py", line 988, in poll_ucs
    sync_successfull = self.__sync_file_from_ucs(filename, traceback_level=traceback_level)
  File "/usr/lib/pymodules/python2.7/univention/s4connector/__init__.py", line 796, in __sync_file_from_ucs
    object = self._object_mapping(key, object, 'ucs')
  File "/usr/lib/pymodules/python2.7/univention/s4connector/__init__.py", line 1700, in _object_mapping
    object[dntype] = self.dn_mapped_to_base(object[dntype], self.lo_s4.base)
  File "/usr/lib/pymodules/python2.7/univention/s4connector/__init__.py", line 448, in dn_mapped_to_base
    if dn.endswith(base):
AttributeError: 'NoneType' object has no attribute 'endswith'
Comment 1 Stefan Gohmann univentionstaff 2015-05-28 10:48:02 CEST
Code: r60890 + r60898
The SQLite Python API now makes the parameter substitution.

YAML: 2015-05-28-univention-s4-connector.yaml (r60900)

I've added two new test cases (r60899):
52_s4connector/031_sync_special_usernames_in_ucs
52_s4connector/032_sync_special_usernames_in_ad
Comment 2 Arvid Requate univentionstaff 2015-05-28 13:44:47 CEST
Created attachment 6927 [details]
1.diff

This fixes a quoting typo.

In commit r60890 I think encode_sql_option is not required? It's also not used in the second commit.
Comment 3 Stefan Gohmann univentionstaff 2015-05-28 13:55:39 CEST
(In reply to Arvid Requate from comment #2)
> Created attachment 6927 [details]
> 1.diff
> 
> This fixes a quoting typo.

Yes, thanks applied: r60908

> In commit r60890 I think encode_sql_option is not required? It's also not
> used in the second commit.

Yes, it was removed in the second commit. It was only a first try.
Comment 4 Arvid Requate univentionstaff 2015-05-28 14:56:07 CEST
Code review ok, ucs-test cases work and advisory is ok.
Comment 5 Janek Walkenhorst univentionstaff 2015-05-28 16:50:27 CEST
<http://errata.univention.de/ucs/4.0/204.html>