[SCM] Samba Shared Repository - branch master updated - 8b618d0ba997a9b2254ae2ea530a80dd14631d59

Volker Lendecke vlendec at samba.org
Sun Jan 18 12:27:02 GMT 2009


The branch, master has been updated
       via  8b618d0ba997a9b2254ae2ea530a80dd14631d59 (commit)
      from  44ae09b82e509db390ad4e884ae3310a3508cf46 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 8b618d0ba997a9b2254ae2ea530a80dd14631d59
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jan 18 13:15:23 2009 +0100

    Fix some real bugs found by "type-punned" gcc warnings
    
    Type-casting does not the right thing if used the way it used to be. The
    function arguments have not been uint32_t's, but the type cast made the calling
    routine believe so. Not good...
    
    The assignment xxx=account_policy_temp does however type-convert properly,
    potentially cutting off the top-bits.

-----------------------------------------------------------------------

Summary of changes:
 source3/rpc_server/srv_samr_nt.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index 9984bf0..5f616ec 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -1918,6 +1918,7 @@ NTSTATUS _samr_ChangePasswordUser3(pipes_struct *p,
 	uint32 reject_reason;
 	struct samr_DomInfo1 *dominfo = NULL;
 	struct samr_ChangeReject *reject = NULL;
+	uint32_t tmp;
 
 	DEBUG(5,("_samr_ChangePasswordUser3: %d\n", __LINE__));
 
@@ -1967,11 +1968,11 @@ NTSTATUS _samr_ChangePasswordUser3(pipes_struct *p,
 
 		/* AS ROOT !!! */
 
-		pdb_get_account_policy(AP_MIN_PASSWORD_LEN,
-				       (uint32_t *)&dominfo->min_password_length);
+		pdb_get_account_policy(AP_MIN_PASSWORD_LEN, &tmp);
+		dominfo->min_password_length = tmp;
 
-		pdb_get_account_policy(AP_PASSWORD_HISTORY,
-				       (uint32_t *)&dominfo->password_history_length);
+		pdb_get_account_policy(AP_PASSWORD_HISTORY, &tmp);
+		dominfo->password_history_length = tmp;
 
 		pdb_get_account_policy(AP_USER_MUST_LOGON_TO_CHG_PASS,
 				       &dominfo->password_properties);
@@ -2833,10 +2834,11 @@ NTSTATUS _samr_QueryDomainInfo(pipes_struct *p,
 			/* AS ROOT !!! */
 
 			pdb_get_account_policy(AP_MIN_PASSWORD_LEN,
-			       (uint32_t *)&dom_info->info1.min_password_length);
+					       &account_policy_temp);
+			dom_info->info1.min_password_length = account_policy_temp;
 
-			pdb_get_account_policy(AP_PASSWORD_HISTORY,
-				(uint32_t *)&dom_info->info1.password_history_length);
+			pdb_get_account_policy(AP_PASSWORD_HISTORY, &account_policy_temp);
+			dom_info->info1.password_history_length = account_policy_temp;
 
 			pdb_get_account_policy(AP_USER_MUST_LOGON_TO_CHG_PASS,
 				&dom_info->info1.password_properties);
@@ -2965,7 +2967,8 @@ NTSTATUS _samr_QueryDomainInfo(pipes_struct *p,
 			u_reset_time = account_policy_temp * 60;
 
 			pdb_get_account_policy(AP_BAD_ATTEMPT_LOCKOUT,
-				(uint32_t *)&dom_info->info12.lockout_threshold);
+					       &account_policy_temp);
+			dom_info->info12.lockout_threshold = account_policy_temp;
 
 			/* !AS ROOT */
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list