static NTSTATUS registry_access_check | ( | SEC_DESC * | sec_desc, | |
NT_USER_TOKEN * | token, | |||
uint32 | access_desired, | |||
uint32 * | access_granted | |||
) | [static] |
reg_frontend.c の 53 行で定義されています。
参照先 get_root_nt_token()・reg_generic_map・result・se_access_check()・se_map_generic()・sec_initial_uid().
00055 { 00056 NTSTATUS result; 00057 00058 if ( geteuid() == sec_initial_uid() ) { 00059 DEBUG(5,("registry_access_check: using root's token\n")); 00060 token = get_root_nt_token(); 00061 } 00062 00063 se_map_generic( &access_desired, ®_generic_map ); 00064 se_access_check( sec_desc, token, access_desired, access_granted, &result ); 00065 00066 return result; 00067 }
static SEC_DESC* construct_registry_sd | ( | TALLOC_CTX * | ctx | ) | [static] |
reg_frontend.c の 72 行で定義されています。
参照先 global_sid_Builtin_Administrators・global_sid_World・init_sec_access()・init_sec_ace()・make_sec_acl()・make_sec_desc()・SEC_ACE_TYPE_ACCESS_ALLOWED.
00073 { 00074 SEC_ACE ace[2]; 00075 SEC_ACCESS mask; 00076 size_t i = 0; 00077 SEC_DESC *sd; 00078 SEC_ACL *acl; 00079 size_t sd_size; 00080 00081 /* basic access for Everyone */ 00082 00083 init_sec_access(&mask, REG_KEY_READ ); 00084 init_sec_ace(&ace[i++], &global_sid_World, SEC_ACE_TYPE_ACCESS_ALLOWED, mask, 0); 00085 00086 /* Full Access 'BUILTIN\Administrators' */ 00087 00088 init_sec_access(&mask, REG_KEY_ALL ); 00089 init_sec_ace(&ace[i++], &global_sid_Builtin_Administrators, SEC_ACE_TYPE_ACCESS_ALLOWED, mask, 0); 00090 00091 00092 /* create the security descriptor */ 00093 00094 if ( !(acl = make_sec_acl(ctx, NT4_ACL_REVISION, i, ace)) ) 00095 return NULL; 00096 00097 if ( !(sd = make_sec_desc(ctx, SEC_DESC_REVISION, SEC_DESC_SELF_RELATIVE, NULL, NULL, NULL, acl, &sd_size)) ) 00098 return NULL; 00099 00100 return sd; 00101 }
BOOL init_registry | ( | void | ) |
reg_frontend.c の 108 行で定義されています。
参照先 DEBUGLEVEL・eventlog_init_keys()・REGISTRY_HOOK::keyname・perfcount_init_keys()・reg_hooks・regdb_close()・regdb_init()・reghook_cache_add()・reghook_cache_init()・reghook_dump_cache()・svcctl_init_keys().
参照元 main().
00109 { 00110 int i; 00111 00112 00113 if ( !regdb_init() ) { 00114 DEBUG(0,("init_registry: failed to initialize the registry tdb!\n")); 00115 return False; 00116 } 00117 00118 /* build the cache tree of registry hooks */ 00119 00120 reghook_cache_init(); 00121 00122 for ( i=0; reg_hooks[i].keyname; i++ ) { 00123 if ( !reghook_cache_add(®_hooks[i]) ) 00124 return False; 00125 } 00126 00127 if ( DEBUGLEVEL >= 20 ) 00128 reghook_dump_cache(20); 00129 00130 /* add any keys for other services */ 00131 00132 svcctl_init_keys(); 00133 eventlog_init_keys(); 00134 perfcount_init_keys(); 00135 00136 /* close and let each smbd open up as necessary */ 00137 00138 regdb_close(); 00139 00140 return True; 00141 }
BOOL store_reg_keys | ( | REGISTRY_KEY * | key, | |
REGSUBKEY_CTR * | subkeys | |||
) |
reg_frontend.c の 147 行で定義されています。
参照先 _RegistryKey::hook・_RegistryKey::name・REGISTRY_HOOK::ops・REGISTRY_OPS::store_subkeys.
参照元 _reg_create_key_ex()・_reg_delete_key()・add_new_svc_name()・reg_load_tree().
00148 { 00149 if ( key->hook && key->hook->ops && key->hook->ops->store_subkeys ) 00150 return key->hook->ops->store_subkeys( key->name, subkeys ); 00151 00152 return False; 00153 00154 }
BOOL store_reg_values | ( | REGISTRY_KEY * | key, | |
REGVAL_CTR * | val | |||
) |
reg_frontend.c の 160 行で定義されています。
参照先 check_dynamic_reg_values()・_RegistryKey::hook・_RegistryKey::name・REGISTRY_HOOK::ops・REGISTRY_OPS::store_values.
参照元 _reg_delete_value()・_reg_set_value()・add_new_svc_name()・reg_load_tree()・svcctl_set_secdesc().
00161 { 00162 if ( check_dynamic_reg_values( key ) ) 00163 return False; 00164 00165 if ( key->hook && key->hook->ops && key->hook->ops->store_values ) 00166 return key->hook->ops->store_values( key->name, val ); 00167 00168 return False; 00169 }
int fetch_reg_keys | ( | REGISTRY_KEY * | key, | |
REGSUBKEY_CTR * | subkey_ctr | |||
) |
reg_frontend.c の 177 行で定義されています。
参照先 REGISTRY_OPS::fetch_subkeys・_RegistryKey::hook・_RegistryKey::name・REGISTRY_HOOK::ops・result.
参照元 _reg_create_key_ex()・_reg_delete_key()・add_new_svc_name()・fetch_reg_keys_specific()・get_subkey_information()・reg_write_tree()・regkey_open_internal()・svcctl_init_keys().
00178 { 00179 int result = -1; 00180 00181 if ( key->hook && key->hook->ops && key->hook->ops->fetch_subkeys ) 00182 result = key->hook->ops->fetch_subkeys( key->name, subkey_ctr ); 00183 00184 return result; 00185 }
BOOL fetch_reg_keys_specific | ( | REGISTRY_KEY * | key, | |
char ** | subkey, | |||
uint32 | key_index | |||
) |
reg_frontend.c の 192 行で定義されています。
参照先 fetch_reg_keys()・_RegistryKey::name・regsubkey_ctr_specific_key()・StrCaseCmp().
参照元 _reg_enum_key().
00193 { 00194 static REGSUBKEY_CTR *ctr = NULL; 00195 static pstring save_path; 00196 char *s; 00197 00198 *subkey = NULL; 00199 00200 /* simple caching for performance; very basic heuristic */ 00201 00202 DEBUG(8,("fetch_reg_keys_specific: Looking for key [%d] of [%s]\n", key_index, key->name)); 00203 00204 if ( !ctr ) { 00205 DEBUG(8,("fetch_reg_keys_specific: Initializing cache of subkeys for [%s]\n", key->name)); 00206 00207 if ( !(ctr = TALLOC_ZERO_P( NULL, REGSUBKEY_CTR )) ) { 00208 DEBUG(0,("fetch_reg_keys_specific: talloc() failed!\n")); 00209 return False; 00210 } 00211 00212 pstrcpy( save_path, key->name ); 00213 00214 if ( fetch_reg_keys( key, ctr) == -1 ) 00215 return False; 00216 00217 } 00218 /* clear the cache when key_index == 0 or the path has changed */ 00219 else if ( !key_index || StrCaseCmp( save_path, key->name) ) { 00220 00221 DEBUG(8,("fetch_reg_keys_specific: Updating cache of subkeys for [%s]\n", key->name)); 00222 00223 TALLOC_FREE( ctr ); 00224 00225 if ( !(ctr = TALLOC_ZERO_P( NULL, REGSUBKEY_CTR )) ) { 00226 DEBUG(0,("fetch_reg_keys_specific: talloc() failed!\n")); 00227 return False; 00228 } 00229 00230 pstrcpy( save_path, key->name ); 00231 00232 if ( fetch_reg_keys( key, ctr) == -1 ) 00233 return False; 00234 } 00235 00236 if ( !(s = regsubkey_ctr_specific_key( ctr, key_index )) ) 00237 return False; 00238 00239 *subkey = SMB_STRDUP( s ); 00240 00241 return True; 00242 }
int fetch_reg_values | ( | REGISTRY_KEY * | key, | |
REGVAL_CTR * | val | |||
) |
reg_frontend.c の 248 行で定義されています。
参照先 fetch_dynamic_reg_values()・REGISTRY_OPS::fetch_values・_RegistryKey::hook・_RegistryKey::name・REGISTRY_HOOK::ops・result.
参照元 _reg_delete_value()・_reg_set_value()・fetch_reg_values_specific()・get_value_information()・reg_write_tree()・svcctl_fetch_regvalues()・svcctl_get_secdesc()・svcctl_lookup_description()・svcctl_lookup_dispname()・sync_eventlog_params().
00249 { 00250 int result = -1; 00251 00252 if ( key->hook && key->hook->ops && key->hook->ops->fetch_values ) 00253 result = key->hook->ops->fetch_values( key->name, val ); 00254 00255 /* if the backend lookup returned no data, try the dynamic overlay */ 00256 00257 if ( result == 0 ) { 00258 result = fetch_dynamic_reg_values( key, val ); 00259 00260 return ( result != -1 ) ? result : 0; 00261 } 00262 00263 return result; 00264 }
BOOL fetch_reg_values_specific | ( | REGISTRY_KEY * | key, | |
REGISTRY_VALUE ** | val, | |||
uint32 | val_index | |||
) |
reg_frontend.c の 272 行で定義されています。
参照先 dup_registry_value()・fetch_reg_values()・_RegistryKey::name・regval_ctr_specific_value()・strequal().
参照元 _reg_enum_value()・_reg_query_value().
00273 { 00274 static REGVAL_CTR *ctr = NULL; 00275 static pstring save_path; 00276 REGISTRY_VALUE *v; 00277 00278 *val = NULL; 00279 00280 /* simple caching for performance; very basic heuristic */ 00281 00282 if ( !ctr ) { 00283 DEBUG(8,("fetch_reg_values_specific: Initializing cache of values for [%s]\n", key->name)); 00284 00285 if ( !(ctr = TALLOC_ZERO_P( NULL, REGVAL_CTR )) ) { 00286 DEBUG(0,("fetch_reg_values_specific: talloc() failed!\n")); 00287 return False; 00288 } 00289 00290 pstrcpy( save_path, key->name ); 00291 00292 if ( fetch_reg_values( key, ctr) == -1 ) 00293 return False; 00294 } 00295 /* clear the cache when val_index == 0 or the path has changed */ 00296 else if ( !val_index || !strequal(save_path, key->name) ) { 00297 00298 DEBUG(8,("fetch_reg_values_specific: Updating cache of values for [%s]\n", key->name)); 00299 00300 TALLOC_FREE( ctr ); 00301 00302 if ( !(ctr = TALLOC_ZERO_P( NULL, REGVAL_CTR )) ) { 00303 DEBUG(0,("fetch_reg_values_specific: talloc() failed!\n")); 00304 return False; 00305 } 00306 00307 pstrcpy( save_path, key->name ); 00308 00309 if ( fetch_reg_values( key, ctr) == -1 ) 00310 return False; 00311 } 00312 00313 if ( !(v = regval_ctr_specific_value( ctr, val_index )) ) 00314 return False; 00315 00316 *val = dup_registry_value( v ); 00317 00318 return True; 00319 }
BOOL regkey_access_check | ( | REGISTRY_KEY * | key, | |
uint32 | requested, | |||
uint32 * | granted, | |||
NT_USER_TOKEN * | token | |||
) |
reg_frontend.c の 326 行で定義されています。
参照先 construct_registry_sd()・get_talloc_ctx()・_RegistryKey::hook・_RegistryKey::name・REGISTRY_HOOK::ops・REGISTRY_OPS::reg_access_check・registry_access_check()・status.
00327 { 00328 /* use the default security check if the backend has not defined its own */ 00329 00330 if ( !(key->hook && key->hook->ops && key->hook->ops->reg_access_check) ) { 00331 SEC_DESC *sec_desc; 00332 NTSTATUS status; 00333 00334 if ( !(sec_desc = construct_registry_sd( get_talloc_ctx() )) ) 00335 return False; 00336 00337 status = registry_access_check( sec_desc, token, requested, granted ); 00338 00339 return NT_STATUS_IS_OK(status); 00340 } 00341 00342 return key->hook->ops->reg_access_check( key->name, requested, granted, token ); 00343 }
WERROR regkey_open_internal | ( | REGISTRY_KEY ** | regkey, | |
const char * | path, | |||
NT_USER_TOKEN * | token, | |||
uint32 | access_desired | |||
) |
reg_frontend.c の 348 行で定義されています。
参照先 _RegistryKey::access_granted・fetch_reg_keys()・_RegistryKey::hook・_RegistryKey::name・regdb_close()・regdb_open()・reghook_cache_find()・regkey_access_check()・regkey_close_internal()・result・StrnCaseCmp()・talloc_strdup()・_RegistryKey::type.
参照元 add_new_svc_name()・open_registry_key()・svcctl_fetch_regvalues()・svcctl_get_secdesc()・svcctl_init_keys()・svcctl_lookup_description()・svcctl_lookup_dispname()・svcctl_set_secdesc()・sync_eventlog_params().
00350 { 00351 WERROR result = WERR_OK; 00352 REGISTRY_KEY *keyinfo; 00353 REGSUBKEY_CTR *subkeys = NULL; 00354 uint32 access_granted; 00355 00356 if ( !(W_ERROR_IS_OK(result = regdb_open()) ) ) 00357 return result; 00358 00359 DEBUG(7,("regkey_open_internal: name = [%s]\n", path)); 00360 00361 if ( !(*regkey = TALLOC_ZERO_P(NULL, REGISTRY_KEY)) ) { 00362 regdb_close(); 00363 return WERR_NOMEM; 00364 } 00365 00366 keyinfo = *regkey; 00367 00368 /* initialization */ 00369 00370 keyinfo->type = REG_KEY_GENERIC; 00371 if (!(keyinfo->name = talloc_strdup(keyinfo, path))) { 00372 result = WERR_NOMEM; 00373 goto done; 00374 } 00375 00376 /* Tag this as a Performance Counter Key */ 00377 00378 if( StrnCaseCmp(path, KEY_HKPD, strlen(KEY_HKPD)) == 0 ) 00379 keyinfo->type = REG_KEY_HKPD; 00380 00381 /* Look up the table of registry I/O operations */ 00382 00383 if ( !(keyinfo->hook = reghook_cache_find( keyinfo->name )) ) { 00384 DEBUG(0,("open_registry_key: Failed to assigned a REGISTRY_HOOK to [%s]\n", 00385 keyinfo->name )); 00386 result = WERR_BADFILE; 00387 goto done; 00388 } 00389 00390 /* check if the path really exists; failed is indicated by -1 */ 00391 /* if the subkey count failed, bail out */ 00392 00393 if ( !(subkeys = TALLOC_ZERO_P( keyinfo, REGSUBKEY_CTR )) ) { 00394 result = WERR_NOMEM; 00395 goto done; 00396 } 00397 00398 if ( fetch_reg_keys( keyinfo, subkeys ) == -1 ) { 00399 result = WERR_BADFILE; 00400 goto done; 00401 } 00402 00403 TALLOC_FREE( subkeys ); 00404 00405 if ( !regkey_access_check( keyinfo, access_desired, &access_granted, token ) ) { 00406 result = WERR_ACCESS_DENIED; 00407 goto done; 00408 } 00409 00410 keyinfo->access_granted = access_granted; 00411 00412 done: 00413 if ( !W_ERROR_IS_OK(result) ) { 00414 regkey_close_internal( *regkey ); 00415 } 00416 00417 return result; 00418 }
WERROR regkey_close_internal | ( | REGISTRY_KEY * | key | ) |
reg_frontend.c の 423 行で定義されています。
参照先 regdb_close().
参照元 add_new_svc_name()・free_regkey_info()・open_registry_key()・regkey_open_internal()・svcctl_fetch_regvalues()・svcctl_get_secdesc()・svcctl_init_keys()・svcctl_lookup_description()・svcctl_lookup_dispname()・svcctl_set_secdesc()・sync_eventlog_params().
00424 { 00425 TALLOC_FREE( key ); 00426 regdb_close(); 00427 00428 return WERR_OK; 00429 }
reg_printing.c の 1237 行で定義されています。
reg_shares.c の 158 行で定義されています。
初期値:
{ #ifndef REG_TDB_ONLY { KEY_PRINTING, &printing_ops }, { KEY_PRINTING_2K, &printing_ops }, { KEY_PRINTING_PORTS, &printing_ops }, { KEY_SHARES, &shares_reg_ops }, #endif { NULL, NULL } }
reg_frontend.c の 36 行で定義されています。
参照元 init_registry().
struct generic_mapping reg_generic_map [static] |