]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:libnet: Remove unused code in libnet_ChangePassword_samr()
authorAndreas Schneider <asn@samba.org>
Tue, 26 Jul 2022 12:47:53 +0000 (14:47 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 28 Jul 2022 11:51:29 +0000 (11:51 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source4/libnet/libnet_passwd.c

index 2bb7e392bd86f877ca010ec5011b134e0f363b12..4990f69bc49f4d40a8f12f11e8232654790e9579 100644 (file)
  * 2. try samr_ChangePasswordUser3
  * 3. try samr_ChangePasswordUser2
  * 4. try samr_OemChangePasswordUser2
- * (not yet: 5. try samr_ChangePasswordUser)
  */
 static NTSTATUS libnet_ChangePassword_samr(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, union libnet_ChangePassword *r)
 {
         NTSTATUS status;
        struct libnet_RpcConnect c;
-#if 0
-       struct policy_handle user_handle;
-       struct samr_Password hash1, hash2, hash3, hash4, hash5, hash6;
-       struct samr_ChangePasswordUser pw;
-#endif
        struct samr_OemChangePasswordUser2 oe2;
        struct samr_ChangePasswordUser2 pw2;
        struct samr_ChangePasswordUser3 pw3;
@@ -304,50 +298,6 @@ static NTSTATUS libnet_ChangePassword_samr(struct libnet_context *ctx, TALLOC_CT
                goto disconnect;
        }
 
-#if 0
-       /* prepare samr_ChangePasswordUser */
-       E_old_pw_hash(new_lm_hash, old_lm_hash, hash1.hash);
-       E_old_pw_hash(old_lm_hash, new_lm_hash, hash2.hash);
-       E_old_pw_hash(new_nt_hash, old_nt_hash, hash3.hash);
-       E_old_pw_hash(old_nt_hash, new_nt_hash, hash4.hash);
-       E_old_pw_hash(old_lm_hash, new_nt_hash, hash5.hash);
-       E_old_pw_hash(old_nt_hash, new_lm_hash, hash6.hash);
-
-       /* TODO: ask for a user_handle */
-       pw.in.handle = &user_handle;
-       pw.in.lm_present = 1;
-       pw.in.old_lm_crypted = &hash1;
-       pw.in.new_lm_crypted = &hash2;
-       pw.in.nt_present = 1;
-       pw.in.old_nt_crypted = &hash3;
-       pw.in.new_nt_crypted = &hash4;
-       pw.in.cross1_present = 1;
-       pw.in.nt_cross = &hash5;
-       pw.in.cross2_present = 1;
-       pw.in.lm_cross = &hash6;
-
-       /* 5. try samr_ChangePasswordUser */
-       status = dcerpc_samr_ChangePasswordUser_r(c.pdc.out.dcerpc_pipe->binding_handle, mem_ctx, &pw);
-       if (!NT_STATUS_IS_OK(status)) {
-               r->samr.out.error_string = talloc_asprintf(mem_ctx,
-                                               "samr_ChangePasswordUser failed: %s",
-                                               nt_errstr(status));
-               goto disconnect;
-       }
-
-       /* check result of samr_ChangePasswordUser */
-       if (!NT_STATUS_IS_OK(pw.out.result)) {
-               r->samr.out.error_string = talloc_asprintf(mem_ctx,
-                                               "samr_ChangePasswordUser for '%s\\%s' failed: %s",
-                                               r->samr.in.domain_name, r->samr.in.account_name,
-                                               nt_errstr(pw.out.result));
-               if (NT_STATUS_EQUAL(pw.out.result, NT_STATUS_PASSWORD_RESTRICTION)) {
-                       status = pw.out.result;
-                       goto disconnect;
-               }
-               goto disconnect;
-       }
-#endif
 disconnect:
        /* close connection */
        talloc_unlink(ctx, c.out.dcerpc_pipe);