Bug 670151

Summary: Traceback when adding user via ldap
Product: Red Hat Enterprise Linux 6 Reporter: Miroslav Vadkerti <mvadkert>
Component: libuserAssignee: Miloslav Trmač <mitr>
Status: CLOSED ERRATA QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: low Docs Contact:
Priority: medium    
Version: 6.0CC: dspurek, mitr, pvrabec
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
When creating a user account in Lightweight Directory Access Protocol (LDAP), the libuser library used the value of the "gecos" attribute as the default value of the "cn" attribute. When the "gecos" attribute was empty, this made the value of "cn" invalid, and the creation of the user account failed. With this update, the user name of the account is stored in the "cn" attribute if the "gecos" attribute is empty, thus allowing successful creation of the user account.
Story Points: ---
Clone Of:
: 670279 (view as bug list) Environment:
Last Closed: 2012-04-05 08:23:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 670279    

Description Miroslav Vadkerti 2011-01-17 11:25:28 UTC
Description of problem:
I have problems adding a user via system-config-users when libuser is configured to use ldap (in my case only ldap module is enabled):

# system-config-users 
Gtk-Message: Failed to load module "pk-gtk-module": libpk-gtk-module.so: cannot open shared object file: No such file or directory

(system-config-users.py:15798): Gdk-WARNING **: DESKTOP_STARTUP_ID contains invalid UTF-8
LDAP Server Name [ldap://127.0.0.1]: 
LDAP Search Base DN [dc=rhts,dc=redhat,dc=com]: 
LDAP Bind DN [cn=Manager,dc=rhts,dc=redhat,dc=com]: 
LDAP Bind Password: 
Traceback (most recent call last):
  File "/usr/share/system-config-users/userWindow.py", line 408, in on_userWin_ok_button_clicked
    self.parent.ADMIN.addUser(userEnt, mkhomedir = True)
RuntimeError: error creating a LDAP directory entry: Invalid syntax

Version-Release number of selected component (if applicable):
system-config-users-1.2.104-1.el6.noarch

How reproducible:
100%

Steps to Reproduce:
1. Configure ldap server and libuser.conf to use it
2. start system-config-users
3. Try to add a user
  
Actual results:
Traceback - see description

Expected results:
No traceback

Additional info:
Adding user works without issues using luseradd

Comment 1 Miloslav Trmač 2011-01-20 13:20:33 UTC
This is actually a bug in libuser.

As a workaround, you can fill in any value in the "real name" ("gecos") field.

In LDAP, gecos is an IA5String which allows empty strings, and "commonName" is a DirectoryString which does not allow empty strings.  libuser automatically initializes commonName from gecos if commonName is not provided by the application, but it does not handle the case when gecos is empty.

Comment 3 RHEL Program Management 2011-01-20 13:28:18 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 4 RHEL Program Management 2011-07-05 23:57:51 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 7 Eliska Slobodova 2012-02-16 15:43:33 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
When creating a user account in Lightweight Directory Access Protocol (LDAP), the libuser library used the value of the "gecos" attribute as the default value of the "cn" attribute. When the "gecos" attribute was empty, this made the value of "cn" invalid, and the creation of the user account failed. With this update, the user name of the account is stored in the "cn" attribute if the "gecos" attribute is empty, thus allowing successful creation of the user account.

Comment 9 errata-xmlrpc 2012-04-05 08:23:39 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0455.html