Bug 827964 - /usr/share/system-config-users/userProperties.py aborts with an index out of range
/usr/share/system-config-users/userProperties.py aborts with an index out of ...
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: system-config-users (Show other bugs)
17
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Nils Philippsen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-03 19:00 EDT by Philippe Vouters
Modified: 2013-08-01 01:48 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-01 01:47:57 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Philippe Vouters 2012-06-03 19:00:23 EDT
Description of problem:
/usr/share/system-config-users/userProperties.py aborts with an index out of range

Version-Release number of selected component (if applicable):
libuser-python-0.57.6-1.fc17.i686
system-config-users-1.2.115-1.fc17.noarch

How reproducible:
Always

Steps to Reproduce:
1. Activate su -c /usr/share/system-config-users/system-config-users 
2. Select a user
3. Select its group
4. Click on OK
  
Actual results:
/usr/share/system-config-users/userProperties.py raises an IndexError

Expected results:
Returns to previous screen

Additional info:

Changing at lines 602 and 610 of /usr/share/system-config-users/userProperties.py the string 'self.userEnt.get(libuser.SHADOWLASTCHANGE)[0]' to 'self.userEnt.get(libuser.SHADOWLASTCHANGE,[0])' makes the problem run away.
Comment 1 Nils Philippsen 2012-06-04 11:57:50 EDT
Can you expand on the steps to reproduce? I don't know what exactly you mean with "select a user", "select its group". To debug this, I'd need the shadow entries of the user/group in question, with password hashes redacted. Please post the output of the following commands, run as root, replase USERNAME, GROUPNAME with the respective user and group names:

getent shadow USERNAME | sed 's/^\([^:]*\):[^:]*:\(.*\)$/\1:<password>:\2/g'
getent gshadow GROUPNAME | sed 's/^\([^:]*\):[^:]*:\(.*\)$/\1:<password>:\2/g'

Thanks!
Comment 2 Philippe Vouters 2012-06-04 12:21:09 EDT
Hoping this helps. Note that this disk is a constant upgrade from Fedora Core 4 to Fedora 17. Would it look like I am missing some RPMs ?

Yours truly,
Philippe

[philippe@victor Xmain]$ sudo getent passwd philippe | sed 's/^\([^:]*\):[^:]*:\(.*\)$/\1:Bois$Briard0\2/g'
philippe:Bois$Briard0500:0:Philippe Vouters:/home/philippe:/bin/bash
[philippe@victor Xmain]$ sudo getent shadow philippe | sed 's/^\([^:]*\):[^:]*:\(.*\)$/\1:Bois$Briard0\2/g'
[philippe@victor Xmain]$ 

[philippe@victor Xmain]$ getent group philippe | sed 's/^\([^:]*\):[^:]*:\(.*\)$/\1:Bois$Briard0:\2/g'
philippe:Bois$Briard0:500:
[philippe@victor Xmain]$ getent gshadow philippe | sed 's/^\([^:]*\):[^:]*:\(.*\)$/\1:Bois$Briard0:\2/g'
[philippe@victor Xmain]$ getent gshadow root | sed 's/^\([^:]*\):[^:]*:\(.*\)$/\1:Bois$Briard0:\2/g'
[philippe@victor Xmain]$ getent gshadow wireshark | sed 's/^\([^:]*\):[^:]*:\(.*\)$/\1:Bois$Briard0:\2/g'
[philippe@victor Xmain]$ getent group root | sed 's/^\([^:]*\):[^:]*:\(.*\)$/\1:Bois$Briard0:\2/g'
root:Bois$Briard0:0:root,guest,philippe
[philippe@victor Xmain]$ getent group wireshark | sed 's/^\([^:]*\):[^:]*:\(.*\)$/\1:Bois$Briard0:\2/g'
wireshark:Bois$Briard0:318:root
[philippe@victor Xmain]$ getent group wheel | sed 's/^\([^:]*\):[^:]*:\(.*\)$/\1:Bois$Briard0:\2/g'
wheel:Bois$Briard0:10:root
[philippe@victor Xmain]$
Comment 3 Philippe Vouters 2012-06-04 14:05:40 EDT
Alternatively lines 602 and 610 of /usr/share/system-config-users/userProperties.py could be programmed as:
            elif self.userEnt.get(libuser.SHADOWLASTCHANGE) and self.userEnt.get(libuser.SHADOWLASTCHANGE,)[0] == 0:
for line 602
and
            if self.userEnt.get(libuser.SHADOWLASTCHANGE) and self.userEnt.get(libuser.SHADOWLASTCHANGE)[0] == 0:
for line 610

Both the solution I proposed on 2012-06-03 19:00:23 EDT and this one make /usr/share/system-config-users/userProperties.py no longer abort due to an Index out of range.

For your information : a print >> sys.stderr, self.userEnt.get(libuser.SHADOWLASTCHANGE) returns [] on my FC17 system whereas
print >> sys.stderr, self.userEnt.get(libuser.SHADOWLASTCHANGE,[0]) returns [0]
Comment 4 Philippe Vouters 2012-06-04 15:33:38 EDT
I had the following files:
[philippe@victor Xmain]$ ls /etc/*shadow*
/etc/gshadow-  /etc/shadow-
I did the following:
[philippe@victor Xmain]$ sudo rm /etc/*shadow*
[philippe@victor Xmain]$ sudo pwconv
[philippe@victor Xmain]$ sudo grpconv
[philippe@victor Xmain]$ ls /etc/*shadow*
/etc/gshadow  /etc/shadow
Comment 5 Philippe Vouters 2012-06-04 17:07:37 EDT
Now I have the following files:
[philippe@victor ~]$ ls /etc/*shadow*
/etc/gshadow  /etc/gshadow-  /etc/shadow  /etc/shadow-
I yum removed system-config-users and reinstalled it. Now things work as expected.
Between 2012-06-04 15:33:38 EDT and now I lost all passwords. I had to boot a Fedora 14 disk and chroot from it to use passwd to reset root's and my password.
I gess I should rather have done:
su -c 'cp /etc/shadow- /etc/shadow' and su -c 'cp /etc/gshadow- /etc/gshadow'

So the problem lies when there is no /etc/*shadow. A problem with Fedora kitting ???
The problem may perhaps be closed. It has to be advertised for any system-config-users users experiencing a /usr/share/system-config-users/userProperties.py abort with an Index out of range. This is only caused by no /etc/*shadow files.
Comment 6 Fedora End Of Life 2013-07-03 21:25:04 EDT
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 7 Fedora End Of Life 2013-08-01 01:48:01 EDT
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

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