Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 155402 - LDAP SASL/EXTERNAL requires ability to set empty conf values
Summary: LDAP SASL/EXTERNAL requires ability to set empty conf values
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: libuser
Version: 4.0
Hardware: All
OS: Linux
Target Milestone: ---
: ---
Assignee: Miloslav Trmač
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2005-04-19 23:47 UTC by Aaron Hope
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version: 0.53.6-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2005-04-25 07:54:21 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description Aaron Hope 2005-04-19 23:47:26 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050302 Firefox/1.0.1 Fedora/1.0.1-1.3.2

Description of problem:
The LDAP SASL/EXTERNAL authentication mechanism appears to require that the authzid/authcid be empty.  Since the libuser configuration parsing ignores lines with empty values, there is no way to authenticate with the EXTERNAL mechanism (e.g. SSL client certs or PF_UNIX peer credentials).  Ideally, it would be possible to specify the SASL mechanism in /etc/libuser.conf and behave appropriately, as the openldap utilities do.  At the least, it should be possible to specify an empty string for configuration values, either as an empty quoted string or by the absense of any value.

Our site currently uses custom-built rpm with the following patch:

diff -ru libuser-0.52.5/lib/config.c libuser-0.52.5.mod/lib/config.c
--- libuser-0.52.5/lib/config.c 2004-09-02 14:56:36.000000000 -0400
+++ libuser-0.52.5.mod/lib/config.c     2005-03-29 18:55:41.000000000 -0500
@@ -249,7 +249,7 @@

                /* If we have a valid line, */
                if (section && k && value &&
-                   strlen(section) && strlen(k) && strlen(value)) {
+                   strlen(section) && strlen(k)) {
                        /* format the section and key as a path and if the
                         * result matches the requested key, */
                        tmp = g_strconcat(section, "/", k, NULL);

Version-Release number of selected component (if applicable):
libuser-0.52.5-1, CVS as of 2005-04-19

How reproducible:

Steps to Reproduce:
1. Configure slapd for root peercred auth:
sasl-regexp     uidNumber=0\\+gidNumber=.*,cn=peercred,cn=external,cn=auth
# Minimum security strength for authentication. ldapi:// ssf is 71
sasl-secprops   minssf=71

2. Add "SASL_MECH EXTERNAL" to ~/.ldaprc
3. Add "user =" to /etc/libuser.conf


Actual Results:  libuser utilities (lchage -l) fail to authenticate

Expected Results:  invalid entries in /etc/libuser.conf should generate warnings and there needs to be some way of overriding default values with empty strings.

Additional info:

Comment 1 Miloslav Trmač 2005-04-25 07:54:21 UTC
Thanks, applied in rawhide libuser-0.53.6-1.

Unfortunately warnings about invalid config file are not really practical:
- for passwd and usermode the warnings should go to syslog; the user
  invoking passwd usually can't fix /etc/libuser.conf
- when libuser is used by non-root users (with custom config or when
  running the libuser testsuite), the messages should go to stderr
  because root doesn't care and the user using libuser can't get the
  syslog messages
- the natural place to choose the logging system is the config file :)

The libuser interface could be extended to allow the application to choose
(silent/stderr/syslog), but that won't fix the existing applications
linking with libuser.

Note You need to log in before you can comment on or make changes to this bug.