Description of Problem: redhat-config-users fails to start, giving a traceback. Version-Release number of selected component (if applicable): redhat-config-users-1.1-16 How Reproducible: Not sure. Since entering #73370 I manually deleted a load of entries from /etc/passwd using vi; now it has stopped working. I'll attach my current /etc/passwd. Backtrace is: [root@host240 root]# redhat-config-users Traceback (most recent call last): File "/usr/share/redhat-config-users/redhat-config-users.py", line 36, in ? mainWindow.mainWindow() File "/usr/share/redhat-config-users/mainWindow.py", line 257, in __init__ self.refresh() File "/usr/share/redhat-config-users/mainWindow.py", line 422, in refresh self.refresh_users() File "/usr/share/redhat-config-users/mainWindow.py", line 331, in refresh_users gidNumber = userEnt.get(libuser.GIDNUMBER)[0] IndexError: list index out of range
I tried to debug this but got confused. I added: print "got user: %s" % userName before gidNumber = userEnt.get(libuser.GIDNUMBER)[0] in mainWindow.py, and it gives the backtrace after printing "got user: test" but I don't have a test user, but this is user I already deleted! [root@host240 root]# grep test /etc/passwd [root@host240 root]# grep test /etc/group is something caching the user IDs?
You probably have user 'test' in /etc/shadow and libuser is getting horribly confused. Is this the case?
Ah, yes, indeed. /etc/shadow has an entry for the 'test' user, but not /etc/passwd.
Does that fix the problem? If so, I've got a question for you because I've gotten a few reports about this. As the user, what would you expect the program to do in this situation? I can think of a few possibilities. 1) Automatically delete the orphaned line(s) from /etc/shadow. I don't like this because doing things behind the user's back with password files is a little dodgy. Also not good because what if the problem is more complicated than an orphaned line. What if the user added illegal characters in the file that breaks the parser? It's not clear what to do. 2) Pop up a dialog that says that the user database is corrupt and that the program will exit. I'm not crazy about this because it doesn't fix the problem with the user list, but it's almost impossible to figure out in what way the database is corrupt and fix it reliably. As of now, I'm leaning towards #2, but what do you think the user would expect in this situation?
Yes, sorry; removing the orphaned lines from /etc/shadow did fix the problem. I agree that (1) is definitely not a good solution; I think (2) would be okay. Maybe the ideal thing to do would be to display entries for the users with orphaned passwords along with the rest of the users in the main UI; allowing the admin to correct or remove them as necessary. If these broken users could be distinguished by greying them out or something, that would be neat.
I seem to have the won't start problem. If I try to start redhat-config-users in terminal I get /usr/share/redhat-config-users/redhat-config-users: line 4: 21883 Segmentation fault /usr/bin/python2.2 /usr/share/redhat-config-users/redhat-config-users. py
geydel, your problem seems unrelated to the original bug report. The original poster was seeing a python traceback while you are seeing a segmentation fault.
I experienced the same problem when running redhat-config-users - same traceback errors, same line numbers, etc. The applet worked right out of the box after the very first install. I thought the various errata updates were the cause of this problem. I think I've figured it out, at least why it seems broken on my system. I've made a _manual_ change to /etc/passwd. Specifically, I added a "#" in front of the 'ftp' user - this to prevent anonymous ftp logins. Out of a hunch, I removed the "#" and restarted the applet. Voila! I also tried just deleting the line that contains 'ftp'. redhat-config-users didn't like that. So, it would seem that this program can not parse /etc/passwd properly, or it is trying to associate this file with some other file on a line by line basis.
yuppiedrone, the problem is probably that you commented out the 'ftp' user in /etc/passwd but forgot to comment out the 'ftp' line in /etc/shadow. If you are using shadow passwords (which most machines do these days), then for each entry in /etc/passwd, there is a corresponding entry in /etc/shadow. As far as I know, libuser (the backend that redhat-config-users uses to parse the files) assumes that the data in /etc/passwd, /etc/shadow, and /etc/group is valid. There are an infinite number of ways to break a parser if you can feed it random data. I can try to pop up a dialog telling the user that the file can't be properly parsed, but trying to fix the file is undesirable, for reasons that I explain in item #1 from my 2002-10-01 post above.
The program should not traceback and should show warning window at least. Traceback is not acceptable in any way.
milan: I absolutely agree.
Created attachment 88692 [details] rh-config-users does not start New install RH 8.0 under Gnome does not start config-users from menu .No warnings or error messages , just some disk activity and then nothing . Started from terminal , following error message appears : root@LINUX root]# redhat-config-users > /usr/share/redhat-config-users/redhat-config-users: line 4: 1195 > Segmentation fault /usr/bin/python2.2 > /usr/share/redhat-config-users/redhat-config-users. > py Reinstalling redhat config users with rh network did not solve the problem .
*** Bug 80105 has been marked as a duplicate of this bug. ***
redhat-config-users-1.1.1-9 in Rawhide should address this problem. If the user database cannot be read for some reason, like if /etc/passwd and /etc/shadow are out of sync, the app pops up a dialog that says "The user database cannot be read. Program will exit now." I wish there were some way to magically repair the database, but that may not be possible depending on how messed up the files are. At least this way we notify the user that something has gone wrong and the program exits gracefully. Thanks for your report. QA, please verify. Leo, it looks like you are seeing a problem that is unrelated to this report.
Tested with "redhat-config-users-1.1.5-5" on Phoebe 8.0.93 : If "/etc/shadow" contains an (valid) entry that is not in "/etc/passwd", redhat-config-users will display the message : "The user database cannot be read. Program will exit now." If "/etc/passwd" contains an (valid) entry that is not in "/etc/shadow", redhat-config-users will start without error. If "/etc/passwd" contains an (invalid) entry (for example the string "banana"), the following error appears: ** (redhat-config-users.py:6163): WARNING **: entry is incorrectly formatted (redhat-config-users.py:6163): GLib-GObject-CRITICAL **: file gvaluearray.c: line 42 (g_value_array_get_nth): assertion `value_array != NULL' failed ** ERROR **: file user.c: line 658 (merge_ent_array_duplicates): should not be reached aborting... /usr/share/redhat-config-users/redhat-config-users: line 4: 6163 Afgebroken /usr/bin/python2.2 /usr/share/redhat-config-users/redhat-config-users.py If "/etc/shadow" contains an (invalid) entry (for example the string "banana"), the following error appears: ** (redhat-config-users.py:6173): WARNING **: entry is incorrectly formatted (redhat-config-users.py:6173): GLib-GObject-CRITICAL **: file gvaluearray.c: line 42 (g_value_array_get_nth): assertion `value_array != NULL' failed ** ERROR **: file user.c: line 658 (merge_ent_array_duplicates): should not be reached aborting... /usr/share/redhat-config-users/redhat-config-users: line 4: 6173 Afgebroken /usr/bin/python2.2 /usr/share/redhat-config-users/redhat-config-users.py
Described comments in comment #15 still occur with "redhat-config-users-1.1.5-7" on Red Hat Linux release 9 (Shrike). Furthermore, if "/etc/passwd" contains a valid entry not in "/etc/group" and "/etc/shadow", the following errors are returned to the shell: ** (redhat-config-users.py:27552): CRITICAL **: file user.c: line 245 (extract_id): assertion `array != NULL' failed ** (redhat-config-users.py:27552): CRITICAL **: file user.c: line 1100 (lu_dispatch): assertion `ldata != INVALID' failed
There is a stack of 64 bugs that have been in Modified state for a long period of time. I am closing these as Rawhide now. If you find that the issue is not fixed, please reopen this report.