Ignore:
Timestamp:
May 26, 2009, 9:44:50 AM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update 3.2 branch to 3.2.6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.2.x/source/utils/net_rpc.c

    r138 r228  
    805805        NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
    806806        POLICY_HND connect_pol, domain_pol, user_pol;
    807         uchar pwbuf[516];
    808807        const char *user;
    809808        const char *new_password;
    810809        char *prompt = NULL;
    811810        union samr_UserInfo info;
     811        struct samr_CryptPassword crypt_pwd;
    812812
    813813        if (argc < 1) {
     
    879879        /* Set password on account */
    880880
    881         encode_pw_buffer(pwbuf, new_password, STR_UNICODE);
    882 
    883         init_samr_user_info24(&info.info24, pwbuf, 24);
    884 
    885         SamOEMhashBlob(info.info24.password.data, 516,
    886                        &cli->user_session_key);
     881        init_samr_CryptPassword(new_password,
     882                                &cli->user_session_key,
     883                                &crypt_pwd);
     884
     885        init_samr_user_info24(&info.info24, &crypt_pwd,
     886                              PASS_DONT_CHANGE_AT_NEXT_LOGON);
    887887
    888888        result = rpccli_samr_SetUserInfo2(pipe_hnd, mem_ctx,
     
    41884188}
    41894189
    4190 static bool is_sid_in_token(NT_USER_TOKEN *token, DOM_SID *sid)
    4191 {
    4192         int i;
    4193 
    4194         for (i=0; i<token->num_sids; i++) {
    4195                 if (sid_compare(sid, &token->user_sids[i]) == 0)
    4196                         return True;
    4197         }
    4198         return False;
    4199 }
    4200 
    42014190static void add_sid_to_token(NT_USER_TOKEN *token, DOM_SID *sid)
    42024191{
     
    52135202        struct initshutdown_String_sub s;
    52145203
    5215         if (opt_comment) {
     5204        if (opt_comment && strlen(opt_comment)) {
    52165205                msg = opt_comment;
    52175206        }
     
    52675256        WERROR werr;
    52685257
    5269         if (opt_comment) {
     5258        if (opt_comment && strlen(opt_comment)) {
    52705259                msg = opt_comment;
    52715260        }
     
    54305419                struct lsa_BinaryString parameters;
    54315420                const int units_per_week = 168;
    5432                 uchar pwbuf[516];
    5433 
    5434                 encode_pw_buffer(pwbuf, argv[1], STR_UNICODE);
     5421                struct samr_CryptPassword crypt_pwd;
    54355422
    54365423                ZERO_STRUCT(notime);
     
    54465433                memset(hours.bits, 0xFF, units_per_week);
    54475434
     5435                init_samr_CryptPassword(argv[1],
     5436                                        &cli->user_session_key,
     5437                                        &crypt_pwd);
     5438
    54485439                init_samr_user_info23(&info.info23,
    54495440                                      notime, notime, notime,
     
    54515442                                      NULL, NULL, NULL, NULL, NULL,
    54525443                                      NULL, NULL, NULL, NULL, &parameters,
    5453                                       0, 0, ACB_DOMTRUST, SAMR_FIELD_ACCT_FLAGS,
     5444                                      0, 0, ACB_DOMTRUST,
     5445                                      SAMR_FIELD_ACCT_FLAGS | SAMR_FIELD_PASSWORD,
    54545446                                      hours,
    54555447                                      0, 0, 0, 0, 0, 0, 0,
    5456                                       pwbuf, 24);
    5457 
    5458                 SamOEMhashBlob(info.info23.password.data, 516,
    5459                                &cli->user_session_key);
     5448                                      &crypt_pwd);
    54605449
    54615450                result = rpccli_samr_SetUserInfo2(pipe_hnd, mem_ctx,
Note: See TracChangeset for help on using the changeset viewer.