Bug 41835 - Improve univention-s4search to also work for normal users
Improve univention-s4search to also work for normal users
Status: RESOLVED WONTFIX
Product: UCS
Classification: Unclassified
Component: Samba4
UCS 4.1
Other Linux
: P5 enhancement (vote)
: ---
Assigned To: Samba maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-07-21 17:39 CEST by Arvid Requate
Modified: 2019-01-03 07:23 CET (History)
2 users (show)

See Also:
What kind of report is it?: Feature Request
What type of bug is this?: 2: Improvement: Would be a product improvement
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.011
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Usability
Max CVSS v3 score:
requate: Patch_Available+


Attachments
univention-s4search (3.02 KB, application/x-shellscript)
2016-07-21 17:39 CEST, Arvid Requate
Details
univention-s4search python version (5.58 KB, text/x-python)
2016-09-09 10:50 CEST, Lukas Oyen
Details
Updated Python univention-s4search which includes CN=Configuration (7.00 KB, text/x-python)
2016-12-14 18:03 CET, Lukas Oyen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Requate univentionstaff 2016-07-21 17:39:17 CEST
Created attachment 7824 [details]
univention-s4search

Currently univention-s4search doesn't work for users:

arequate@master:~$ /usr/sbin/univention-s4search 
/usr/sbin/univention-s4search: 30: /usr/sbin/univention-s4search: univention-config-registry: not found
Failed to connect to ldap URL 'ldaps://' - LDAP client internal error: NT_STATUS_INVALID_PARAMETER
Failed to connect to 'ldaps://' with backend 'ldaps': (null)
Failed to connect to ldaps:// - (null)



The attached version of that script

a) works for normal users
b) works with an existing kerberos ticket
c) is ugly shell code, especially the option parsing

Maybe we should rewrite this in Python some day. If we do so, the Python code should be able to output a shell line that can be used to debug the search with exactly the given parameters, in case the s4search itself fails.
Comment 1 Lukas Oyen univentionstaff 2016-09-09 10:50:01 CEST
Created attachment 7993 [details]
univention-s4search python version

Attached you'll find a python version of `univention-s4search`. This version also fixes bug 34156. It differs in some regards from the original version and in some regards from the attached version from Arvid.

Differences to the original:

1) Works for normal users.
2) Will append `--kerberos=no` to the arguments if no credentials were given and the user did not supply a value for `-k/--kerberos`.
3) Will no longer accept `-k/--kerberos`, `-A/--authentication-file`, `-P/--password`, `-U/--user` or `--simple-bind-dn` without an additional value as valid credentials.

Differences to Arvids' version:

4) The same as 3) with the addition, that `-U/--user` with the suffix `%<password>` is also counted as valid credentials (in addition to a given account).
5) `-k/--kerberos` with a value of `no` is no longer accepted as valid credentials.
6) Whenever a user is prompted for a password, a username will be shown.

Two additional thoughts:

a) There is no handling of `--no-pass` in either version.
b) Passing credentials as commmand-line arguments is inherently unsafe. These should be passed via stdin. But that would inhibit the output of a standalone ldbsearch debug command in case of secrets.ldb lookup.
Comment 2 Arvid Requate univentionstaff 2016-09-27 21:01:32 CEST
> a) There is no handling of `--no-pass` in either version.

That's ok
Comment 3 Arvid Requate univentionstaff 2016-12-08 15:08:23 CET
Feedback from Support: It would be cool to make univention-s4search also search below the cn=configuration branch by default (but not under cn=schema).
Comment 4 Lukas Oyen univentionstaff 2016-12-14 18:03:44 CET
Created attachment 8305 [details]
Updated Python univention-s4search which includes CN=Configuration
Comment 5 Stefan Gohmann univentionstaff 2019-01-03 07:23:08 CET
This issue has been filled against UCS 4.1. The maintenance with bug and security fixes for UCS 4.1 has ended on 5st of April 2018.

Customers still on UCS 4.1 are encouraged to update to UCS 4.3. Please contact
your partner or Univention for any questions.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.