patch for account policy, min password age, on samba30a22

Jianliang Lu j.lu at tiesse.com
Mon Mar 24 17:06:19 GMT 2003


Hi,
I think that now the patch is in the right place. In the 
pdb_set_pass_change_now() of pdb_get_set.c: I have put also the 
AP_MIN_PASSWORD_AGE update.
Any comments are welcome.

Jianliang Lu
TieSse s.p.a.
Via Jervis, 60.  10015 Ivrea (To) - Italy
j.lu at tiesse.com
luj at libero.it
-------------- next part --------------
--- samba-3.0alpha22/source/passdb/pdb_get_set.c	Fri Mar 21 11:25:35 2003
+++ samba-3.0alpha22/source/passdb/pdb_get_set.c.fix	Fri Mar 21 11:25:27 2003
@@ -1064,6 +1064,7 @@
 BOOL pdb_set_pass_changed_now (SAM_ACCOUNT *sampass)
 {
 	uint32 expire;
+	uint32 min_age;
 
 	if (!sampass)
 		return False;
@@ -1082,6 +1083,16 @@
 			return False;
 	}
 	
+	if (!account_policy_get(AP_MIN_PASSWORD_AGE, &min_age) 
+	    || (min_age==(uint32)-1)) {
+		if (!pdb_set_pass_can_change_time (sampass, 0, PDB_CHANGED))
+			return False;
+	} else {
+		if (!pdb_set_pass_can_change_time (sampass, 
+						    pdb_get_pass_last_set_time(sampass)
+						    + min_age, PDB_CHANGED))
+			return False;
+	}
 	return True;
 }
 


More information about the samba-technical mailing list