samba-cvs.cvs
[Top] [All Lists]

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

Subject: [SCM] Samba Shared Repository - branch master updated - 8be38511a3d87f4debbdc3a827b6ca898ccdde02
From: Günther Deschner
Date: Fri, 5 Dec 2008 07:27:28 -0600 CST
The branch, master has been updated
       via  8be38511a3d87f4debbdc3a827b6ca898ccdde02 (commit)
       via  b883bcd4ff5fcde8db74564cadb540c9452d501c (commit)
       via  b8204ffd03ccadf795978670e1c20247ab6aecc2 (commit)
       via  4bcf8edcf82d378686035e4ef451ca8ab777be4c (commit)
       via  7423b6a4b8aadd12fde2f348d8637099b4171848 (commit)
       via  ce0116815852ddf261954c6df89039ebee24aa87 (commit)
       via  e97149087ac45d178e18f648c8c25bb8c2d9759c (commit)
       via  eb906e1d2d61325487fa7e0bcd50fcf4a1b623a3 (commit)
       via  98ea2b12c4c0f77c81ba5fb3689ddb056204fcf5 (commit)
       via  9bb1f4ca0e0f882484212d9daa7ec1abe344232c (commit)
       via  1e90c5773cf23414666d0ee585c9aac48edcc632 (commit)
       via  b0e813d28c6d98c333bf6f48a4ae3738b45af0f2 (commit)
       via  8210177ea4079dcdc6d87851ac2f629591075040 (commit)
       via  809d44e3db1e0b86d754a2c7f38eb1ec061adaad (commit)
       via  de443a42404a8aab47baa70a123c32435854b2eb (commit)
       via  e9269e57fce69a4ad9dcf19444e60ff3cd489d18 (commit)
      from  0f74de3d37cdb03f622d9cdc1cdcc4aa6ede5ce3 (commit)

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


- Log -----------------------------------------------------------------
commit 8be38511a3d87f4debbdc3a827b6ca898ccdde02
Author: Günther Deschner <gd@xxxxxxxxx>
Date:   Fri Dec 5 12:59:07 2008 +0100

    s3-rpcclient: add setuserinfo to set passwords using level 
18,21,23,24,25,26.
    
    Guenther

commit b883bcd4ff5fcde8db74564cadb540c9452d501c
Author: Günther Deschner <gd@xxxxxxxxx>
Date:   Thu Dec 4 18:23:45 2008 +0100

    s3: store user session key in cli_rpc_pipe_open_noauth().
    
    Guenther

commit b8204ffd03ccadf795978670e1c20247ab6aecc2
Author: Günther Deschner <gd@xxxxxxxxx>
Date:   Thu Dec 4 18:21:10 2008 +0100

    s3-samr: fix samr callers of samr_UserInfo18.
    
    Guenther

commit 4bcf8edcf82d378686035e4ef451ca8ab777be4c
Author: Günther Deschner <gd@xxxxxxxxx>
Date:   Thu Dec 4 18:18:06 2008 +0100

    s4-samr: fix samr callers after SAMR_FIELD_PASSWORD change.
    
    Guenther

commit 7423b6a4b8aadd12fde2f348d8637099b4171848
Author: Günther Deschner <gd@xxxxxxxxx>
Date:   Thu Dec 4 18:15:03 2008 +0100

    s3-samr: fix SAMR_FIELD_PASSWORD callers.
    
    Guenther

commit ce0116815852ddf261954c6df89039ebee24aa87
Author: Günther Deschner <gd@xxxxxxxxx>
Date:   Tue Dec 2 23:27:08 2008 +0100

    s4-samr: fix s4 samr server after idl change.
    
    Guenther

commit e97149087ac45d178e18f648c8c25bb8c2d9759c
Author: Günther Deschner <gd@xxxxxxxxx>
Date:   Tue Dec 2 23:26:48 2008 +0100

    s3-samr: fix rpcclient after idl change.
    
    Guenther

commit eb906e1d2d61325487fa7e0bcd50fcf4a1b623a3
Author: Günther Deschner <gd@xxxxxxxxx>
Date:   Sat Nov 29 00:36:23 2008 +0100

    s3-samr: fix init_samr_user_info2{1,3,5} callers.
    
    Guenther

commit 98ea2b12c4c0f77c81ba5fb3689ddb056204fcf5
Author: Günther Deschner <gd@xxxxxxxxx>
Date:   Sat Nov 29 00:30:21 2008 +0100

    s3-build: re-run make samba3-idl.
    
    Guenther

commit 9bb1f4ca0e0f882484212d9daa7ec1abe344232c
Author: Günther Deschner <gd@xxxxxxxxx>
Date:   Fri Dec 5 12:40:19 2008 +0100

    samr: fix samr_UserInfo18, lm/nt pwd mixup.
    
    Guenther

commit 1e90c5773cf23414666d0ee585c9aac48edcc632
Author: Günther Deschner <gd@xxxxxxxxx>
Date:   Thu Dec 4 18:19:29 2008 +0100

    samr: fix samr_UserInfo18. It also contains password_expired, thanks metze.
    
    Guenther

commit b0e813d28c6d98c333bf6f48a4ae3738b45af0f2
Author: Günther Deschner <gd@xxxxxxxxx>
Date:   Thu Dec 4 18:12:45 2008 +0100

    samr: make more explicit what SAMR_FIELD_PASSWORD{2} means.
    
    Guenther

commit 8210177ea4079dcdc6d87851ac2f629591075040
Author: Günther Deschner <gd@xxxxxxxxx>
Date:   Thu Dec 4 13:09:38 2008 +0100

    samr: fill in two unknowns in samr_UserInfo21.
    
    Guenther

commit 809d44e3db1e0b86d754a2c7f38eb1ec061adaad
Author: Günther Deschner <gd@xxxxxxxxx>
Date:   Tue Dec 2 23:25:16 2008 +0100

    samr: fill in two unknowns in samr_DomInfo13.
    
    Guenther

commit de443a42404a8aab47baa70a123c32435854b2eb
Author: Günther Deschner <gd@xxxxxxxxx>
Date:   Sat Nov 29 00:29:47 2008 +0100

    samr: fix samr_UserInfo21 (order of lm_password_set and nt_password_set).
    
    Guenther

commit e9269e57fce69a4ad9dcf19444e60ff3cd489d18
Author: Günther Deschner <gd@xxxxxxxxx>
Date:   Sat Nov 29 00:27:28 2008 +0100

    s3-rpcclient: add get_domain_handle for samr commands.
    
    Guenther

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

Summary of changes:
 librpc/idl/samr.idl                   |   18 +-
 source3/include/client.h              |    1 +
 source3/include/proto.h               |    3 +-
 source3/lib/netapi/user.c             |    2 +-
 source3/librpc/gen_ndr/ndr_samr.c     |   54 +++---
 source3/librpc/gen_ndr/samr.h         |   18 +-
 source3/rpc_client/cli_pipe.c         |    7 +
 source3/rpc_client/init_samr.c        |   16 +-
 source3/rpc_server/srv_samr_nt.c      |   12 +-
 source3/rpcclient/cmd_samr.c          |  410 ++++++++++++++++++++++++---------
 source3/utils/net_rpc.c               |    2 +-
 source4/libnet/libnet_passwd.c        |    4 +-
 source4/rpc_server/samr/dcesrv_samr.c |   11 +-
 source4/torture/rpc/samba3rpc.c       |    6 +-
 source4/torture/rpc/samr.c            |   20 +-
 15 files changed, 396 insertions(+), 188 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/idl/samr.idl b/librpc/idl/samr.idl
index 46478ee..7d5d877 100644
--- a/librpc/idl/samr.idl
+++ b/librpc/idl/samr.idl
@@ -410,8 +410,7 @@ import "misc.idl", "lsa.idl", "security.idl";
        typedef struct {
                hyper sequence_num;
                NTTIME domain_create_time;
-               uint32 unknown1;
-               uint32 unknown2;
+               hyper modified_count_at_last_promotion;
        } samr_DomInfo13;
 
        typedef [switch_type(uint16)] union {
@@ -880,10 +879,11 @@ import "misc.idl", "lsa.idl", "security.idl";
        } samr_Password;
 
        typedef struct {
-               samr_Password lm_pwd;
                samr_Password nt_pwd;
-               boolean8 lm_pwd_active;
+               samr_Password lm_pwd;
                boolean8 nt_pwd_active;
+               boolean8 lm_pwd_active;
+               uint8 password_expired;
        } samr_UserInfo18;
 
        typedef struct {
@@ -916,8 +916,8 @@ import "misc.idl", "lsa.idl", "security.idl";
                SAMR_FIELD_PARAMETERS       = 0x00200000,
                SAMR_FIELD_COUNTRY_CODE     = 0x00400000,
                SAMR_FIELD_CODE_PAGE        = 0x00800000,
-               SAMR_FIELD_PASSWORD         = 0x01000000, /* either of these */
-               SAMR_FIELD_PASSWORD2        = 0x02000000, /* two bits seems to 
work */
+               SAMR_FIELD_NT_PASSWORD_PRESENT = 0x01000000, /* either of these 
*/
+               SAMR_FIELD_LM_PASSWORD_PRESENT = 0x02000000, /* two bits seems 
to work */
                SAMR_FIELD_PRIVATE_DATA     = 0x04000000,
                SAMR_FIELD_EXPIRED_FLAG     = 0x08000000,
                SAMR_FIELD_SEC_DESC         = 0x10000000,
@@ -945,8 +945,8 @@ import "misc.idl", "lsa.idl", "security.idl";
                lsa_String workstations;
                lsa_String comment;
                lsa_BinaryString parameters;
-               lsa_String unknown1;
-               lsa_String unknown2;
+               lsa_BinaryString lm_owf_password;
+               lsa_BinaryString nt_owf_password;
                lsa_String unknown3;
                uint32 buf_count;
                [size_is(buf_count)] uint8 *buffer;
@@ -959,8 +959,8 @@ import "misc.idl", "lsa.idl", "security.idl";
                uint16 logon_count;
                uint16 country_code;
                uint16 code_page;
-               uint8  nt_password_set;
                uint8  lm_password_set;
+               uint8  nt_password_set;
                uint8  password_expired;
                uint8  unknown4;
        } samr_UserInfo21;
diff --git a/source3/include/client.h b/source3/include/client.h
index 8d57fe1..587f3f6 100644
--- a/source3/include/client.h
+++ b/source3/include/client.h
@@ -52,6 +52,7 @@ struct cli_pipe_auth_data {
 
        char *domain;
        char *user_name;
+       DATA_BLOB user_session_key;
 
        union {
                struct schannel_auth_struct *schannel_auth;
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 89b443e..f985fe2 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -5672,7 +5672,8 @@ void init_samr_user_info16(struct samr_UserInfo16 *r,
                           uint32_t acct_flags);
 void init_samr_user_info18(struct samr_UserInfo18 *r,
                           const uint8 lm_pwd[16],
-                          const uint8 nt_pwd[16]);
+                          const uint8 nt_pwd[16],
+                          uint8_t password_expired);
 void init_samr_user_info20(struct samr_UserInfo20 *r,
                           struct lsa_BinaryString *parameters);
 void init_samr_user_info21(struct samr_UserInfo21 *r,
diff --git a/source3/lib/netapi/user.c b/source3/lib/netapi/user.c
index 2e319cf..1f4b03f 100644
--- a/source3/lib/netapi/user.c
+++ b/source3/lib/netapi/user.c
@@ -46,7 +46,7 @@ static void convert_USER_INFO_X_to_samr_user_info21(struct 
USER_INFO_X *infoX,
                fields_present |= SAMR_FIELD_ACCOUNT_NAME;
        }
        if (infoX->usriX_password) {
-               fields_present |= SAMR_FIELD_PASSWORD;
+               fields_present |= SAMR_FIELD_NT_PASSWORD_PRESENT;
        }
        if (infoX->usriX_flags) {
                fields_present |= SAMR_FIELD_ACCT_FLAGS;
diff --git a/source3/librpc/gen_ndr/ndr_samr.c 
b/source3/librpc/gen_ndr/ndr_samr.c
index 975bde3..83db0fa 100644
--- a/source3/librpc/gen_ndr/ndr_samr.c
+++ b/source3/librpc/gen_ndr/ndr_samr.c
@@ -852,8 +852,7 @@ static enum ndr_err_code ndr_push_samr_DomInfo13(struct 
ndr_push *ndr, int ndr_f
                NDR_CHECK(ndr_push_align(ndr, 8));
                NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->sequence_num));
                NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, 
r->domain_create_time));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
-               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
+               NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, 
r->modified_count_at_last_promotion));
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
@@ -866,8 +865,7 @@ static enum ndr_err_code ndr_pull_samr_DomInfo13(struct 
ndr_pull *ndr, int ndr_f
                NDR_CHECK(ndr_pull_align(ndr, 8));
                NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->sequence_num));
                NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, 
&r->domain_create_time));
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
-               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
+               NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, 
&r->modified_count_at_last_promotion));
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
@@ -880,8 +878,7 @@ _PUBLIC_ void ndr_print_samr_DomInfo13(struct ndr_print 
*ndr, const char *name,
        ndr->depth++;
        ndr_print_hyper(ndr, "sequence_num", r->sequence_num);
        ndr_print_NTTIME(ndr, "domain_create_time", r->domain_create_time);
-       ndr_print_uint32(ndr, "unknown1", r->unknown1);
-       ndr_print_uint32(ndr, "unknown2", r->unknown2);
+       ndr_print_hyper(ndr, "modified_count_at_last_promotion", 
r->modified_count_at_last_promotion);
        ndr->depth--;
 }
 
@@ -2652,10 +2649,11 @@ static enum ndr_err_code 
ndr_push_samr_UserInfo18(struct ndr_push *ndr, int ndr_
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_push_align(ndr, 1));
-               NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->lm_pwd));
                NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->nt_pwd));
-               NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->lm_pwd_active));
+               NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->lm_pwd));
                NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->nt_pwd_active));
+               NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->lm_pwd_active));
+               NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, 
r->password_expired));
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
@@ -2666,10 +2664,11 @@ static enum ndr_err_code 
ndr_pull_samr_UserInfo18(struct ndr_pull *ndr, int ndr_
 {
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 1));
-               NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->lm_pwd));
                NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->nt_pwd));
-               NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->lm_pwd_active));
+               NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->lm_pwd));
                NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->nt_pwd_active));
+               NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->lm_pwd_active));
+               NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, 
&r->password_expired));
        }
        if (ndr_flags & NDR_BUFFERS) {
        }
@@ -2680,10 +2679,11 @@ _PUBLIC_ void ndr_print_samr_UserInfo18(struct 
ndr_print *ndr, const char *name,
 {
        ndr_print_struct(ndr, name, "samr_UserInfo18");
        ndr->depth++;
-       ndr_print_samr_Password(ndr, "lm_pwd", &r->lm_pwd);
        ndr_print_samr_Password(ndr, "nt_pwd", &r->nt_pwd);
-       ndr_print_uint8(ndr, "lm_pwd_active", r->lm_pwd_active);
+       ndr_print_samr_Password(ndr, "lm_pwd", &r->lm_pwd);
        ndr_print_uint8(ndr, "nt_pwd_active", r->nt_pwd_active);
+       ndr_print_uint8(ndr, "lm_pwd_active", r->lm_pwd_active);
+       ndr_print_uint8(ndr, "password_expired", r->password_expired);
        ndr->depth--;
 }
 
@@ -2761,8 +2761,8 @@ _PUBLIC_ void ndr_print_samr_FieldsPresent(struct 
ndr_print *ndr, const char *na
        ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_PARAMETERS", 
SAMR_FIELD_PARAMETERS, r);
        ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_COUNTRY_CODE", 
SAMR_FIELD_COUNTRY_CODE, r);
        ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_CODE_PAGE", 
SAMR_FIELD_CODE_PAGE, r);
-       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_PASSWORD", 
SAMR_FIELD_PASSWORD, r);
-       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_PASSWORD2", 
SAMR_FIELD_PASSWORD2, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), 
"SAMR_FIELD_NT_PASSWORD_PRESENT", SAMR_FIELD_NT_PASSWORD_PRESENT, r);
+       ndr_print_bitmap_flag(ndr, sizeof(uint32_t), 
"SAMR_FIELD_LM_PASSWORD_PRESENT", SAMR_FIELD_LM_PASSWORD_PRESENT, r);
        ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_PRIVATE_DATA", 
SAMR_FIELD_PRIVATE_DATA, r);
        ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_EXPIRED_FLAG", 
SAMR_FIELD_EXPIRED_FLAG, r);
        ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_SEC_DESC", 
SAMR_FIELD_SEC_DESC, r);
@@ -2790,8 +2790,8 @@ static enum ndr_err_code ndr_push_samr_UserInfo21(struct 
ndr_push *ndr, int ndr_
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, 
&r->workstations));
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment));
                NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, 
&r->parameters));
-               NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
-               NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
+               NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, 
&r->lm_owf_password));
+               NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, 
&r->nt_owf_password));
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->buf_count));
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->buffer));
@@ -2804,8 +2804,8 @@ static enum ndr_err_code ndr_push_samr_UserInfo21(struct 
ndr_push *ndr, int ndr_
                NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count));
                NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->country_code));
                NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->code_page));
-               NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->nt_password_set));
                NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->lm_password_set));
+               NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->nt_password_set));
                NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, 
r->password_expired));
                NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->unknown4));
        }
@@ -2820,8 +2820,8 @@ static enum ndr_err_code ndr_push_samr_UserInfo21(struct 
ndr_push *ndr, int ndr_
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, 
&r->workstations));
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment));
                NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, 
&r->parameters));
-               NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
-               NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
+               NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, 
&r->lm_owf_password));
+               NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, 
&r->nt_owf_password));
                NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
                if (r->buffer) {
                        NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 
r->buf_count));
@@ -2854,8 +2854,8 @@ static enum ndr_err_code ndr_pull_samr_UserInfo21(struct 
ndr_pull *ndr, int ndr_
                NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, 
&r->workstations));
                NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment));
                NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, 
&r->parameters));
-               NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
-               NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
+               NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, 
&r->lm_owf_password));
+               NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, 
&r->nt_owf_password));
                NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->buf_count));
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_buffer));
@@ -2873,8 +2873,8 @@ static enum ndr_err_code ndr_pull_samr_UserInfo21(struct 
ndr_pull *ndr, int ndr_
                NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count));
                NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->country_code));
                NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->code_page));
-               NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, 
&r->nt_password_set));
                NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, 
&r->lm_password_set));
+               NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, 
&r->nt_password_set));
                NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, 
&r->password_expired));
                NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->unknown4));
        }
@@ -2889,8 +2889,8 @@ static enum ndr_err_code ndr_pull_samr_UserInfo21(struct 
ndr_pull *ndr, int ndr_
                NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, 
&r->workstations));
                NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment));
                NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, 
&r->parameters));
-               NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
-               NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
+               NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, 
&r->lm_owf_password));
+               NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, 
&r->nt_owf_password));
                NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
                if (r->buffer) {
                        _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr);
@@ -2928,8 +2928,8 @@ _PUBLIC_ void ndr_print_samr_UserInfo21(struct ndr_print 
*ndr, const char *name,
        ndr_print_lsa_String(ndr, "workstations", &r->workstations);
        ndr_print_lsa_String(ndr, "comment", &r->comment);
        ndr_print_lsa_BinaryString(ndr, "parameters", &r->parameters);
-       ndr_print_lsa_String(ndr, "unknown1", &r->unknown1);
-       ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
+       ndr_print_lsa_BinaryString(ndr, "lm_owf_password", &r->lm_owf_password);
+       ndr_print_lsa_BinaryString(ndr, "nt_owf_password", &r->nt_owf_password);
        ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
        ndr_print_uint32(ndr, "buf_count", r->buf_count);
        ndr_print_ptr(ndr, "buffer", r->buffer);
@@ -2947,8 +2947,8 @@ _PUBLIC_ void ndr_print_samr_UserInfo21(struct ndr_print 
*ndr, const char *name,
        ndr_print_uint16(ndr, "logon_count", r->logon_count);
        ndr_print_uint16(ndr, "country_code", r->country_code);
        ndr_print_uint16(ndr, "code_page", r->code_page);
-       ndr_print_uint8(ndr, "nt_password_set", r->nt_password_set);
        ndr_print_uint8(ndr, "lm_password_set", r->lm_password_set);
+       ndr_print_uint8(ndr, "nt_password_set", r->nt_password_set);
        ndr_print_uint8(ndr, "password_expired", r->password_expired);
        ndr_print_uint8(ndr, "unknown4", r->unknown4);
        ndr->depth--;
diff --git a/source3/librpc/gen_ndr/samr.h b/source3/librpc/gen_ndr/samr.h
index 537f144..3116f26 100644
--- a/source3/librpc/gen_ndr/samr.h
+++ b/source3/librpc/gen_ndr/samr.h
@@ -252,8 +252,7 @@ struct samr_DomInfo12 {
 struct samr_DomInfo13 {
        uint64_t sequence_num;
        NTTIME domain_create_time;
-       uint32_t unknown1;
-       uint32_t unknown2;
+       uint64_t modified_count_at_last_promotion;
 };
 
 union samr_DomainInfo {
@@ -477,10 +476,11 @@ struct samr_Password {
 }/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */;
 
 struct samr_UserInfo18 {
-       struct samr_Password lm_pwd;
        struct samr_Password nt_pwd;
-       uint8_t lm_pwd_active;
+       struct samr_Password lm_pwd;
        uint8_t nt_pwd_active;
+       uint8_t lm_pwd_active;
+       uint8_t password_expired;
 };
 
 struct samr_UserInfo20 {
@@ -512,8 +512,8 @@ struct samr_UserInfo20 {
 #define SAMR_FIELD_PARAMETERS ( 0x00200000 )
 #define SAMR_FIELD_COUNTRY_CODE ( 0x00400000 )
 #define SAMR_FIELD_CODE_PAGE ( 0x00800000 )
-#define SAMR_FIELD_PASSWORD ( 0x01000000 )
-#define SAMR_FIELD_PASSWORD2 ( 0x02000000 )
+#define SAMR_FIELD_NT_PASSWORD_PRESENT ( 0x01000000 )
+#define SAMR_FIELD_LM_PASSWORD_PRESENT ( 0x02000000 )
 #define SAMR_FIELD_PRIVATE_DATA ( 0x04000000 )
 #define SAMR_FIELD_EXPIRED_FLAG ( 0x08000000 )
 #define SAMR_FIELD_SEC_DESC ( 0x10000000 )
@@ -536,8 +536,8 @@ struct samr_UserInfo21 {
        struct lsa_String workstations;
        struct lsa_String comment;
        struct lsa_BinaryString parameters;
-       struct lsa_String unknown1;
-       struct lsa_String unknown2;
+       struct lsa_BinaryString lm_owf_password;
+       struct lsa_BinaryString nt_owf_password;
        struct lsa_String unknown3;
        uint32_t buf_count;
        uint8_t *buffer;/* [unique,size_is(buf_count)] */
@@ -550,8 +550,8 @@ struct samr_UserInfo21 {
        uint16_t logon_count;
        uint16_t country_code;
        uint16_t code_page;
-       uint8_t nt_password_set;
        uint8_t lm_password_set;
+       uint8_t nt_password_set;
        uint8_t password_expired;
        uint8_t unknown4;
 };
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index f0c2f67..a2d3342 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -2979,6 +2979,9 @@ NTSTATUS cli_rpc_pipe_open_noauth(struct cli_state *cli,
 
        auth->user_name = talloc_strdup(auth, cli->user_name);
        auth->domain = talloc_strdup(auth, cli->domain);
+       auth->user_session_key = data_blob_talloc(auth,
+               cli->user_session_key.data,
+               cli->user_session_key.length);
 
        if ((auth->user_name == NULL) || (auth->domain == NULL)) {
                TALLOC_FREE(result);
@@ -3443,6 +3446,10 @@ NTSTATUS cli_get_session_key(TALLOC_CTX *mem_ctx,
                                
cli->auth->a_u.kerberos_auth->session_key.length);
                        break;
                case PIPE_AUTH_TYPE_NONE:
+                       *session_key = data_blob_talloc(mem_ctx,
+                               cli->auth->user_session_key.data,
+                               cli->auth->user_session_key.length);
+                       break;
                default:
                        return NT_STATUS_NO_USER_SESSION_KEY;
        }
diff --git a/source3/rpc_client/init_samr.c b/source3/rpc_client/init_samr.c
index 6a9e6d1..a6e4ad8 100644
--- a/source3/rpc_client/init_samr.c
+++ b/source3/rpc_client/init_samr.c
@@ -341,7 +341,8 @@ void init_samr_user_info16(struct samr_UserInfo16 *r,
 
 void init_samr_user_info18(struct samr_UserInfo18 *r,
                           const uint8 lm_pwd[16],
-                          const uint8 nt_pwd[16])
+                          const uint8 nt_pwd[16],
+                          uint8_t password_expired)
 {
        DEBUG(5, ("init_samr_user_info18\n"));
 
@@ -349,6 +350,7 @@ void init_samr_user_info18(struct samr_UserInfo18 *r,
                memcpy(r->lm_pwd.hash, lm_pwd, sizeof(r->lm_pwd.hash)) ? true : 
false;
        r->nt_pwd_active =
                memcpy(r->nt_pwd.hash, nt_pwd, sizeof(r->nt_pwd.hash)) ? true : 
false;
+       r->password_expired = password_expired;
 }
 
 /*******************************************************************
@@ -391,8 +393,8 @@ void init_samr_user_info21(struct samr_UserInfo21 *r,
                           uint16_t logon_count,
                           uint16_t country_code,
                           uint16_t code_page,
-                          uint8_t nt_password_set,
                           uint8_t lm_password_set,
+                          uint8_t nt_password_set,
                           uint8_t password_expired)
 {
        r->last_logon = last_logon;
@@ -420,8 +422,8 @@ void init_samr_user_info21(struct samr_UserInfo21 *r,
        r->logon_count = logon_count;
        r->country_code = country_code;
        r->code_page = code_page;
-       r->nt_password_set = nt_password_set;
        r->lm_password_set = lm_password_set;
+       r->nt_password_set = nt_password_set;
        r->password_expired = password_expired;
 }
 
@@ -455,8 +457,8 @@ void init_samr_user_info23(struct samr_UserInfo23 *r,
                           uint16_t logon_count,
                           uint16_t country_code,
                           uint16_t code_page,
-                          uint8_t nt_password_set,
                           uint8_t lm_password_set,
+                          uint8_t nt_password_set,
                           uint8_t password_expired,
                           struct samr_CryptPassword *pwd_buf)
 {
@@ -487,8 +489,8 @@ void init_samr_user_info23(struct samr_UserInfo23 *r,
                              logon_count,
                              country_code,
                              code_page,
-                             nt_password_set,
                              lm_password_set,
+                             nt_password_set,
                              password_expired);
 
        r->password = *pwd_buf;
@@ -538,8 +540,8 @@ void init_samr_user_info25(struct samr_UserInfo25 *r,
                           uint16_t logon_count,
                           uint16_t country_code,
                           uint16_t code_page,
-                          uint8_t nt_password_set,
                           uint8_t lm_password_set,
+                          uint8_t nt_password_set,
                           uint8_t password_expired,
                           struct samr_CryptPasswordEx *pwd_buf)
 {
@@ -572,8 +574,8 @@ void init_samr_user_info25(struct samr_UserInfo25 *r,
                              logon_count,
                              country_code,
                              code_page,
-                             nt_password_set,
                              lm_password_set,
+                             nt_password_set,
                              password_expired);
 
        r->password = *pwd_buf;
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index cbcd4de..54aa534 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -2430,8 +2430,10 @@ static NTSTATUS get_user_info_18(pipes_struct *p,
                return NT_STATUS_ACCOUNT_DISABLED;
        }
 
-       init_samr_user_info18(r, pdb_get_lanman_passwd(smbpass),
-                             pdb_get_nt_passwd(smbpass));
+       init_samr_user_info18(r,
+                             pdb_get_lanman_passwd(smbpass),
+                             pdb_get_nt_passwd(smbpass),
+                             0 /* FIXME */);
 
        TALLOC_FREE(smbpass);
 
@@ -2607,8 +2609,8 @@ static NTSTATUS get_user_info_21(TALLOC_CTX *mem_ctx,
                              pdb_get_logon_count(pw),
                              0, /* country_code */
                              0, /* code_page */
-                             0, /* nt_password_set */
                              0, /* lm_password_set */
+                             0, /* nt_password_set */
                              password_expired);
 
        return NT_STATUS_OK;
@@ -3856,8 +3858,8 @@ static NTSTATUS set_user_info_23(TALLOC_CTX *mem_ctx,
                return NT_STATUS_ACCESS_DENIED;
        }
 
-       if ((id23->info.fields_present & SAMR_FIELD_PASSWORD) ||
-           (id23->info.fields_present & SAMR_FIELD_PASSWORD2)) {
+       if ((id23->info.fields_present & SAMR_FIELD_NT_PASSWORD_PRESENT) ||
+           (id23->info.fields_present & SAMR_FIELD_LM_PASSWORD_PRESENT)) {
 
                DEBUG(5, ("Attempting administrator password change (level 23) 
for user %s\n",
                          pdb_get_username(pwd)));
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c
index eaf5adb..426e7e9 100644
--- a/source3/rpcclient/cmd_samr.c
+++ b/source3/rpcclient/cmd_samr.c
@@ -219,9 +219,8 @@ static void display_sam_dom_info_13(struct samr_DomInfo13 
*info13)
        printf("Sequence No:\t%llu\n", (unsigned long 
long)info13->sequence_num);
        printf("Domain Create Time:\t%s\n",
                http_timestring(talloc_tos(), 
nt_time_to_unix(info13->domain_create_time)));
-       printf("Unknown1:\t%d\n", info13->unknown1);
-       printf("Unknown2:\t%d\n", info13->unknown2);
-
+       printf("Sequence No at last promotion:\t%llu\n",
+               (unsigned long long)info13->modified_count_at_last_promotion);
 }
 
 static void display_sam_info_1(struct samr_DispEntryGeneral *r)
@@ -264,6 +263,35 @@ static void display_sam_info_5(struct samr_DispEntryAscii 
*r)
        printf("Account: %s\n", r->account_name.string);
 }
 
+/****************************************************************************
+ ****************************************************************************/
+
+static NTSTATUS get_domain_handle(struct rpc_pipe_client *cli,


-- 
Samba Shared Repository

<Prev in Thread] Current Thread [Next in Thread>
  • [SCM] Samba Shared Repository - branch master updated - 8be38511a3d87f4debbdc3a827b6ca898ccdde02, Günther Deschner <=