Bug 670151 - Traceback when adding user via ldap
Summary: Traceback when adding user via ldap
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libuser
Version: 6.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: rc
: ---
Assignee: Miloslav Trmač
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks: 670279
TreeView+ depends on / blocked
 
Reported: 2011-01-17 11:25 UTC by Miroslav Vadkerti
Modified: 2012-04-19 03:26 UTC (History)
3 users (show)

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.
Clone Of:
: 670279 (view as bug list)
Environment:
Last Closed: 2012-04-05 08:23:39 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0455 0 normal SHIPPED_LIVE libuser bug fix update 2012-04-05 12:22:00 UTC

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


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