Lines Matching refs:handles

140 prop_exists(idmap_cfg_handles_t *handles, const char *name, boolean_t *exists)  in prop_exists()  argument
147 scf_prop = scf_property_create(handles->main); in prop_exists()
154 if (scf_pg_get_property(handles->config_pg, name, scf_prop) == 0) in prop_exists()
163 get_debug(idmap_cfg_handles_t *handles, const char *name) in get_debug() argument
170 scf_prop = scf_property_create(handles->main); in get_debug()
176 value = scf_value_create(handles->main); in get_debug()
183 if (scf_pg_get_property(handles->debug_pg, name, scf_prop) < 0) { in get_debug()
208 get_val_bool(idmap_cfg_handles_t *handles, const char *name, in get_val_bool() argument
218 scf_prop = scf_property_create(handles->main); in get_val_bool()
224 value = scf_value_create(handles->main); in get_val_bool()
233 if (scf_pg_get_property(handles->config_pg, name, scf_prop) < 0) in get_val_bool()
255 get_val_int(idmap_cfg_handles_t *handles, const char *name, in get_val_int() argument
276 scf_prop = scf_property_create(handles->main); in get_val_int()
282 value = scf_value_create(handles->main); in get_val_int()
290 if (scf_pg_get_property(handles->config_pg, name, scf_prop) < 0) in get_val_int()
346 get_val_ds(idmap_cfg_handles_t *handles, const char *name, int defport, in get_val_ds() argument
361 scf_prop = scf_property_create(handles->main); in get_val_ds()
368 value = scf_value_create(handles->main); in get_val_ds()
376 iter = scf_iter_create(handles->main); in get_val_ds()
385 if (scf_pg_get_property(handles->config_pg, name, scf_prop) < 0) { in get_val_ds()
465 get_val_astring(idmap_cfg_handles_t *handles, const char *name, char **val) in get_val_astring() argument
472 scf_prop = scf_property_create(handles->main); in get_val_astring()
478 value = scf_value_create(handles->main); in get_val_astring()
488 if (scf_pg_get_property(handles->config_pg, name, scf_prop) < 0) in get_val_astring()
520 idmap_cfg_handles_t *handles, in del_val() argument
529 if ((tx = scf_transaction_create(handles->main)) == NULL) { in del_val()
535 if ((ent = scf_entry_create(handles->main)) == NULL) { in del_val()
593 idmap_cfg_handles_t *handles, in set_val() argument
604 if ((prop = scf_property_create(handles->main)) == NULL || in set_val()
605 (tx = scf_transaction_create(handles->main)) == NULL || in set_val()
606 (ent = scf_entry_create(handles->main)) == NULL) { in set_val()
694 idmap_cfg_handles_t *handles, in set_val_integer() argument
702 if ((value = scf_value_create(handles->main)) == NULL) { in set_val_integer()
710 rc = set_val(handles, pg, name, value); in set_val_integer()
720 idmap_cfg_handles_t *handles, in set_val_astring() argument
728 if ((value = scf_value_create(handles->main)) == NULL) { in set_val_astring()
741 rc = set_val(handles, pg, name, value); in set_val_astring()
1247 const ad_disc_t ad_ctx = _idmapdstate.cfg->handles.ad_ctx; in idmap_cfg_update_thread()
1387 idmap_cfg_handles_t *handles, in idmapd_set_debug() argument
1396 val = get_debug(handles, name); in idmapd_set_debug()
1406 check_smf_debug_mode(idmap_cfg_handles_t *handles) in check_smf_debug_mode() argument
1408 idmapd_set_debug(handles, IDMAPD_DEBUG_ALL, "all"); in check_smf_debug_mode()
1409 idmapd_set_debug(handles, IDMAPD_DEBUG_CONFIG, "config"); in check_smf_debug_mode()
1410 idmapd_set_debug(handles, IDMAPD_DEBUG_MAPPING, "mapping"); in check_smf_debug_mode()
1411 idmapd_set_debug(handles, IDMAPD_DEBUG_DISC, "discovery"); in check_smf_debug_mode()
1412 idmapd_set_debug(handles, IDMAPD_DEBUG_DNS, "dns"); in check_smf_debug_mode()
1413 idmapd_set_debug(handles, IDMAPD_DEBUG_LDAP, "ldap"); in check_smf_debug_mode()
1431 idmap_cfg_load_smf(idmap_cfg_handles_t *handles, idmap_pg_config_t *pgcfg, in idmap_cfg_load_smf() argument
1439 if (scf_pg_update(handles->config_pg) < 0) { in idmap_cfg_load_smf()
1445 if (scf_pg_update(handles->debug_pg) < 0) { in idmap_cfg_load_smf()
1451 check_smf_debug_mode(handles); in idmap_cfg_load_smf()
1453 rc = get_val_bool(handles, "unresolvable_sid_mapping", in idmap_cfg_load_smf()
1458 rc = get_val_bool(handles, "use_ads", in idmap_cfg_load_smf()
1463 rc = get_val_bool(handles, "use_lsa", in idmap_cfg_load_smf()
1468 rc = get_val_bool(handles, "disable_cross_forest_trusts", in idmap_cfg_load_smf()
1473 rc = get_val_astring(handles, "directory_based_mapping", &s); in idmap_cfg_load_smf()
1491 rc = get_val_int(handles, "list_size_limit", in idmap_cfg_load_smf()
1496 rc = get_val_int(handles, "id_cache_timeout", in idmap_cfg_load_smf()
1503 rc = get_val_int(handles, "name_cache_timeout", in idmap_cfg_load_smf()
1510 rc = get_val_astring(handles, "domain_name", in idmap_cfg_load_smf()
1520 (void) ad_disc_set_DomainName(handles->ad_ctx, in idmap_cfg_load_smf()
1525 rc = get_val_astring(handles, "default_domain", in idmap_cfg_load_smf()
1540 rc = get_val_astring(handles, "machine_sid", &pgcfg->machine_sid); in idmap_cfg_load_smf()
1547 rc = set_val_astring(handles, handles->config_pg, in idmap_cfg_load_smf()
1553 rc = get_val_ds(handles, "domain_controller", 389, in idmap_cfg_load_smf()
1558 (void) ad_disc_set_DomainController(handles->ad_ctx, in idmap_cfg_load_smf()
1563 rc = get_val_astring(handles, "forest_name", &pgcfg->forest_name); in idmap_cfg_load_smf()
1567 (void) ad_disc_set_ForestName(handles->ad_ctx, in idmap_cfg_load_smf()
1572 rc = get_val_astring(handles, "site_name", &pgcfg->site_name); in idmap_cfg_load_smf()
1576 (void) ad_disc_set_SiteName(handles->ad_ctx, pgcfg->site_name); in idmap_cfg_load_smf()
1578 rc = get_val_ds(handles, "global_catalog", 3268, in idmap_cfg_load_smf()
1583 (void) ad_disc_set_GlobalCatalog(handles->ad_ctx, in idmap_cfg_load_smf()
1592 rc = get_val_astring(handles, "ad_unixuser_attr", in idmap_cfg_load_smf()
1603 rc = get_val_astring(handles, "ad_unixgroup_attr", in idmap_cfg_load_smf()
1614 rc = get_val_astring(handles, "nldap_winname_attr", in idmap_cfg_load_smf()
1801 idmap_cfg_discover(idmap_cfg_handles_t *handles, idmap_pg_config_t *pgcfg) in idmap_cfg_discover() argument
1803 ad_disc_t ad_ctx = handles->ad_ctx; in idmap_cfg_discover()
1904 (void) pthread_mutex_lock(&cfg->handles.mutex); in idmap_cfg_load()
1906 if ((rc = idmap_cfg_load_smf(&cfg->handles, &new_pgcfg, &errors)) < -1) in idmap_cfg_load()
1910 idmap_cfg_discover(&cfg->handles, &new_pgcfg); in idmap_cfg_load()
2021 (void) pthread_mutex_unlock(&cfg->handles.mutex); in idmap_cfg_load()
2035 idmap_cfg_handles_t *handles; in idmap_cfg_init() local
2043 handles = &cfg->handles; in idmap_cfg_init()
2045 (void) pthread_mutex_init(&handles->mutex, NULL); in idmap_cfg_init()
2047 if (!(handles->main = scf_handle_create(SCF_VERSION))) { in idmap_cfg_init()
2053 if (scf_handle_bind(handles->main) < 0) { in idmap_cfg_init()
2059 if (!(handles->service = scf_service_create(handles->main)) || in idmap_cfg_init()
2060 !(handles->instance = scf_instance_create(handles->main)) || in idmap_cfg_init()
2061 !(handles->config_pg = scf_pg_create(handles->main)) || in idmap_cfg_init()
2062 !(handles->debug_pg = scf_pg_create(handles->main))) { in idmap_cfg_init()
2068 if (scf_handle_decode_fmri(handles->main, in idmap_cfg_init()
2071 handles->service, /* service */ in idmap_cfg_init()
2072 handles->instance, /* instance */ in idmap_cfg_init()
2073 handles->config_pg, /* pg */ in idmap_cfg_init()
2081 if (scf_service_get_pg(handles->service, in idmap_cfg_init()
2082 DEBUG_PG, handles->debug_pg) < 0) { in idmap_cfg_init()
2088 check_smf_debug_mode(handles); in idmap_cfg_init()
2091 handles->ad_ctx = ad_disc_init(); in idmap_cfg_init()
2092 if (handles->ad_ctx == NULL) in idmap_cfg_init()
2159 idmap_cfg_handles_t *handles = &cfg->handles; in idmap_cfg_fini() local
2162 (void) pthread_mutex_destroy(&handles->mutex); in idmap_cfg_fini()
2163 scf_pg_destroy(handles->config_pg); in idmap_cfg_fini()
2164 if (handles->debug_pg != NULL) in idmap_cfg_fini()
2165 scf_pg_destroy(handles->debug_pg); in idmap_cfg_fini()
2166 scf_instance_destroy(handles->instance); in idmap_cfg_fini()
2167 scf_service_destroy(handles->service); in idmap_cfg_fini()
2168 scf_handle_destroy(handles->main); in idmap_cfg_fini()
2169 if (handles->ad_ctx != NULL) in idmap_cfg_fini()
2170 ad_disc_fini(handles->ad_ctx); in idmap_cfg_fini()
2200 upgrade_debug(idmap_cfg_handles_t *handles) in upgrade_debug() argument
2206 rc = prop_exists(handles, DEBUG_PROP, &debug_present); in upgrade_debug()
2218 rc = set_val_integer(handles, handles->debug_pg, "config", 1); in upgrade_debug()
2221 rc = set_val_integer(handles, handles->debug_pg, "discovery", 1); in upgrade_debug()
2225 rc = del_val(handles, handles->config_pg, DEBUG_PROP); in upgrade_debug()
2245 upgrade_directory_mapping(idmap_cfg_handles_t *handles) in upgrade_directory_mapping() argument
2252 rc = prop_exists(handles, DS_NAME_MAPPING_ENABLED, in upgrade_directory_mapping()
2262 rc = get_val_bool(handles, DS_NAME_MAPPING_ENABLED, in upgrade_directory_mapping()
2278 rc = get_val_astring(handles, DIRECTORY_BASED_MAPPING, in upgrade_directory_mapping()
2289 rc = set_val_astring(handles, handles->config_pg, in upgrade_directory_mapping()
2316 rc = del_val(handles, handles->config_pg, DS_NAME_MAPPING_ENABLED); in upgrade_directory_mapping()
2332 rc = upgrade_directory_mapping(&cfg->handles); in idmap_cfg_upgrade()
2336 rc = upgrade_debug(&cfg->handles); in idmap_cfg_upgrade()