Bug 30222 - Quoting bug in univention-run-join-scripts when joining with minor-privileged user
Quoting bug in univention-run-join-scripts when joining with minor-privileged...
Status: RESOLVED DUPLICATE of bug 32005
Product: UCS
Classification: Unclassified
Component: Join (univention-join)
UCS 4.2
Other Linux
: P5 minor (vote)
: ---
Assigned To: UCS maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-31 12:05 CET by Arvid Requate
Modified: 2020-07-06 19:08 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 1: Cosmetic issue or missing function but workaround exists
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 1: Nuisance – not a big deal but noticeable
User Pain: 0.006
Enterprise Customer affected?: Yes
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:
requate: Patch_Available+


Attachments
patch for univention-run-join-scripts (deleted)
2013-01-31 12:06 CET, Arvid Requate
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Requate univentionstaff 2013-01-31 12:05:55 CET
When running univention-run-join-scripts a consmetic error occurs:

Search LDAP binddn bash: -c: Zeile 0: Syntaxfehler beim unerwarteten Wort `('
bash: -c: Zeile 0: `ldapsearch -x LLL -H ldapi:/// (&(uid=joinuser-28g03)(objectClass=person)) dn'
                   done

Join succeeds anyway as the specific buggy univention-ssh call is not going to succeed anyway in this specific case.
Comment 1 Arvid Requate univentionstaff 2013-01-31 12:06:24 CET
Created attachment 5028 [details]
patch for univention-run-join-scripts
Comment 2 Stefan Gohmann univentionstaff 2017-06-16 20:38:41 CEST
This issue has been filed against UCS 3. UCS 3 is out of the normal maintenance and many UCS components have vastly changed in UCS 4.

If this issue is still valid, please change the version to a newer UCS version otherwise this issue will be automatically closed in the next weeks.
Comment 3 Florian Best univentionstaff 2017-06-28 14:52:06 CEST
There is a Customer ID set so I set the flag "Enterprise Customer affected".
Comment 4 Florian Best univentionstaff 2020-06-22 15:40:21 CEST
(In reply to Arvid Requate from comment #1)
> Created attachment 5028 [details]
> patch for univention-run-join-scripts

the patch is empty :-/

Still relevant?
Comment 5 Ingo Steuwer univentionstaff 2020-07-03 20:51:02 CEST
This issue has been filed against UCS 4.2.

UCS 4.2 is out of maintenance and many UCS components have changed in later releases. Thus, this issue is now being closed.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen it and update the UCS version. In this case please provide detailed information on how this issue is affecting you.
Comment 6 Philipp Hahn univentionstaff 2020-07-04 07:04:17 CEST
(In reply to Florian Best from comment #4)
> (In reply to Arvid Requate from comment #1)
> > Created attachment 5028 [details]
> > patch for univention-run-join-scripts
> 
> the patch is empty :-/
> 
> Still relevant?

I think the problem was already fixed with git:2c5ed2d12af by inserting "--no-split" for "univention-ssh":

 76 -»··»···binddn="$(univention-ssh "$DCPWD" "$DCACCOUNT"@"$ldap_master" \
 77 -»··»···»···ldapsearch -x LLL -H ldapi:/// "(&(uid=$DCACCOUNT)(objectClass=person))" dn | ldapsearch-decode64 | sed -ne 's|^dn: |    |p;s|^DN: ||p')"
 78 +»··»···binddn=($(univention-ssh --no-split "$DCPWD" "$DCACCOUNT"@"$ldap_master" \                                               
 79 +»··»···»···ldapsearch -x -LLL -H ldapi:/// "'(&(uid=$DCACCOUNT)(objectClass=person))'" dn |                                     
 80 +»··»···»···ldapsearch-wrapper |
 81 +»··»···»···ldapsearch-decode64 | 
 82 +»··»···»···sed -ne 's|^dn: ||p'))

Without that the code would go through two rounds of shell-eval, which removes too many quotation and then leads to the original problem, where code is executed von the server.

Another problem here is that this is shell code, which lacks proper escaping functions for LDAP filters.
Comment 7 Arvid Requate univentionstaff 2020-07-06 19:08:41 CEST

*** This bug has been marked as a duplicate of bug 32005 ***