Bug 33583 - ldapsearch result truncated if DN is longer than LDIF line wrap length
ldapsearch result truncated if DN is longer than LDIF line wrap length
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Samba4
UCS 3.2
Other Linux
: P5 normal (vote)
: UCS 3.2-0-errata
Assigned To: Felix Botner
Arvid Requate
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-27 09:58 CET by Frank Greif
Modified: 2013-12-12 11:30 CET (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
patch additional lines (3.09 KB, patch)
2013-12-09 16:32 CET, Arvid Requate
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Greif 2013-11-27 09:58:59 CET
Seen in /usr/lib/univention-install/96univention-samba4.inst lines #500 and #594: a DN is retrieved by ldapsearch or univention-ldapsearch and a pipe into sed:

group_dn="$(univention-ldapsearch -x "(&(objectClass=univentionGroup)(cn=$name))" | sed -ne 's|dn: ||p')"

If the given dn (with the 'dn: ' prefix) exceeds the builtin line wrap length the result doesn't contain the leftover chars of the continuation line.

Reference: Ticket#2013112121006746

Expected behavior:
DNs of arbitrary length will be properly retrieved

Short solution:
in this one script, add

-o ldif-wrap=no

to the given (univention-)ldapsearch lines

Long solution (proposal):
incorporate the argument into univention-ldapsearch by default, would cure other occurrences too.
Comment 1 Frank Greif 2013-11-27 10:07:40 CET
Sorry, forgot to set version number.
Comment 2 Florian Best univentionstaff 2013-11-27 11:22:44 CET
(In reply to Frank Greif from comment #0)
> Short solution:
> in this one script, add
> 
> -o ldif-wrap=no
> 
> to the given (univention-)ldapsearch lines
Propably missing "| ldapsearch-wrapper".


group_dn="$(univention-ldapsearch -x "(&(objectClass=univentionGroup)(cn=$name))" | sed -ne 's|dn: ||p')"
→
group_dn="$(univention-ldapsearch -x "(&(objectClass=univentionGroup)(cn=$name))" | ldapsearch-wrapper | sed -ne 's|dn: ||p')"
Comment 3 Stefan Gohmann univentionstaff 2013-11-27 21:29:23 CET
Should be fixed with the next univention-samba4 erratum.
Comment 4 Felix Botner univentionstaff 2013-12-06 11:18:45 CET
univention-samba4: 3.0.39-7.563.201312061111
YAML: 2013-11-20-univention-samba4.yaml

ldapsearch-wrapper has been added to univention-ldapsearch calls
in samba4 related setup scripts to prevent line wrapping of 
search results.
Comment 5 Arvid Requate univentionstaff 2013-12-09 16:32:52 CET
Created attachment 5690 [details]
patch additional lines

Maybe fix those as well? They are non-critical but this makes things consistent.
Comment 6 Felix Botner univentionstaff 2013-12-09 17:06:38 CET
(In reply to Arvid Requate from comment #5)
> Created attachment 5690 [details]
> patch additional lines
> 
> Maybe fix those as well? They are non-critical but this makes things
> consistent.

done
Comment 7 Arvid Requate univentionstaff 2013-12-10 19:43:28 CET
Verified:
 * All ldapsearches in the package are fixed.
 * Advisory OK
Comment 8 Moritz Muehlenhoff univentionstaff 2013-12-12 11:30:01 CET
http://errata.univention.de/ucs/3.2/6.html