Changeset 228 for branches/samba-3.2.x/source/utils/net_rpc.c
- Timestamp:
- May 26, 2009, 9:44:50 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.2.x/source/utils/net_rpc.c
r138 r228 805 805 NTSTATUS result = NT_STATUS_UNSUCCESSFUL; 806 806 POLICY_HND connect_pol, domain_pol, user_pol; 807 uchar pwbuf[516];808 807 const char *user; 809 808 const char *new_password; 810 809 char *prompt = NULL; 811 810 union samr_UserInfo info; 811 struct samr_CryptPassword crypt_pwd; 812 812 813 813 if (argc < 1) { … … 879 879 /* Set password on account */ 880 880 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); 887 887 888 888 result = rpccli_samr_SetUserInfo2(pipe_hnd, mem_ctx, … … 4188 4188 } 4189 4189 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 4201 4190 static void add_sid_to_token(NT_USER_TOKEN *token, DOM_SID *sid) 4202 4191 { … … 5213 5202 struct initshutdown_String_sub s; 5214 5203 5215 if (opt_comment ) {5204 if (opt_comment && strlen(opt_comment)) { 5216 5205 msg = opt_comment; 5217 5206 } … … 5267 5256 WERROR werr; 5268 5257 5269 if (opt_comment ) {5258 if (opt_comment && strlen(opt_comment)) { 5270 5259 msg = opt_comment; 5271 5260 } … … 5430 5419 struct lsa_BinaryString parameters; 5431 5420 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; 5435 5422 5436 5423 ZERO_STRUCT(notime); … … 5446 5433 memset(hours.bits, 0xFF, units_per_week); 5447 5434 5435 init_samr_CryptPassword(argv[1], 5436 &cli->user_session_key, 5437 &crypt_pwd); 5438 5448 5439 init_samr_user_info23(&info.info23, 5449 5440 notime, notime, notime, … … 5451 5442 NULL, NULL, NULL, NULL, NULL, 5452 5443 NULL, NULL, NULL, NULL, ¶meters, 5453 0, 0, ACB_DOMTRUST, SAMR_FIELD_ACCT_FLAGS, 5444 0, 0, ACB_DOMTRUST, 5445 SAMR_FIELD_ACCT_FLAGS | SAMR_FIELD_PASSWORD, 5454 5446 hours, 5455 5447 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); 5460 5449 5461 5450 result = rpccli_samr_SetUserInfo2(pipe_hnd, mem_ctx,
Note:
See TracChangeset
for help on using the changeset viewer.