BOOL rid_in_list | ( | uint32 | rid, | |
uint32 * | list, | |||
uint32 | list_len | |||
) |
int cac_ParseRegPath | ( | char * | path, | |
uint32 * | reg_type, | |||
char ** | key_name | |||
) |
libmsrpc_internal.c の 61 行で定義されています。
参照元 cac_RegOpenKey().
00062 { 00063 00064 if ( !path ) 00065 return CAC_FAILURE; 00066 00067 if ( strncmp( path, "HKLM", 4 ) == 0 ) { 00068 *reg_type = HKEY_LOCAL_MACHINE; 00069 *key_name = ( path[4] == '\\' ) ? path + 5 : NULL; 00070 } else if ( strncmp( path, "HKEY_LOCAL_MACHINE", 18 ) == 0 ) { 00071 *reg_type = HKEY_LOCAL_MACHINE; 00072 *key_name = ( path[18] == '\\' ) ? path + 19 : NULL; 00073 } else if ( strncmp( path, "HKCR", 4 ) == 0 ) { 00074 *reg_type = HKEY_CLASSES_ROOT; 00075 *key_name = ( path[4] == '\\' ) ? path + 5 : NULL; 00076 } else if ( strncmp( path, "HKEY_CLASSES_ROOT", 17 ) == 0 ) { 00077 *reg_type = HKEY_CLASSES_ROOT; 00078 *key_name = ( path[17] == '\\' ) ? path + 18 : NULL; 00079 } else if ( strncmp( path, "HKU", 3 ) == 0 ) { 00080 *reg_type = HKEY_USERS; 00081 *key_name = ( path[3] == '\\' ) ? path + 4 : NULL; 00082 } else if ( strncmp( path, "HKEY_USERS", 10 ) == 0 ) { 00083 *reg_type = HKEY_USERS; 00084 *key_name = ( path[10] == '\\' ) ? path + 11 : NULL; 00085 } else if ( strncmp( path, "HKPD", 4 ) == 0 ) { 00086 *reg_type = HKEY_PERFORMANCE_DATA; 00087 *key_name = ( path[4] == '\\' ) ? path + 5 : NULL; 00088 } else if ( strncmp( path, "HKEY_PERFORMANCE_DATA", 21 ) == 0 ) { 00089 *reg_type = HKEY_PERFORMANCE_DATA; 00090 *key_name = ( path[21] == '\\' ) ? path + 22 : NULL; 00091 } else { 00092 return CAC_FAILURE; 00093 } 00094 00095 return CAC_SUCCESS; 00096 }
REG_VALUE_DATA* cac_MakeRegValueData | ( | TALLOC_CTX * | mem_ctx, | |
uint32 | data_type, | |||
REGVAL_BUFFER | buf | |||
) |
libmsrpc_internal.c の 218 行で定義されています。
参照先 buf・cac_unistr_to_str()・_REGBINARYDATA::data・_REGBINARYDATA::data_length・errno・len・_REGMULTISZDATA::num_strings・_REGVALUEDATA::reg_binary・_REGVALUEDATA::reg_dword・_REGVALUEDATA::reg_dword_be・_REGVALUEDATA::reg_expand_sz・_REGVALUEDATA::reg_multi_sz・_REGVALUEDATA::reg_sz・rpcstr_pull()・size・_REGMULTISZDATA::strings.
参照元 cac_RegEnumValues()・cac_RegQueryValue().
00220 { 00221 REG_VALUE_DATA *data; 00222 00223 uint32 i; 00224 00225 /*all of the following used for MULTI_SZ data */ 00226 uint32 size = 0; 00227 uint32 len = 0; 00228 uint32 multi_idx = 0; 00229 uint32 num_strings = 0; 00230 char **strings = NULL; 00231 00232 data = talloc( mem_ctx, REG_VALUE_DATA ); 00233 if ( !data ) { 00234 errno = ENOMEM; 00235 return NULL; 00236 } 00237 00238 switch ( data_type ) { 00239 case REG_SZ: 00240 data->reg_sz = 00241 cac_unistr_to_str( mem_ctx, buf.buffer, buf.buf_len ); 00242 if ( !data->reg_sz ) { 00243 TALLOC_FREE( data ); 00244 errno = ENOMEM; 00245 data = NULL; 00246 } 00247 00248 break; 00249 00250 case REG_EXPAND_SZ: 00251 data->reg_expand_sz = 00252 cac_unistr_to_str( mem_ctx, buf.buffer, buf.buf_len ); 00253 00254 if ( !data->reg_expand_sz ) { 00255 TALLOC_FREE( data ); 00256 errno = ENOMEM; 00257 data = NULL; 00258 } 00259 00260 break; 00261 00262 case REG_BINARY: 00263 size = buf.buf_len; 00264 00265 data->reg_binary.data_length = size; 00266 00267 if (size) { 00268 data->reg_binary.data = 00269 ( uint8 * ) TALLOC_MEMDUP( mem_ctx, buf.buffer, size ); 00270 if ( !data->reg_binary.data ) { 00271 TALLOC_FREE( data ); 00272 errno = ENOMEM; 00273 data = NULL; 00274 } 00275 } else { 00276 data->reg_binary.data = NULL; 00277 } 00278 break; 00279 00280 case REG_DWORD: 00281 data->reg_dword = *( ( uint32 * ) buf.buffer ); 00282 break; 00283 00284 case REG_DWORD_BE: 00285 data->reg_dword_be = *( ( uint32 * ) buf.buffer ); 00286 break; 00287 00288 case REG_MULTI_SZ: 00289 size = buf.buf_len; 00290 00291 /*find out how many strings there are. size is # of bytes and we want to work uint16 */ 00292 for ( i = 0; i < ( size / 2 - 1 ); i++ ) { 00293 if ( buf.buffer[i] == 0x0000 ) 00294 num_strings++; 00295 00296 /*buffer is suppsed to be terminated with \0\0, but it might not be */ 00297 if ( buf.buffer[i] == 0x0000 00298 && buf.buffer[i + 1] == 0x0000 ) 00299 break; 00300 } 00301 00302 if (num_strings) { 00303 strings = TALLOC_ARRAY( mem_ctx, char *, num_strings ); 00304 00305 if ( !strings ) { 00306 errno = ENOMEM; 00307 TALLOC_FREE( data ); 00308 break; 00309 } 00310 } else { 00311 strings = NULL; 00312 } 00313 00314 if ( num_strings == 0 ) /*then our work here is done */ 00315 break; 00316 00317 for ( i = 0; i < num_strings; i++ ) { 00318 /*find out how many characters are in this string */ 00319 len = 0; 00320 /*make sure we don't go past the end of the buffer and keep looping until we have a uni \0 */ 00321 while ( multi_idx + len < size / 2 00322 && buf.buffer[multi_idx + len] != 0x0000 ) 00323 len++; 00324 00325 /*stay aware of the \0\0 */ 00326 len++; 00327 00328 strings[i] = TALLOC_ZERO_ARRAY( mem_ctx, char, len ); 00329 00330 /*pull out the unicode string */ 00331 rpcstr_pull( strings[i], ( buf.buffer + multi_idx ), 00332 len, -1, STR_TERMINATE ); 00333 00334 /*keep track of where we are in the bigger array */ 00335 multi_idx += len; 00336 } 00337 00338 data->reg_multi_sz.num_strings = num_strings; 00339 data->reg_multi_sz.strings = strings; 00340 00341 break; 00342 00343 default: 00344 TALLOC_FREE( data ); 00345 data = NULL; 00346 } 00347 00348 return data; 00349 }
RPC_DATA_BLOB* cac_MakeRpcDataBlob | ( | TALLOC_CTX * | mem_ctx, | |
uint32 | data_type, | |||
REG_VALUE_DATA | data | |||
) |
libmsrpc_internal.c の 100 行で定義されています。
参照先 RPC_DATA_BLOB::buffer・_REGBINARYDATA::data・_REGBINARYDATA::data_length・errno・init_rpc_blob_bytes()・init_rpc_blob_str()・init_rpc_blob_uint32()・len・_REGMULTISZDATA::num_strings・_REGVALUEDATA::reg_binary・_REGVALUEDATA::reg_dword・_REGVALUEDATA::reg_dword_be・_REGVALUEDATA::reg_expand_sz・_REGVALUEDATA::reg_multi_sz・_REGVALUEDATA::reg_sz・rpcstr_push()・size・_REGMULTISZDATA::strings.
参照元 cac_RegSetValue().
00102 { 00103 RPC_DATA_BLOB *blob = NULL; 00104 int i; 00105 uint32 size = 0; 00106 uint8 *multi = NULL; 00107 uint32 multi_idx = 0; 00108 00109 blob = talloc( mem_ctx, RPC_DATA_BLOB ); 00110 00111 if ( !blob ) { 00112 errno = ENOMEM; 00113 return NULL; 00114 } 00115 00116 switch ( data_type ) { 00117 case REG_SZ: 00118 init_rpc_blob_str( blob, data.reg_sz, 00119 strlen( data.reg_sz ) + 1 ); 00120 break; 00121 00122 case REG_EXPAND_SZ: 00123 init_rpc_blob_str( blob, data.reg_expand_sz, 00124 strlen( data.reg_sz ) + 1 ); 00125 break; 00126 00127 case REG_BINARY: 00128 init_rpc_blob_bytes( blob, data.reg_binary.data, 00129 data.reg_binary.data_length ); 00130 break; 00131 00132 case REG_DWORD: 00133 init_rpc_blob_uint32( blob, data.reg_dword ); 00134 break; 00135 00136 case REG_DWORD_BE: 00137 init_rpc_blob_uint32( blob, data.reg_dword_be ); 00138 break; 00139 00140 case REG_MULTI_SZ: 00141 /*need to find the size */ 00142 for ( i = 0; i < data.reg_multi_sz.num_strings; i++ ) { 00143 size += strlen( data.reg_multi_sz.strings[i] ) + 1; 00144 } 00145 00146 /**need a whole bunch of unicode strings in a row (seperated by null characters), with an extra null-character on the end*/ 00147 00148 multi = TALLOC_ZERO_ARRAY( mem_ctx, uint8, ( size + 1 ) * 2 ); /*size +1 for the extra null character */ 00149 if ( !multi ) { 00150 errno = ENOMEM; 00151 break; 00152 } 00153 00154 /*do it using rpcstr_push() */ 00155 multi_idx = 0; 00156 for ( i = 0; i < data.reg_multi_sz.num_strings; i++ ) { 00157 size_t len = 00158 strlen( data.reg_multi_sz.strings[i] ) + 1; 00159 00160 rpcstr_push( ( multi + multi_idx ), 00161 data.reg_multi_sz.strings[i], len * 2, 00162 STR_TERMINATE ); 00163 00164 /* x2 becuase it is a uint8 buffer */ 00165 multi_idx += len * 2; 00166 } 00167 00168 /*now initialize the buffer as binary data */ 00169 init_rpc_blob_bytes( blob, multi, ( size + 1 ) * 2 ); 00170 00171 break; 00172 00173 default: 00174 TALLOC_FREE( blob ); 00175 blob = NULL; 00176 return NULL; 00177 } 00178 00179 if ( !( blob->buffer ) ) { 00180 TALLOC_FREE( blob ); 00181 return NULL; 00182 } 00183 00184 return blob; 00185 }
SAM_USERINFO_CTR* cac_MakeUserInfoCtr | ( | TALLOC_CTX * | mem_ctx, | |
CacUserInfo * | info | |||
) |
libmsrpc_internal.c の 351 行で定義されています。
参照先 _CACUSERINFO::acb_mask・_CACUSERINFO::bad_passwd_count・_CACUSERINFO::description・_CACUSERINFO::dial・flags・_CACUSERINFO::full_name・_CACUSERINFO::group_rid・_CACUSERINFO::home_dir・_CACUSERINFO::home_drive・sam_userinfo_ctr_info::id21・sam_userinfo_ctr_info::id23・sam_userinfo_ctr_info::info・init_sam_user_info21W()・init_unistr2()・_CACUSERINFO::kickoff_time・_CACUSERINFO::lm_password・_CACUSERINFO::logoff_time・_CACUSERINFO::logon_count・_CACUSERINFO::logon_hours・_CACUSERINFO::logon_script・_CACUSERINFO::logon_time・_CACUSERINFO::nt_password・_CACUSERINFO::pass_can_change_time・_CACUSERINFO::pass_last_set_time・_CACUSERINFO::pass_must_change・_CACUSERINFO::pass_must_change_time・sam_user_info_21::passmustchange・_CACUSERINFO::profile_path・_CACUSERINFO::rid・sam_userinfo_ctr_info::switch_value・UNI_STR_TERMINATE・unix_to_nt_time()・user_name・_CACUSERINFO::username・_CACUSERINFO::workstations.
参照元 cac_SamSetUserInfo().
00353 { 00354 SAM_USERINFO_CTR *ctr = NULL; 00355 00356 /*the flags we are 'setting'- include/passdb.h */ 00357 uint32 flags = 00358 ACCT_USERNAME | ACCT_FULL_NAME | ACCT_PRIMARY_GID | 00359 ACCT_DESCRIPTION | ACCT_COMMENT | ACCT_HOME_DIR | 00360 ACCT_HOME_DRIVE | ACCT_LOGON_SCRIPT | ACCT_PROFILE | 00361 ACCT_WORKSTATIONS | ACCT_FLAGS; 00362 00363 NTTIME logon_time; 00364 NTTIME logoff_time; 00365 NTTIME kickoff_time; 00366 NTTIME pass_last_set_time; 00367 NTTIME pass_can_change_time; 00368 NTTIME pass_must_change_time; 00369 00370 UNISTR2 user_name; 00371 UNISTR2 full_name; 00372 UNISTR2 home_dir; 00373 UNISTR2 dir_drive; 00374 UNISTR2 log_scr; 00375 UNISTR2 prof_path; 00376 UNISTR2 desc; 00377 UNISTR2 wkstas; 00378 UNISTR2 mung_dial; 00379 UNISTR2 unk; 00380 00381 ctr = talloc( mem_ctx, SAM_USERINFO_CTR ); 00382 if ( !ctr ) 00383 return NULL; 00384 00385 ZERO_STRUCTP( ctr->info.id23 ); 00386 00387 ctr->info.id21 = talloc( mem_ctx, SAM_USER_INFO_21 ); 00388 if ( !ctr->info.id21 ) 00389 return NULL; 00390 00391 ctr->switch_value = 21; 00392 00393 ZERO_STRUCTP( ctr->info.id21 ); 00394 00395 unix_to_nt_time( &logon_time, info->logon_time ); 00396 unix_to_nt_time( &logoff_time, info->logoff_time ); 00397 unix_to_nt_time( &kickoff_time, info->kickoff_time ); 00398 unix_to_nt_time( &pass_last_set_time, info->pass_last_set_time ); 00399 unix_to_nt_time( &pass_can_change_time, info->pass_can_change_time ); 00400 unix_to_nt_time( &pass_must_change_time, 00401 info->pass_must_change_time ); 00402 00403 /*initialize the strings */ 00404 init_unistr2( &user_name, info->username, UNI_STR_TERMINATE ); 00405 init_unistr2( &full_name, info->full_name, UNI_STR_TERMINATE ); 00406 init_unistr2( &home_dir, info->home_dir, UNI_STR_TERMINATE ); 00407 init_unistr2( &dir_drive, info->home_drive, UNI_STR_TERMINATE ); 00408 init_unistr2( &log_scr, info->logon_script, UNI_STR_TERMINATE ); 00409 init_unistr2( &prof_path, info->profile_path, UNI_STR_TERMINATE ); 00410 init_unistr2( &desc, info->description, UNI_STR_TERMINATE ); 00411 init_unistr2( &wkstas, info->workstations, UNI_STR_TERMINATE ); 00412 init_unistr2( &unk, "\0", UNI_STR_TERMINATE ); 00413 init_unistr2( &mung_dial, info->dial, UNI_STR_TERMINATE ); 00414 00415 /*manually set passmustchange */ 00416 ctr->info.id21->passmustchange = 00417 ( info->pass_must_change ) ? 0x01 : 0x00; 00418 00419 init_sam_user_info21W( ctr->info.id21, &logon_time, &logoff_time, &kickoff_time, &pass_last_set_time, &pass_can_change_time, &pass_must_change_time, &user_name, &full_name, &home_dir, &dir_drive, &log_scr, &prof_path, &desc, &wkstas, &unk, &mung_dial, info->lm_password, info->nt_password, info->rid, info->group_rid, info->acb_mask, flags, 168, /*logon divs */ 00420 info->logon_hours, 00421 info->bad_passwd_count, info->logon_count ); 00422 00423 return ctr; 00424 00425 }
CacUserInfo* cac_MakeUserInfo | ( | TALLOC_CTX * | mem_ctx, | |
SAM_USERINFO_CTR * | ctr | |||
) |
libmsrpc_internal.c の 443 行で定義されています。
参照先 sam_user_info_21::acb_info・_CACUSERINFO::acb_mask・_CACUSERINFO::bad_passwd_count・sam_user_info_21::bad_password_count・_CACUSERINFO::description・_CACUSERINFO::dial・_CACUSERINFO::full_name・_CACUSERINFO::group_rid・sam_user_info_21::group_rid・_CACUSERINFO::home_dir・_CACUSERINFO::home_drive・sam_userinfo_ctr_info::id21・sam_userinfo_ctr_info::info・_CACUSERINFO::kickoff_time・sam_user_info_21::kickoff_time・_CACUSERINFO::lm_password・sam_user_info_21::lm_pwd・_CACUSERINFO::logoff_time・sam_user_info_21::logoff_time・_CACUSERINFO::logon_count・sam_user_info_21::logon_count・_CACUSERINFO::logon_hours・sam_user_info_21::logon_hrs・_CACUSERINFO::logon_script・_CACUSERINFO::logon_time・sam_user_info_21::logon_time・_CACUSERINFO::nt_password・sam_user_info_21::nt_pwd・nt_time_to_unix()・_CACUSERINFO::pass_can_change_time・sam_user_info_21::pass_can_change_time・_CACUSERINFO::pass_last_set_time・sam_user_info_21::pass_last_set_time・_CACUSERINFO::pass_must_change・_CACUSERINFO::pass_must_change_time・sam_user_info_21::pass_must_change_time・sam_user_info_21::passmustchange・_CACUSERINFO::profile_path・_CACUSERINFO::rid・sam_userinfo_ctr_info::switch_value・talloc_unistr2_to_ascii()・sam_user_info_21::uni_acct_desc・sam_user_info_21::uni_dir_drive・sam_user_info_21::uni_full_name・sam_user_info_21::uni_home_dir・sam_user_info_21::uni_logon_script・sam_user_info_21::uni_munged_dial・sam_user_info_21::uni_profile_path・sam_user_info_21::uni_user_name・sam_user_info_21::uni_workstations・sam_user_info_21::user_rid・_CACUSERINFO::username・_CACUSERINFO::workstations.
参照元 cac_SamGetUserInfo().
00444 { 00445 CacUserInfo *info = NULL; 00446 SAM_USER_INFO_21 *id21 = NULL; 00447 00448 if ( !ctr || ctr->switch_value != 21 ) 00449 return NULL; 00450 00451 info = talloc( mem_ctx, CacUserInfo ); 00452 if ( !info ) 00453 return NULL; 00454 00455 id21 = ctr->info.id21; 00456 00457 ZERO_STRUCTP( info ); 00458 00459 info->logon_time = nt_time_to_unix( id21->logon_time ); 00460 info->logoff_time = nt_time_to_unix( id21->logoff_time ); 00461 info->kickoff_time = nt_time_to_unix( id21->kickoff_time ); 00462 info->pass_last_set_time = 00463 nt_time_to_unix( id21->pass_last_set_time ); 00464 info->pass_can_change_time = 00465 nt_time_to_unix( id21->pass_can_change_time ); 00466 info->pass_must_change_time = 00467 nt_time_to_unix( id21->pass_must_change_time ); 00468 00469 info->username = 00470 talloc_unistr2_to_ascii( mem_ctx, id21->uni_user_name ); 00471 if ( !info->username ) 00472 return NULL; 00473 00474 info->full_name = 00475 talloc_unistr2_to_ascii( mem_ctx, id21->uni_full_name ); 00476 if ( !info->full_name ) 00477 return NULL; 00478 00479 info->home_dir = 00480 talloc_unistr2_to_ascii( mem_ctx, id21->uni_home_dir ); 00481 if ( !info->home_dir ) 00482 return NULL; 00483 00484 info->home_drive = 00485 talloc_unistr2_to_ascii( mem_ctx, id21->uni_dir_drive ); 00486 if ( !info->home_drive ) 00487 return NULL; 00488 00489 info->logon_script = 00490 talloc_unistr2_to_ascii( mem_ctx, id21->uni_logon_script ); 00491 if ( !info->logon_script ) 00492 return NULL; 00493 00494 info->profile_path = 00495 talloc_unistr2_to_ascii( mem_ctx, id21->uni_profile_path ); 00496 if ( !info->profile_path ) 00497 return NULL; 00498 00499 info->description = 00500 talloc_unistr2_to_ascii( mem_ctx, id21->uni_acct_desc ); 00501 if ( !info->description ) 00502 return NULL; 00503 00504 info->workstations = 00505 talloc_unistr2_to_ascii( mem_ctx, id21->uni_workstations ); 00506 if ( !info->workstations ) 00507 return NULL; 00508 00509 info->dial = 00510 talloc_unistr2_to_ascii( mem_ctx, id21->uni_munged_dial ); 00511 if ( !info->dial ) 00512 return NULL; 00513 00514 info->rid = id21->user_rid; 00515 info->group_rid = id21->group_rid; 00516 info->acb_mask = id21->acb_info; 00517 info->bad_passwd_count = id21->bad_password_count; 00518 info->logon_count = id21->logon_count; 00519 00520 memcpy( info->nt_password, id21->nt_pwd, 8 ); 00521 memcpy( info->lm_password, id21->lm_pwd, 8 ); 00522 00523 info->logon_hours = 00524 ( LOGON_HRS * ) TALLOC_MEMDUP( mem_ctx, &( id21->logon_hrs ), 00525 sizeof( LOGON_HRS ) ); 00526 if ( !info->logon_hours ) 00527 return NULL; 00528 00529 info->pass_must_change = ( id21->passmustchange ) ? True : False; 00530 00531 return info; 00532 }
CacGroupInfo* cac_MakeGroupInfo | ( | TALLOC_CTX * | mem_ctx, | |
GROUP_INFO_CTR * | ctr | |||
) |
libmsrpc_internal.c の 534 行で定義されています。
参照先 _CACGROUPINFO::description・group_info_ctr::group・group_info_ctr::info1・_CACGROUPINFO::name・_CACGROUPINFO::num_members・samr_group_info1::num_members・group_info_ctr::switch_value1・talloc_unistr2_to_ascii()・samr_group_info1::uni_acct_desc・samr_group_info1::uni_acct_name.
00535 { 00536 CacGroupInfo *info = NULL; 00537 00538 if ( !mem_ctx || !ctr || ctr->switch_value1 != 1 ) 00539 return NULL; 00540 00541 info = talloc( mem_ctx, CacGroupInfo ); 00542 if ( !info ) 00543 return NULL; 00544 00545 info->name = 00546 talloc_unistr2_to_ascii( mem_ctx, 00547 ctr->group.info1.uni_acct_name ); 00548 if ( !info->name ) 00549 return NULL; 00550 00551 info->description = 00552 talloc_unistr2_to_ascii( mem_ctx, 00553 ctr->group.info1.uni_acct_desc ); 00554 if ( !info->description ) 00555 return NULL; 00556 00557 info->num_members = ctr->group.info1.num_members; 00558 00559 return info; 00560 }
GROUP_INFO_CTR* cac_MakeGroupInfoCtr | ( | TALLOC_CTX * | mem_ctx, | |
CacGroupInfo * | info | |||
) |
libmsrpc_internal.c の 562 行で定義されています。
参照先 _CACGROUPINFO::description・group_info_ctr::group・group_info_ctr::info1・init_samr_group_info1()・_CACGROUPINFO::name・_CACGROUPINFO::num_members・group_info_ctr::switch_value1.
00564 { 00565 GROUP_INFO_CTR *ctr = NULL; 00566 00567 if ( !mem_ctx || !info ) 00568 return NULL; 00569 00570 ctr = talloc( mem_ctx, GROUP_INFO_CTR ); 00571 if ( !ctr ) 00572 return NULL; 00573 00574 ctr->switch_value1 = 1; 00575 00576 init_samr_group_info1( &( ctr->group.info1 ), info->name, 00577 info->description, info->num_members ); 00578 00579 return ctr; 00580 }
CacAliasInfo* cac_MakeAliasInfo | ( | TALLOC_CTX * | mem_ctx, | |
ALIAS_INFO_CTR | ctr | |||
) |
libmsrpc_internal.c の 582 行で定義されています。
参照先 ALIAS_INFO_CTR::alias・_CACGROUPINFO::description・ALIAS_INFO1::description・ALIAS_INFO_CTR::info1・ALIAS_INFO_CTR::level・_CACGROUPINFO::name・ALIAS_INFO1::name・ALIAS_INFO1::num_member・_CACGROUPINFO::num_members・UNISTR4::string・string・talloc_unistr2_to_ascii().
00583 { 00584 CacGroupInfo *info = NULL; 00585 00586 if ( !mem_ctx || ctr.level != 1 ) 00587 return NULL; 00588 00589 info = talloc( mem_ctx, CacAliasInfo ); 00590 if ( !info ) 00591 return NULL; 00592 00593 info->name = 00594 talloc_unistr2_to_ascii( mem_ctx, 00595 *( ctr.alias.info1.name.string ) ); 00596 if ( !info->name ) 00597 return NULL; 00598 00599 info->description = 00600 talloc_unistr2_to_ascii( mem_ctx, 00601 *( ctr.alias.info1.description. 00602 string ) ); 00603 if ( !info->name ) 00604 return NULL; 00605 00606 info->num_members = ctr.alias.info1.num_member; 00607 00608 return info; 00609 }
ALIAS_INFO_CTR* cac_MakeAliasInfoCtr | ( | TALLOC_CTX * | mem_ctx, | |
CacAliasInfo * | info | |||
) |
libmsrpc_internal.c の 611 行で定義されています。
参照先 ALIAS_INFO_CTR::alias・_CACGROUPINFO::description・ALIAS_INFO_CTR::info1・init_samr_alias_info1()・ALIAS_INFO_CTR::level・_CACGROUPINFO::name・_CACGROUPINFO::num_members.
00613 { 00614 ALIAS_INFO_CTR *ctr = NULL; 00615 00616 if ( !mem_ctx || !info ) 00617 return NULL; 00618 00619 ctr = talloc( mem_ctx, ALIAS_INFO_CTR ); 00620 if ( !ctr ) 00621 return NULL; 00622 00623 ctr->level = 1; 00624 00625 init_samr_alias_info1( &( ctr->alias.info1 ), info->name, 00626 info->num_members, info->description ); 00627 00628 return ctr; 00629 }
CacDomainInfo* cac_MakeDomainInfo | ( | TALLOC_CTX * | mem_ctx, | |
SAM_UNK_INFO_1 * | info1, | |||
SAM_UNK_INFO_2 * | info2, | |||
SAM_UNK_INFO_12 * | info12 | |||
) |
libmsrpc_internal.c の 631 行で定義されています。
参照先 sam_unknown_info_12_inf::bad_attempt_lockout・cac_InitCacTime()・_CACDOMINFO::comment・_CACDOMINFO::domain_name・sam_unknown_info_12_inf::duration・_CACDOMINFO::expire・sam_unknown_info_1_inf::expire・_CACDOMINFO::lockout_duration・_CACDOMINFO::lockout_reset・sam_unknown_info_1_inf::min_length_password・_CACDOMINFO::min_pass_age・_CACDOMINFO::min_pass_length・sam_unknown_info_1_inf::min_passwordage・_CACDOMINFO::num_bad_attempts・_CACDOMINFO::num_domain_groups・sam_unknown_info_2_inf::num_domain_grps・sam_unknown_info_2_inf::num_domain_usrs・_CACDOMINFO::num_local_groups・sam_unknown_info_2_inf::num_local_grps・_CACDOMINFO::num_users・_CACDOMINFO::pass_history・sam_unknown_info_1_inf::password_history・sam_unknown_info_12_inf::reset_count・_CACDOMINFO::server_name・_CACDOMINFO::server_role・sam_unknown_info_2_inf::server_role・talloc_strdup()・talloc_unistr2_to_ascii()・sam_unknown_info_2_inf::uni_comment・sam_unknown_info_2_inf::uni_domain・sam_unknown_info_2_inf::uni_server・UNISTR2::uni_str_len.
00635 { 00636 CacDomainInfo *info = NULL; 00637 00638 if ( !mem_ctx || !info1 || !info2 || !info12 ) 00639 return NULL; 00640 00641 info = talloc( mem_ctx, CacDomainInfo ); 00642 if ( !info ) 00643 return NULL; 00644 00645 info->min_pass_length = info1->min_length_password; 00646 info->pass_history = info1->password_history; 00647 00648 cac_InitCacTime( &( info->expire ), info1->expire ); 00649 cac_InitCacTime( &( info->min_pass_age ), info1->min_passwordage ); 00650 00651 info->server_role = info2->server_role; 00652 info->num_users = info2->num_domain_usrs; 00653 info->num_domain_groups = info2->num_domain_grps; 00654 info->num_local_groups = info2->num_local_grps; 00655 00656 /*if these have been ZERO'd out we need to know. uni_str_len will be 0 */ 00657 if ( info2->uni_comment.uni_str_len == 0 ) { 00658 info->comment = talloc_strdup( mem_ctx, "\0" ); 00659 } else { 00660 info->comment = 00661 talloc_unistr2_to_ascii( mem_ctx, 00662 info2->uni_comment ); 00663 } 00664 00665 if ( info2->uni_domain.uni_str_len == 0 ) { 00666 info->domain_name = talloc_strdup( mem_ctx, "\0" ); 00667 } else { 00668 info->domain_name = 00669 talloc_unistr2_to_ascii( mem_ctx, info2->uni_domain ); 00670 } 00671 00672 if ( info2->uni_server.uni_str_len == 0 ) { 00673 info->server_name = talloc_strdup( mem_ctx, "\0" ); 00674 } else { 00675 info->server_name = 00676 talloc_unistr2_to_ascii( mem_ctx, info2->uni_server ); 00677 } 00678 00679 00680 cac_InitCacTime( &( info->lockout_duration ), info12->duration ); 00681 cac_InitCacTime( &( info->lockout_reset ), info12->reset_count ); 00682 info->num_bad_attempts = info12->bad_attempt_lockout; 00683 00684 return info; 00685 }
CacService* cac_MakeServiceArray | ( | TALLOC_CTX * | mem_ctx, | |
ENUM_SERVICES_STATUS * | svc, | |||
uint32 | num_services | |||
) |
libmsrpc_internal.c の 706 行で定義されています。
参照先 cac_unistr_ascii()・_CACSERVICE::display_name・_CACSERVICE::status・ENUM_SERVICES_STATUS::status.
00709 { 00710 int i; 00711 CacService *services = NULL; 00712 00713 if ( !mem_ctx || !svc ) 00714 return NULL; 00715 00716 if (num_services) { 00717 services = TALLOC_ZERO_ARRAY( mem_ctx, CacService, num_services ); 00718 if ( !services ) 00719 return NULL; 00720 } else { 00721 services = NULL; 00722 } 00723 00724 for ( i = 0; i < num_services; i++ ) { 00725 services[i].service_name = 00726 cac_unistr_ascii( mem_ctx, svc[i].servicename ); 00727 services[i].display_name = 00728 cac_unistr_ascii( mem_ctx, svc[i].displayname ); 00729 00730 if ( !services[i].service_name || !services[i].display_name ) 00731 return NULL; 00732 00733 services[i].status = svc[i].status; 00734 } 00735 00736 return services; 00737 }
int cac_InitCacServiceConfig | ( | TALLOC_CTX * | mem_ctx, | |
SERVICE_CONFIG * | src, | |||
CacServiceConfig * | dest | |||
) |
libmsrpc_internal.c の 739 行で定義されています。
参照先 __CACSERVICECONFIG::dependencies・SERVICE_CONFIG::dependencies・__CACSERVICECONFIG::display_name・SERVICE_CONFIG::displayname・__CACSERVICECONFIG::error_control・SERVICE_CONFIG::error_control・__CACSERVICECONFIG::exe_path・SERVICE_CONFIG::executablepath・__CACSERVICECONFIG::load_order_group・SERVICE_CONFIG::loadordergroup・SERVICE_CONFIG::service_type・__CACSERVICECONFIG::start_name・__CACSERVICECONFIG::start_type・SERVICE_CONFIG::start_type・SERVICE_CONFIG::startname・__CACSERVICECONFIG::tag_id・SERVICE_CONFIG::tag_id・talloc_unistr2_to_ascii()・__CACSERVICECONFIG::type.
参照元 cac_SvcGetServiceConfig().
00741 { 00742 if ( !src || !dest ) 00743 return CAC_FAILURE; 00744 00745 dest->exe_path = 00746 talloc_unistr2_to_ascii( mem_ctx, *src->executablepath ); 00747 if ( !dest->exe_path ) 00748 return CAC_FAILURE; 00749 00750 dest->load_order_group = 00751 talloc_unistr2_to_ascii( mem_ctx, *src->loadordergroup ); 00752 if ( !dest->load_order_group ) 00753 return CAC_FAILURE; 00754 00755 dest->dependencies = 00756 talloc_unistr2_to_ascii( mem_ctx, *src->dependencies ); 00757 if ( !dest->dependencies ) 00758 return CAC_FAILURE; 00759 00760 dest->start_name = 00761 talloc_unistr2_to_ascii( mem_ctx, *src->startname ); 00762 if ( !dest->start_name ) 00763 return CAC_FAILURE; 00764 00765 dest->display_name = 00766 talloc_unistr2_to_ascii( mem_ctx, *src->displayname ); 00767 if ( !dest->display_name ) 00768 return CAC_FAILURE; 00769 00770 dest->type = src->service_type; 00771 dest->start_type = src->start_type; 00772 dest->error_control = src->error_control; 00773 dest->tag_id = src->tag_id; 00774 00775 return CAC_SUCCESS; 00776 }