s3: Pass "country_code" through samr
authorVolker Lendecke <vl@samba.org>
Tue, 15 Feb 2011 18:09:51 +0000 (19:09 +0100)
committerVolker Lendecke <vl@samba.org>
Tue, 15 Feb 2011 20:12:22 +0000 (21:12 +0100)
source3/rpc_server/samr/srv_samr_nt.c
source3/rpc_server/samr/srv_samr_util.c

index 7a698944259365eb967d9f93a8a8628c8507d6ff..7432e01601582810c8b206958f78f9b6ec6cf2df 100644 (file)
@@ -2488,7 +2488,7 @@ static NTSTATUS get_user_info_2(TALLOC_CTX *mem_ctx,
 {
        r->comment.string               = talloc_strdup(mem_ctx, pdb_get_comment(pw));
        r->reserved.string              = NULL;
-       r->country_code                 = 0;
+       r->country_code                 = pdb_get_country_code(pw);
        r->code_page                    = 0;
 
        return NT_STATUS_OK;
@@ -2974,7 +2974,7 @@ static NTSTATUS get_user_info_21(TALLOC_CTX *mem_ctx,
        r->fields_present               = pdb_build_fields_present(pw);
        r->password_expired             = (pdb_get_pass_must_change_time(pw) == 0) ?
                                                PASS_MUST_CHANGE_AT_NEXT_LOGON : 0;
-       r->country_code                 = 0;
+       r->country_code                 = pdb_get_country_code(pw);
        r->code_page                    = 0;
        r->lm_password_set              = 0;
        r->nt_password_set              = 0;
index 6fc4ade3cf519b7b81ede882fe04fc6aa65b4bca..77d40e0251c2e100950a237b5f29de86060df713 100644 (file)
@@ -640,6 +640,15 @@ void copy_id21_to_sam_passwd(const char *log_prefix,
                        }
                }
        }
+
+       if (from->fields_present & SAMR_FIELD_COUNTRY_CODE) {
+               DEBUG(10,("%s SAMR_FIELD_COUNTRY_CODE: %08X -> %08X\n", l,
+                       pdb_get_country_code(to), from->country_code));
+               if (from->country_code != pdb_get_country_code(to)) {
+                       pdb_set_country_code(to,
+                               from->country_code, PDB_CHANGED);
+               }
+       }
 }