Your password expires today message

Gerald Carter cartegw at Eng.Auburn.EDU
Sat Jan 2 17:07:54 GMT 1999

Happy New Year (so I'm a little late...sorry).

I found the problem with the latest HEAD branch code where
logging into a NT machine in a Samba controlled domain
result in the message

	"Your password expires today.  Would you like to 
	change it?"

It really has to do with the 


variable.  During the process of locating the problem, there 
seems to be a problem in general dealing with times in the smb portion
of the passdb API.  Didn't look at the NIS+ or LDAP 
parts.  A simple solution is to set this field to 


(42 days is the NT default I think)

The lib/util_pwdb.c:pwdb_get_last_set_time() functionalways 
returns 0xffffffff for the time because the string pointer 
the password entry is not in the correct location.

If I remember right, a pointer contents can be changed 
in a function but not the location to which it is referring.  Obviously
this can be done internally to a 
function but the pointer address will not be changed after 
returning from the function.

lib/util_pwdb.c:pwdb_decode_acct_ctrl() interates through 
some characters in the password entry and then returns 
and the getsmbfilepwent() acts like the *p (the character
pointer to the password entry) has been changed.

So when it tries to check lib/util_pwdb.c:pwdb_get_last_set_time(),
the pointer is still sitting on the beginning of the account type
information (i.e. [U       ]).

So i have another question....Do the other account options for 
smbpasswd work.  Things like X (for no expire on password) and 
others.  I know 'D' does.

The whole point of the post is that I see the bug but was 
asking how to fix a solution into the larger picture.  

                            Gerald ( Jerry ) Carter	
Engineering Network Services                           Auburn University 
jerry at   

       "...a hundred billion castaways looking for a home."
                                  - Sting "Message in a Bottle" ( 1979 )

More information about the samba-technical mailing list