Bug 100524

Summary: python bindings don't seem to reflect state of /etc/shadow
Product: [Retired] Red Hat Linux Beta Reporter: Brent Fox <bfox>
Component: libuserAssignee: Miloslav Trmač <mitr>
Status: CLOSED DEFERRED QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: beta1   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-09-02 15:56:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 91452    
Bug Blocks: 100644    

Description Brent Fox 2003-07-23 05:23:26 UTC
When I look at /etc/shadow for user 'foo5', I see:

foo5:$1$MSb8h9vt$0lrtXx9e1BFBD1hrUwSaa/:12256::99999::::

but when I run the following Python program: 

#!/usr/bin/python2.2
import libuser

admin = libuser.admin()
userEnt = admin.lookupUserByName('foo5')

print "min is", userEnt.get(libuser.SHADOWMIN)
print "warning is", userEnt.get(libuser.SHADOWWARNING)
print "inactive is", userEnt.get(libuser.SHADOWINACTIVE)
print "max is", userEnt.get(libuser.SHADOWMAX)

I see:
min is [0L]
warning is [7L]
inactive is [-1L]
max is [99999L]


Aside from the SHADOWMAX, the values don't seem to be in line with what's in
/etc/shadow.  Any idea why this is?

Comment 1 Miloslav Trmač 2004-09-02 15:56:18 UTC
libuser is making the values up if the fields are empty.
(glibc makes up "-1" in all of these cases).

AFAICS it makes no difference if you want to enforce the limits,
at least until year 2243. The only difference is in the warning
treatment.

Changing this now would break current s-c-users behavior,
so let's keep it as it is, until the next development cycle
at minimum.