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

Summary: LDAP SASL/EXTERNAL requires ability to set empty conf values
Product: Red Hat Enterprise Linux 4 Reporter: Aaron Hope <edh+bugzilla>
Component: libuserAssignee: Miloslav Trmač <mitr>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: 0.53.6-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-04-25 07:54:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

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.