usermod -p

Peter Vrabec <[email protected]> Tue, 9 Aug 2005 14:52:02 +0000 (UTC)
Newsgroups gmane.linux.pld.shadow.general
Message-ID <[email protected]>
Hi,

the password in the shadow file can be changed by using the usermod 
command with the -p switch

usermod -p <encrypted password> <username>

However this does not change the password last changed field in the
shadow file.
shadow-lstchg.patch (text/x-patch, 333 B)
--- shadow/src/usermod.c.lstchg	2005-08-10 16:09:43.000000000 +0000
+++ shadow/src/usermod.c	2005-08-10 16:12:56.000000000 +0000
@@ -389,6 +389,8 @@
 		spent->sp_expire = user_expire;
 	}
 	spent->sp_pwdp = new_pw_passwd (spent->sp_pwdp, spent->sp_namp);
+        if(pflg)
+		spent->sp_lstchg = time ((time_t *) 0) / SCALE;
 }
 
 /*