svccfg_libscf.c revision 3534c68111163b60e274fa816769616d177a08b7
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * CDDL HEADER START
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The contents of this file are subject to the terms of the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Common Development and Distribution License (the "License").
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * You may not use this file except in compliance with the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * See the License for the specific language governing permissions
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * and limitations under the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * When distributing Covered Code, include this CDDL HEADER in each
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * If applicable, add the following below this CDDL HEADER, with the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * fields enclosed by brackets "[]" replaced with your own identifying
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * information: Portions Copyright [yyyy] [name of copyright owner]
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * CDDL HEADER END
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Use is subject to license terms.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster/* The colon namespaces in each entity (each followed by a newline). */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster/* These are characters which the lexer requires to be in double-quotes. */
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Madden * Indentation used in the output of the describe subcommand.
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Madden * These are the classes of elements which may appear as children of service
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Madden * or instance elements in XML manifests.
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Madden * Likewise for property_group elements.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Likewise for template elements.
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Madden * This structure is for snaplevel lists. They are convenient because libscf
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Madden * only allows traversing snaplevels in one direction.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * This is used for communication between lscf_service_export and
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * export_callback.
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Maddenconst char * const scf_pg_general = SCF_PG_GENERAL;
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Maddenconst char * const scf_group_framework = SCF_GROUP_FRAMEWORK;
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Maddenconst char * const scf_property_enabled = SCF_PROPERTY_ENABLED;
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Maddenconst char * const scf_property_external = "external";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterconst char * const snap_lastimport = "last-import";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterscf_handle_t *g_hndl = NULL; /* only valid after lscf_prep_hndl() */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster/* cur_levels is the snaplevels of cur_snap, from least specific to most. */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterstatic struct snaplevel *cur_elt; /* cur_elt->sl == cur_level */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterstatic char tempfilename[sizeof (TEMP_FILE_PATTERN)] = "";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterstatic const char *emsg_entity_not_selected;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterstatic const char *emsg_permission_denied;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterstatic const char *emsg_create_xml;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterstatic const char *emsg_cant_modify_snapshots;
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Maddenstatic const char *emsg_read_only;
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Maddenstatic const char *emsg_deleted;
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Maddenstatic const char *emsg_invalid_pg_name;
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Maddenstatic const char *emsg_invalid_prop_name;
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Maddenstatic const char *emsg_no_such_pg;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterstatic const char *emsg_fmri_invalid_pg_name;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterstatic const char *emsg_fmri_invalid_pg_name_type;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterstatic const char *emsg_pg_added;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterstatic const char *emsg_pg_changed;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterstatic const char *emsg_pg_deleted;
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Maddenstatic const char *emsg_pg_mod_perm;
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Maddenstatic const char *emsg_pg_add_perm;
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Maddenstatic const char *emsg_pg_del_perm;
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Maddenstatic const char *emsg_snap_perm;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterstatic const char *emsg_dpt_dangling;
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Maddenstatic const char *emsg_dpt_no_dep;
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Maddenstatic int no_refresh = 0;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster/* import globals, to minimize allocations */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterstatic scf_service_t *imp_svc = NULL, *imp_tsvc = NULL;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterstatic scf_instance_t *imp_inst = NULL, *imp_tinst = NULL;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterstatic scf_snapshot_t *imp_snap = NULL, *imp_lisnap = NULL, *imp_tlisnap = NULL;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterstatic scf_snaplevel_t *imp_snpl = NULL, *imp_rsnpl = NULL;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterstatic scf_propertygroup_t *imp_pg = NULL, *imp_pg2 = NULL;
8787952fc8d6ed4f8a90799eda5a967f77ca6899Sachiko Wallacestatic scf_transaction_t *imp_tx = NULL; /* always reset this */
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Maddenstatic char *imp_fe1 = NULL; /* for fmri_equal() */
8787952fc8d6ed4f8a90799eda5a967f77ca6899Sachiko Wallacestatic uu_list_t *imp_deleted_dpts = NULL; /* pgroup_t's to refresh */
8787952fc8d6ed4f8a90799eda5a967f77ca6899Sachiko Wallace/* upgrade_dependents() globals */
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Maddenstatic scf_propertygroup_t *ud_cur_depts_pg = NULL;
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Maddenstatic scf_propertygroup_t *ud_run_dpts_pg = NULL;
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Maddenstatic scf_iter_t *ud_iter = NULL, *ud_iter2 = NULL;
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Madden/* export globals */
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Maddenstatic scf_iter_t *exp_inst_iter, *exp_pg_iter, *exp_prop_iter, *exp_val_iter;
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Maddenstatic void scfdie_lineno(int lineno) __NORETURN;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterstatic char *start_method_names[] = {
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Madden "inetd_start",
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * For unexpected libscf errors.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster uu_die(gettext("Repository connection broken. Exiting.\n"));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster uu_die(gettext("Unexpected fatal libscf error: %s. Exiting.\n"),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster uu_die(gettext("Repository connection broken. Exiting.\n"));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster uu_die(gettext("Unexpected libscf error on line %d of " __FILE__
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Madden * Clear a field of a structure.
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Maddenclear_int(void *a, void *b)
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Madden /* LINTED */
1cac1ee7899eb898195d39d1d77f78d29ae76bbfNeil Madden *(int *)((char *)a + (size_t)b) = 0;
return (EINVAL);
case SCF_ERROR_DELETED:
return (ECANCELED);
case SCF_ERROR_EXISTS:
return (EEXIST);
case SCF_ERROR_NO_MEMORY:
return (ENOMEM);
case SCF_ERROR_NO_RESOURCES:
return (ENOSPC);
case SCF_ERROR_NOT_FOUND:
return (ENOENT);
return (EPERM);
#ifndef NDEBUG
abort();
if (issvc)
if (issvc)
int ret;
return (ret);
switch (scf_error()) {
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
scf_error());
if (ssz >= 0) {
if (!get_svc)
switch (scf_error()) {
if (get_svc)
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_SET:
case SCF_ERROR_NOT_BOUND:
scf_error());
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
scf_error());
if (issvc) {
switch (scf_error()) {
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_SET:
case SCF_ERROR_NOT_BOUND:
scf_error());
switch (scf_error()) {
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
scf_error());
switch (scf_error()) {
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_SET:
case SCF_ERROR_NOT_BOUND:
scf_error());
snap) == 0)
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_DELETED:
return (ECONNABORTED);
case SCF_ERROR_NOT_SET:
case SCF_ERROR_NOT_BOUND:
scf_error());
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
scf_error());
switch (scf_error()) {
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
case ECONNABORTED:
case ECANCELED:
case ENOENT:
return (EBADF);
switch (scf_error()) {
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
remove_tempfile(void)
int ret;
* Launch private svc.configd(1M) for manipulating alternate repositories.
if (fd < 0)
NULL);
stat);
if (fd < 0)
lscf_cleanup(void)
* In the case where we've launched a private svc.configd(1M)
unselect_cursnap(void)
void *cookie;
lscf_prep_hndl(void)
scfdie();
int ret;
scfdie();
scfdie();
scfdie();
scfdie();
repository_teardown(void)
lscf_cleanup();
scfdie();
NULL, 0);
scfdie();
static scf_type_t
char *buf;
return (SCF_TYPE_INVALID);
static scf_value_t *
scf_value_t *v;
if (v == NULL)
scfdie();
if (require_quotes &&
return (NULL);
v = NULL;
const char *cp;
scfdie();
if (g_verbose) {
char *fmri;
if (len < 0)
scfdie();
scfdie();
scfdie();
if (g_verbose) {
char *fmri;
const char *tystr;
if (len < 0)
scfdie();
scfdie();
scfdie();
if (g_verbose) {
if (len < 0)
scfdie();
scfdie();
static boolean_t
scfdie();
static scf_error_t
char *fmri_copy;
return (SCF_ERROR_NO_MEMORY);
SCF_SUCCESS) {
return (SCF_ERROR_INVALID_ARGUMENT);
return (SCF_ERROR_CONSTRAINT_VIOLATED);
return (SCF_ERROR_NO_MEMORY);
scfdie();
return (SCF_ERROR_NOT_FOUND);
return (SCF_ERROR_NO_MEMORY);
scfdie();
return (SCF_ERROR_NOT_FOUND);
*isservice = 0;
return (SCF_ERROR_NONE);
static scf_error_t
char *fmri_copy;
return (SCF_ERROR_INVALID_ARGUMENT);
return (SCF_ERROR_CONSTRAINT_VIOLATED);
goto out;
switch (scf_error()) {
scfdie();
case SCF_ERROR_NOT_FOUND:
goto out;
case SCF_ERROR_NOT_BOUND:
switch (scf_error()) {
scfdie();
case SCF_ERROR_DELETED:
goto get_scope;
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
switch (scf_error()) {
scfdie();
case SCF_ERROR_DELETED:
goto get_scope;
case SCF_ERROR_BACKEND_ACCESS:
goto out;
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
goto out;
switch (scf_error()) {
scfdie();
case SCF_ERROR_DELETED:
goto get_svc;
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
switch (scf_error()) {
scfdie();
case SCF_ERROR_DELETED:
goto get_svc;
case SCF_ERROR_BACKEND_ACCESS:
goto out;
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
scf_error());
*isservicep = 0;
out:
return (scfe);
if (!isservice) {
if (g_verbose)
switch (scf_error()) {
case SCF_ERROR_BACKEND_ACCESS:
return (EACCES);
return (EPERM);
switch (scf_error()) {
return (ECONNABORTED);
case SCF_ERROR_DELETED:
return (ECANCELED);
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
switch (scf_error()) {
return (ECONNABORTED);
case SCF_ERROR_DELETED:
return (ECANCELED);
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
scf_error());
if (g_verbose) {
g_verbose) {
return (UU_WALK_ERROR);
switch (scf_error()) {
case SCF_ERROR_NO_RESOURCES:
case SCF_ERROR_NOT_SET:
scf_error());
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
switch (scf_error()) {
case SCF_ERROR_EXISTS:
goto again;
case SCF_ERROR_NO_RESOURCES:
scfwarn();
case SCF_ERROR_NOT_SET:
case SCF_ERROR_INTERNAL:
scf_error());
property_t *p = v;
return (UU_WALK_NEXT);
switch (scf_error()) {
case SCF_ERROR_NO_MEMORY:
switch (scf_error()) {
case SCF_ERROR_EXISTS:
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
switch (scf_error()) {
case SCF_ERROR_DELETED:
p->sc_property_name);
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_NOT_SET:
case SCF_ERROR_NOT_BOUND:
scf_error());
switch (scf_error()) {
case SCF_ERROR_NO_MEMORY:
switch (tp) {
case SCF_TYPE_BOOLEAN:
case SCF_TYPE_COUNT:
case SCF_TYPE_INTEGER:
scf_error());
return (UU_WALK_NEXT);
* ENOSPC - svc.configd is out of resources
pgroup_t *p = v;
if (p->sc_pgroup_delete)
return (UU_WALK_NEXT);
return (UU_WALK_NEXT);
if (issvc)
switch (scf_error()) {
case SCF_ERROR_DELETED:
case SCF_ERROR_BACKEND_ACCESS:
case SCF_ERROR_NO_RESOURCES:
case SCF_ERROR_EXISTS:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
switch (scf_error()) {
case SCF_ERROR_DELETED:
p->sc_pgroup_name);
case SCF_ERROR_NOT_FOUND:
p->sc_pgroup_name);
return (UU_WALK_ERROR);
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
goto props;
switch (scf_error()) {
case SCF_ERROR_DELETED:
p->sc_pgroup_name);
return (UU_WALK_ERROR);
case SCF_ERROR_BACKEND_ACCESS:
case SCF_ERROR_NOT_SET:
goto add_pg;
switch (scf_error()) {
case SCF_ERROR_BACKEND_ACCESS:
case SCF_ERROR_DELETED:
p->sc_pgroup_name);
return (UU_WALK_ERROR);
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
case SCF_ERROR_IN_USE:
UU_DEFAULT) != 0) {
p->sc_pgroup_name);
return (UU_WALK_ERROR);
case ECONNABORTED:
return (UU_WALK_ERROR);
case ECANCELED:
return (UU_WALK_ERROR);
case EPERM:
return (UU_WALK_ERROR);
case ENOSPC:
return (UU_WALK_ERROR);
if (r != UU_WALK_NEXT) {
if (r != UU_WALK_ERROR)
return (EINVAL);
r = UU_WALK_NEXT;
r = UU_WALK_ERROR;
switch (scf_error()) {
case SCF_ERROR_BACKEND_ACCESS:
case SCF_ERROR_NO_RESOURCES:
case SCF_ERROR_DELETED:
p->sc_pgroup_name);
r = UU_WALK_ERROR;
case SCF_ERROR_NOT_SET:
case SCF_ERROR_NOT_BOUND:
* ENOSPC - svc.configd is out of resources
UU_DEFAULT) != 0) {
!= UU_WALK_NEXT)
int new)
new);
if (new)
int is_general;
int is_protected;
p != NULL;
is_protected = 0;
if (is_general) {
SCF_PROPERTY_RESTARTER) == 0)
goto upgrade;
if (is_protected)
if (is_protected)
if (is_protected) {
if (speak)
if (speak)
p->sc_property_name);
if (e == NULL)
return (ENOMEM);
p->sc_property_name) != 0) {
switch (scf_error()) {
case SCF_ERROR_DELETED:
return (ECANCELED);
return (ECONNABORTED);
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
scf_error());
if (speak)
p->sc_property_name);
if (r != UU_WALK_NEXT) {
if (r != UU_WALK_ERROR)
return (EINVAL);
if (r != UU_WALK_NEXT) {
if (r != UU_WALK_ERROR)
return (EINVAL);
* ENOSPC - svc.configd is out of resources
switch (scf_error()) {
case SCF_ERROR_DELETED:
case SCF_ERROR_BACKEND_ACCESS:
case SCF_ERROR_IN_USE:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
case EINVAL:
case ENOMEM:
return (EBUSY);
switch (scf_error()) {
case SCF_ERROR_NO_RESOURCES:
case SCF_ERROR_BACKEND_ACCESS:
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
int isservice;
int ret;
switch (scfe) {
case SCF_ERROR_NONE:
case SCF_ERROR_NO_MEMORY:
case SCF_ERROR_NOT_FOUND:
switch (scfe) {
case SCF_ERROR_NONE:
case SCF_ERROR_NO_MEMORY:
case SCF_ERROR_BACKEND_ACCESS:
case SCF_ERROR_NOT_FOUND:
return (UU_WALK_ERROR);
if (e == NULL) {
switch (scf_error()) {
case SCF_ERROR_DELETED:
case SCF_ERROR_EXISTS:
return (UU_WALK_ERROR);
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
scf_error());
return (ret);
case ECANCELED:
case EEXIST:
return (UU_WALK_ERROR);
const pgroup_t *);
int have_cur_depts;
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_SET:
case SCF_ERROR_NOT_BOUND:
have_cur_depts = 0;
ud_run_dpts_pg_set = 0;
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_SET:
case SCF_ERROR_NOT_BOUND:
switch (scf_error()) {
case SCF_ERROR_DELETED:
return (ENODEV);
return (ECONNABORTED);
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
scf_error());
if (have_cur_depts &&
switch (scf_error()) {
case SCF_ERROR_BACKEND_ACCESS:
case SCF_ERROR_DELETED:
return (EBUSY);
case SCF_ERROR_IN_USE:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
case ECONNABORTED:
case ENOMEM:
case ENOSPC:
case EBADF:
case EBUSY:
case EINVAL:
case EPERM:
case EROFS:
case EACCES:
case EEXIST:
case ECANCELED:
r = ENODEV;
if (tx_started)
switch (scf_error()) {
case SCF_ERROR_DELETED:
r = ENODEV;
r = ECONNABORTED;
case SCF_ERROR_NOT_SET:
case SCF_ERROR_NOT_BOUND:
scf_error());
if (tx_started)
unseen = 0;
new_dpt_pgroup)) {
if (unseen == 0)
goto commit;
if (!have_cur_depts) {
if (issvc)
switch (scf_error()) {
case SCF_ERROR_DELETED:
case SCF_ERROR_BACKEND_ACCESS:
case SCF_ERROR_NO_RESOURCES:
case SCF_ERROR_EXISTS:
return (EBUSY);
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
switch (scf_error()) {
case SCF_ERROR_BACKEND_ACCESS:
case SCF_ERROR_DELETED:
return (EBUSY);
case SCF_ERROR_IN_USE:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
new_dpt_pgroup)) {
if (ud_run_dpts_pg_set) {
case ECONNABORTED:
case ENOMEM:
case EBUSY:
case EBADF:
case EINVAL:
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
return (EINVAL);
case SCF_ERROR_DELETED:
return (EBUSY);
return (ECONNABORTED);
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
scf_error());
if (r != UU_WALK_NEXT) {
if (r != UU_WALK_ERROR)
if (!tx_started)
return (EBUSY);
switch (scf_error()) {
case SCF_ERROR_BACKEND_ACCESS:
case SCF_ERROR_NO_RESOURCES:
case SCF_ERROR_DELETED:
return (EBUSY);
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
int tissvc;
void *target_ent;
const char * const li_corrupt =
const char * const upgrading =
switch (scf_error()) {
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
return (EBADF);
switch (scf_error()) {
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
if (!ud_run_dpts_pg_set)
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
return (EBADF);
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
scf_error());
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_DELETED:
return (EBUSY);
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
scf_error());
return (EBADF);
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
return (EBADF);
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
case ECANCELED:
case ECONNABORTED:
case ENOMEM:
case EBADF:
case EACCES:
switch (serr) {
case SCF_ERROR_NONE:
case SCF_ERROR_NO_MEMORY:
return (ENOMEM);
case SCF_ERROR_NOT_FOUND:
goto delprop;
case ECONNABORTED:
case ECANCELED:
case ENOENT:
goto delprop;
case EBADF:
case EINVAL:
case ECANCELED:
goto delprop;
case ECONNABORTED:
case ENOMEM:
case EBADF:
case EACCES:
if (g_verbose)
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_DELETED:
goto delprop;
return (ECONNABORTED);
case SCF_ERROR_NOT_SET:
case SCF_ERROR_NOT_BOUND:
switch (scf_error()) {
case SCF_ERROR_DELETED:
case SCF_ERROR_BACKEND_ACCESS:
case SCF_ERROR_NOT_SET:
return (ENOMEM);
return (ENOMEM);
return (ENOMEM);
switch (scf_error()) {
case SCF_ERROR_DELETED:
return (EBUSY);
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
scf_error());
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
return (EBADF);
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
return (EBADF);
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
case ECANCELED:
case ECONNABORTED:
case ENOMEM:
case EBADF:
case EACCES:
return (EBADF);
return (EINVAL);
goto nocust;
if (!ud_run_dpts_pg_set) {
goto out;
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
goto out;
goto out;
case SCF_ERROR_DELETED:
r = EBUSY;
goto out;
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
goto out;
case SCF_ERROR_DELETED:
goto out;
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
goto out;
goto out;
r = EBADF;
goto out;
goto out;
goto out;
switch (serr) {
case SCF_ERROR_NONE:
case SCF_ERROR_NOT_FOUND:
goto out;
case SCF_ERROR_NO_MEMORY:
r = ENOMEM;
goto out;
case ECONNABORTED:
goto out;
case ECANCELED:
case ENOENT:
goto out;
case EBADF:
goto out;
case EINVAL:
case ECANCELED:
goto out;
case ECONNABORTED:
case ENOMEM:
case EBADF:
goto out;
case EACCES:
goto out;
ud_pg) != 0) {
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
return (EBADF);
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
case ECANCELED:
case ECONNABORTED:
case ENOMEM:
case EBADF:
case EACCES:
switch (serr) {
case SCF_ERROR_NONE:
case SCF_ERROR_NOT_FOUND:
goto out;
case SCF_ERROR_NO_MEMORY:
r = ENOMEM;
goto out;
case ECONNABORTED:
goto out;
case ECANCELED:
case ENOENT:
goto out;
case EBADF:
goto out;
case EINVAL:
case ECANCELED:
goto out;
case ECONNABORTED:
case ENOMEM:
case EBADF:
goto out;
case EACCES:
goto out;
goto out;
switch (scf_error()) {
goto out;
case SCF_ERROR_DELETED:
goto out;
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
if (tissvc)
switch (scf_error()) {
case SCF_ERROR_NO_RESOURCES:
case SCF_ERROR_BACKEND_ACCESS:
goto out;
case SCF_ERROR_DELETED:
ud_name);
goto out;
ud_name);
r = EPERM;
goto out;
case SCF_ERROR_EXISTS:
r = EBUSY;
goto out;
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
case ECANCELED:
goto out;
case ECONNABORTED:
case ENOMEM:
case EBADF:
goto out;
case EACCES:
if (g_verbose)
case ECANCELED:
r = EBUSY;
goto out;
case EPERM:
goto out;
case EBUSY:
goto out;
case ECONNABORTED:
case ENOMEM:
case ENOSPC:
case EROFS:
case EACCES:
case EINVAL:
goto out;
if (g_verbose)
switch (scf_error()) {
goto out;
case SCF_ERROR_DELETED:
goto out;
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
switch (scf_error()) {
case SCF_ERROR_DELETED:
case SCF_ERROR_BACKEND_ACCESS:
goto out;
goto out;
case SCF_ERROR_NOT_SET:
if (r != UU_WALK_NEXT) {
if (r != UU_WALK_ERROR)
goto out;
return (ENOMEM);
SCF_TYPE_FMRI) != 0) {
switch (scf_error()) {
goto out;
case SCF_ERROR_DELETED:
r = EBUSY;
goto out;
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
SCF_TYPE_FMRI) != 0) {
switch (scf_error()) {
goto out;
case SCF_ERROR_DELETED:
r = EBUSY;
goto out;
case SCF_ERROR_EXISTS:
r = EBUSY;
goto out;
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
scf_error());
r = EBADF;
goto out;
out:
void *tptr;
int tissvc;
switch (scf_error()) {
case SCF_ERROR_DELETED:
return (EBUSY);
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
scf_error());
return (EINVAL);
switch (scfe) {
case SCF_ERROR_NONE:
case SCF_ERROR_NO_MEMORY:
return (ENOMEM);
case SCF_ERROR_NOT_FOUND:
case ECONNABORTED:
case ECANCELED:
case EBADF:
if (tissvc)
case ENOENT:
case EINVAL:
return (ENOMEM);
case ECONNABORTED:
case EBADF:
case ENOMEM:
case ECANCELED:
case EACCES:
const char * const cf_pg_missing =
const char * const deleting =
switch (scf_error()) {
case SCF_ERROR_DELETED:
return (ENODEV);
return (ECONNABORTED);
case SCF_ERROR_NOT_SET:
case SCF_ERROR_NOT_BOUND:
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
return (ECONNABORTED);
case SCF_ERROR_DELETED:
return (ENODEV);
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
switch (scf_error()) {
case SCF_ERROR_DELETED:
return (ENODEV);
return (ECONNABORTED);
case SCF_ERROR_NOT_SET:
case SCF_ERROR_NOT_BOUND:
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
if (g_verbose)
switch (scf_error()) {
case SCF_ERROR_DELETED:
case SCF_ERROR_BACKEND_ACCESS:
case SCF_ERROR_NOT_SET:
case ECANCELED:
return (ENODEV);
case ECONNABORTED:
case ENOMEM:
case EBADF:
case EACCES:
case ECANCELED:
case ECONNABORTED:
case ENOMEM:
case EBADF:
case EACCES:
if (g_verbose)
switch (scf_error()) {
case SCF_ERROR_DELETED:
return (ECONNABORTED);
case SCF_ERROR_NOT_SET:
case SCF_ERROR_NOT_BOUND:
case ECANCELED:
return (ENODEV);
case ECONNABORTED:
case EBADF:
case ENOMEM:
case EACCES:
goto out;
switch (scf_error()) {
goto out;
case SCF_ERROR_DELETED:
r = ENODEV;
r = ECANCELED;
goto out;
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
goto out;
case ECANCELED:
goto out;
case ECONNABORTED:
case ENOMEM:
goto out;
goto out;
case ECANCELED:
goto out;
case ECONNABORTED:
case EBADF:
case ENOMEM:
case EACCES:
goto out;
if (g_verbose)
switch (scf_error()) {
case SCF_ERROR_DELETED:
r = ECANCELED;
goto out;
case SCF_ERROR_NOT_FOUND:
do_delete = 0;
goto out;
case SCF_ERROR_NOT_SET:
case SCF_ERROR_NOT_BOUND:
switch (scf_error()) {
case SCF_ERROR_DELETED:
case SCF_ERROR_BACKEND_ACCESS:
goto out;
goto out;
case SCF_ERROR_NOT_SET:
case SCF_ERROR_NOT_BOUND:
case UU_WALK_NEXT:
goto out;
case UU_WALK_ERROR:
r = EBUSY;
goto out;
switch (scf_error()) {
case SCF_ERROR_DELETED:
goto out;
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_NOT_SET:
case SCF_ERROR_NOT_BOUND:
case UU_WALK_NEXT:
goto out;
case UU_WALK_ERROR:
r = EBUSY;
goto out;
case ECANCELED:
r = EBUSY;
case EPERM:
case EBUSY:
case ECONNABORTED:
case ENOMEM:
case ENOSPC:
case EROFS:
case EACCES:
case EINVAL:
out:
switch (scf_error()) {
case SCF_ERROR_DELETED:
return (ENODEV);
return (ECONNABORTED);
case SCF_ERROR_NOT_SET:
case SCF_ERROR_NOT_BOUND:
case ECONNABORTED:
case ENOMEM:
case ENOSPC:
case ECANCELED:
case ENODEV:
case EPERM:
case EROFS:
case EACCES:
case EBADF:
case EBUSY:
case EINVAL:
case EEXIST:
switch (scf_error()) {
case SCF_ERROR_DELETED:
return (ENODEV);
return (ECONNABORTED);
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
ent);
case ECONNABORTED:
case ENOMEM:
case ENOSPC:
case ECANCELED:
case ENODEV:
case EBADF:
case EBUSY:
case EINVAL:
case EPERM:
case EROFS:
case EACCES:
case EEXIST:
imp_pg);
imp_pg);
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_DELETED:
return (ENODEV);
return (EINVAL);
case SCF_ERROR_NOT_SET:
case SCF_ERROR_NOT_BOUND:
case UU_WALK_NEXT:
case UU_WALK_ERROR:
return (EBUSY);
case ECANCELED:
return (EBUSY);
case ECONNABORTED:
case EBADF:
case ENOMEM:
case EACCES:
* ENOSPC - svc.configd is out of resources
const char * const emsg_tdel =
switch (scf_error()) {
case SCF_ERROR_NO_RESOURCES:
case SCF_ERROR_BACKEND_ACCESS:
case SCF_ERROR_EXISTS:
return (UU_WALK_ERROR);
case SCF_ERROR_DELETED:
return (UU_WALK_ERROR);
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
case ECANCELED:
r = UU_WALK_ERROR;
goto deltemp;
case EEXIST:
r = UU_WALK_ERROR;
goto deltemp;
case ECONNABORTED:
goto connaborted;
case ENOMEM:
case ENOSPC:
case EPERM:
case EROFS:
case EACCES:
case EINVAL:
case EBUSY:
r = UU_WALK_ERROR;
goto deltemp;
UU_DEFAULT) != 0) {
case ECONNABORTED:
goto connaborted;
case ECANCELED:
case EEXIST:
r = UU_WALK_ERROR;
goto deltemp;
switch (scf_error()) {
goto connaborted;
case SCF_ERROR_NO_RESOURCES:
goto deltemp;
case SCF_ERROR_EXISTS:
r = UU_WALK_ERROR;
goto deltemp;
imp_str);
goto deltemp;
scfwarn();
r = UU_WALK_ERROR;
goto deltemp;
case SCF_ERROR_NOT_SET:
goto fresh;
imp_lisnap) != 0) {
switch (scf_error()) {
case SCF_ERROR_DELETED:
r = UU_WALK_ERROR;
goto deltemp;
case SCF_ERROR_NOT_FOUND:
goto nosnap;
goto connaborted;
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
scf_error());
case ECONNABORTED:
goto connaborted;
case ECANCELED:
r = UU_WALK_ERROR;
goto deltemp;
case ENOENT:
r = UU_WALK_ERROR;
goto deltemp;
imp_rsnap) != 0) {
switch (scf_error()) {
case SCF_ERROR_DELETED:
r = UU_WALK_ERROR;
goto deltemp;
case SCF_ERROR_NOT_FOUND:
goto connaborted;
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
scf_error());
case ECONNABORTED:
goto connaborted;
case ECANCELED:
r = UU_WALK_ERROR;
goto deltemp;
case ENOENT:
r = UU_WALK_ERROR;
goto deltemp;
case ECANCELED:
case ENODEV:
r = UU_WALK_ERROR;
goto deltemp;
case ECONNABORTED:
goto connaborted;
case ENOMEM:
case ENOSPC:
case EBADF:
case EBUSY:
case EINVAL:
case EPERM:
case EROFS:
case EACCES:
case EEXIST:
r = UU_WALK_ERROR;
goto deltemp;
switch (scf_error()) {
goto connaborted;
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
imp_inst) != 0) {
switch (scf_error()) {
goto connaborted;
case SCF_ERROR_NO_RESOURCES:
case SCF_ERROR_BACKEND_ACCESS:
goto deltemp;
case SCF_ERROR_EXISTS:
r = UU_WALK_ERROR;
goto deltemp;
goto deltemp;
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
scf_error());
* is empty, to minimize svc.configd's work.
imp_lisnap) != 0) {
switch (scf_error()) {
goto connaborted;
case SCF_ERROR_NO_RESOURCES:
goto deltemp;
case SCF_ERROR_EXISTS:
r = UU_WALK_ERROR;
goto deltemp;
goto deltemp;
scfwarn();
r = UU_WALK_ERROR;
goto deltemp;
case SCF_ERROR_NOT_SET:
case SCF_ERROR_INTERNAL:
scf_error());
if (li_only)
goto lionly;
flags);
case ECONNABORTED:
goto connaborted;
case ECANCELED:
r = UU_WALK_ERROR;
goto deltemp;
case EEXIST:
r = UU_WALK_ERROR;
goto deltemp;
r = UU_WALK_ERROR;
goto deltemp;
goto connaborted;
r = UU_WALK_ERROR;
goto deltemp;
if (g_verbose)
case ECONNABORTED:
goto connaborted;
case ENOSPC:
r = UU_WALK_ERROR;
goto deltemp;
case ECANCELED:
r = UU_WALK_ERROR;
goto deltemp;
case EPERM:
r = UU_WALK_ERROR;
goto deltemp;
goto deltemp;
if (g_verbose)
switch (scf_error()) {
goto connaborted;
case SCF_ERROR_NO_RESOURCES:
goto deltemp;
goto deltemp;
case SCF_ERROR_NOT_SET:
r = UU_WALK_NEXT;
switch (scf_error()) {
case SCF_ERROR_DELETED:
goto connaborted;
case SCF_ERROR_NOT_SET:
case SCF_ERROR_NOT_BOUND:
return (UU_WALK_ERROR);
* ENOSPC - svc.configd is out of resources
entity_t *s = v;
int fresh = 0;
int have_ge;
const char * const s_deleted =
const char * const i_deleted =
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
if (r > max_scf_name_len) {
s->sc_name);
return (UU_WALK_ERROR);
switch (scf_error()) {
case SCF_ERROR_NO_RESOURCES:
case SCF_ERROR_BACKEND_ACCESS:
case SCF_ERROR_EXISTS:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
UU_DEFAULT) != 0) {
case ECONNABORTED:
goto connaborted;
case ECANCELED:
return (UU_WALK_ERROR);
case EEXIST:
return (UU_WALK_ERROR);
r = UU_WALK_ERROR;
goto deltemp;
UU_DEFAULT) != 0) {
case ECONNABORTED:
goto connaborted;
case ECANCELED:
return (UU_WALK_ERROR);
case EEXIST:
return (UU_WALK_ERROR);
r = UU_WALK_ERROR;
goto deltemp;
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
goto connaborted;
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
switch (scf_error()) {
goto connaborted;
case SCF_ERROR_NO_RESOURCES:
case SCF_ERROR_BACKEND_ACCESS:
goto deltemp;
case SCF_ERROR_EXISTS:
goto deltemp;
goto deltemp;
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
case ECONNABORTED:
goto connaborted;
case ECANCELED:
return (UU_WALK_ERROR);
case EEXIST:
return (UU_WALK_ERROR);
case EINVAL:
r = UU_WALK_ERROR;
goto deltemp;
goto connaborted;
r = UU_WALK_ERROR;
goto deltemp;
goto instances;
switch (scf_error()) {
goto connaborted;
case SCF_ERROR_DELETED:
r = UU_WALK_ERROR;
goto deltemp;
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
switch (scf_error()) {
case SCF_ERROR_DELETED:
r = UU_WALK_ERROR;
goto deltemp;
goto connaborted;
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
scf_error());
switch (scf_error()) {
case SCF_ERROR_DELETED:
goto connaborted;
case SCF_ERROR_NOT_SET:
case SCF_ERROR_NOT_BOUND:
if (g_verbose)
case ECANCELED:
case ECONNABORTED:
goto connaborted;
case EPERM:
return (UU_WALK_ERROR);
case ENOSPC:
r = UU_WALK_ERROR;
goto deltemp;
inst)) {
imp_inst) != 0) {
switch (scf_error()) {
goto connaborted;
case SCF_ERROR_BACKEND_ACCESS:
case SCF_ERROR_NO_RESOURCES:
goto deltemp;
case SCF_ERROR_EXISTS:
r = UU_WALK_ERROR;
goto deltemp;
goto deltemp;
goto deltemp;
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
scf_error());
if (g_verbose)
case ECANCELED:
r = UU_WALK_ERROR;
goto deltemp;
case ECONNABORTED:
goto connaborted;
case EPERM:
r = UU_WALK_ERROR;
goto deltemp;
case ENOSPC:
r = UU_WALK_ERROR;
goto deltemp;
switch (scf_error()) {
goto connaborted;
case SCF_ERROR_DELETED:
r = UU_WALK_ERROR;
goto deltemp;
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
have_ge = 0;
li_only = 0;
switch (scf_error()) {
case SCF_ERROR_DELETED:
r = UU_WALK_ERROR;
goto deltemp;
goto connaborted;
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
scf_error());
if (have_ge) {
case ECONNABORTED:
goto connaborted;
case ECANCELED:
case EEXIST:
r = UU_WALK_ERROR;
goto deltemp;
goto connaborted;
r = UU_WALK_ERROR;
goto deltemp;
imp_snap) != 0) {
switch (scf_error()) {
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_FOUND:
goto connaborted;
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
scf_error());
if (have_ge)
imp_pg) == 0) {
switch (scf_error()) {
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
scf_error());
switch (scf_error()) {
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_FOUND:
goto connaborted;
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
scf_error());
case ECONNABORTED:
goto connaborted;
case ECANCELED:
case ENOENT:
imp_str_sz) < 0)
r = UU_WALK_ERROR;
goto deltemp;
imp_rsnap) != 0) {
switch (scf_error()) {
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_FOUND:
goto connaborted;
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
scf_error());
case ECONNABORTED:
goto connaborted;
case ECANCELED:
case ENOENT:
imp_str_sz) < 0)
imp_str);
r = UU_WALK_ERROR;
goto deltemp;
if (g_verbose) {
imp_str_sz) < 0)
case ECONNABORTED:
goto connaborted;
case ECANCELED:
case ENODEV:
imp_str_sz) < 0)
r = UU_WALK_ERROR;
goto deltemp;
goto connaborted;
r = UU_WALK_ERROR;
goto deltemp;
r = UU_WALK_NEXT;
switch (scf_error()) {
case SCF_ERROR_DELETED:
goto connaborted;
case SCF_ERROR_EXISTS:
case SCF_ERROR_NOT_SET:
case SCF_ERROR_NOT_BOUND:
return (UU_WALK_ERROR);
switch (st) {
case IMPORT_PREVIOUS:
case IMPORT_PROP_BEGUN:
case IMPORT_PROP_DONE:
case IMPORT_COMPLETE:
case IMPORT_REFRESHED:
#ifndef NDEBUG
abort();
void *ent;
int issvc;
switch (serr) {
case SCF_ERROR_NONE:
case SCF_ERROR_NO_MEMORY:
fmri);
return (ENOMEM);
case SCF_ERROR_NOT_FOUND:
case ECONNABORTED:
d_fmri);
case ECANCELED:
case EACCES:
if (!g_verbose)
case EPERM:
scfwarn();
if (issvc)
int result = 0;
void *cookie;
int annotation_set = 0;
const char * const emsg_nores =
goto out;
r = load_init();
case ENOMEM:
goto out;
switch (scf_error()) {
goto out;
case SCF_ERROR_NOT_FOUND:
case SCF_ERROR_NOT_BOUND:
switch (scf_error()) {
goto out;
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NO_RESOURCES:
case SCF_ERROR_INTERNAL:
UU_DEFAULT) != 0)
result = 0;
goto out;
case ENOMEM:
case ECONNABORTED:
case EPERM:
goto progress;
dpt))
if (imp_refresh_fmri(
goto progress;
goto progress;
goto progress;
result = 0;
goto out;
case ECONNABORTED:
case ENOMEM:
case ENOSPC:
case EROFS:
case EACCES:
case EPERM:
case EINVAL:
case EEXIST:
case EBUSY:
case EBADF:
out:
if (annotation_set != 0) {
load_fini();
NULL) {
return (result);
int annotation_set = 0;
scfdie();
scfdie();
switch (scf_error()) {
goto out;
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NO_RESOURCES:
case SCF_ERROR_INTERNAL:
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
if (g_verbose)
scfdie();
rinst) != 0) {
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
if (g_verbose)
scfdie();
if (g_verbose)
case ECONNABORTED:
goto out;
case ENOMEM:
goto out;
case ENOSPC:
goto out;
case ECANCELED:
case EPERM:
case EINVAL:
case EBUSY:
case EROFS:
goto out;
case EACCES:
case EEXIST:
out:
if (annotation_set) {
* lxml_get_bundle() in svccfg_xml.c, but with some kickers:
char *str;
scfdie();
if (len < 0)
scfdie();
scfdie();
int sz, i;
for (i = 0; i < sz; ++i) {
char c = (char)mem[i];
(void) fputc(c, f);
const char *type;
char *lnname;
int ret;
scfdie();
exp_str);
goto empty;
xmlNodePtr n;
if (n == NULL)
scfdie();
scfdie();
scfdie();
NULL);
exp_str_sz) < 0)
scfdie();
if (ret != 0)
scfdie();
xmlNodePtr n;
int ret;
scfdie();
scfdie();
scfdie();
scfdie();
if (!read_protected)
scfdie();
xmlNodePtr m;
if (m == NULL)
xmlFreeNode(m);
scfdie();
xmlNodePtr n;
if (n == NULL)
uint8_t b;
scfdie();
scfdie();
scfdie();
int ret2;
scfdie();
scfdie();
exp_str_sz) < 0)
scfdie();
NULL);
scfdie();
if (err) {
xmlFreeNode(n);
scfdie();
scfdie();
xmlNodePtr m;
if (m == NULL)
xmlFreeNode(m);
scfdie();
static xmlNodePtr
int ret;
int children = 0;
return (NULL);
scfdie();
scfdie();
char *cp;
scfdie();
exp_str);
cp++;
children++;
if (ret != 0)
scfdie();
if (children == 0) {
return (NULL);
return (env);
char *str;
scfdie();
uint64_t c;
scfdie();
if (err) {
xmlFreeNode(n);
nonenv =
SCF_SUCCESS ||
SCF_SUCCESS ||
SCF_SUCCESS ||
if (nonenv) {
scfdie();
nonenv = 0;
if (nonenv) {
if (use_profile) {
name_attr) != 0)
exp_prop) != 0 ||
exp_prop) != 0 ||
exp_prop) != 0 ||
scfdie();
scfdie();
xmlNodePtr m;
if (m == NULL)
xmlFreeNode(m);
if (nonenv)
scfdie();
int ret;
scfdie();
scfdie();
uint8_t b;
scfdie();
value_attr) == 0) {
xmlNodePtr s;
if (s == NULL)
xmlFreeNode(s);
scfdie();
selts);
xmlFreeNode(n);
scfdie();
if (use_profile)
cred =
scfdie();
scfdie();
if (use_profile ||
if (use_profile ||
scfdie();
xmlFreeNode(n);
static xmlNodePtr
uint8_t b;
if (g_verbose) {
return (NULL);
if (n == NULL)
if (err) {
xmlFreeNode(n);
return (NULL);
scfdie();
scfdie();
sizeof (type)) < 0)
scfdie();
xmlNodePtr s;
if (s == NULL)
xmlFreeNode(s);
scfdie();
int ret;
xmlNodePtr n;
scfdie();
scfdie();
void *entity;
int isservice;
scfdie();
scfdie();
scfdie();
switch (serr) {
case SCF_ERROR_NONE:
case SCF_ERROR_NO_MEMORY:
if (g_verbose) {
scfdie();
if (g_verbose) {
scfdie();
case SCF_ERROR_NOT_FOUND:
if (g_verbose) {
scfdie();
#ifndef NDEBUG
abort();
scfdie();
scfdie();
scfdie();
if (n == NULL)
scfdie();
eelts);
static xmlNodePtr
int ret;
scfdie();
scfdie();
scfdie();
scfdie();
return (parent);
static xmlNodePtr
return (NULL);
return (manpage);
static xmlNodePtr
return (NULL);
return (doc_link);
scfdie();
int ret;
scfdie();
enabled = 0;
scfdie();
scfdie();
value_attr) == 0) {
scfdie();
elts);
xmlNodePtr n;
int ret;
if (n == NULL)
scfdie();
scfdie();
if (g_verbose) {
scfdie();
if (g_verbose) {
scfdie();
scfdie();
scfdie();
scfdie();
scfdie();
scfdie();
xmlFreeNode(n);
if (n == NULL)
static xmlNodePtr
int ret;
scfdie();
scfdie();
scfdie();
scfdie();
scfdie();
scfdie();
scfdie();
scfdie();
return (snode);
FILE *f;
int result;
scfdie();
errno = 0;
if (f == NULL) {
if (errno == 0)
f = stdout;
if (f != stdout)
(void) fclose(f);
return (result);
err = 0;
if (err != 0)
static xmlNodePtr
scfdie();
scfdie();
scfdie();
scfdie();
scfdie();
return (sb);
FILE *f;
int result;
errno = 0;
if (f == NULL) {
if (errno == 0)
filename);
f = stdout;
if (f != stdout)
(void) fclose(f);
return (result);
FILE *f;
char *namebuf;
uint8_t b;
int result;
errno = 0;
if (f == NULL) {
if (errno == 0)
filename);
f = stdout;
scfdie();
scfdie();
scfdie();
scfdie();
scfdie();
SCF_SUCCESS) {
scfdie();
if (g_verbose) {
char *fmri;
len =
if (len < 0)
scfdie();
scfdie();
NULL);
scfdie();
scfdie();
scfdie();
scfdie();
if (f != stdout)
(void) fclose(f);
return (result);
scfdie();
scfdie();
scfdie();
scfdie();
scfdie();
scfdie();
scfdie();
scfdie();
int ret = 0;
scfdie();
goto cleanup;
int err = 0;
goto cleanup;
if (err != 0)
goto cleanup;
char *msg;
int ret;
flag);
(void) internal_bundle_free(b);
const char *str;
char *buf;
scfdie();
err = 0;
lscf_unselect(void)
char *cp;
if (szret < 0) {
scfdie();
goto snap_deleted;
if (szret < 0) {
scfdie();
goto snap_deleted;
scfdie();
goto snap_deleted;
scfdie();
goto snap_deleted;
if (fmrilen >= 0) {
if (deleted)
scfdie();
if (szret >= 0) {
if (deleted)
scfdie();
if (fmrilen < 0)
scfdie();
if (deleted)
char *buf;
int ret;
scfdie();
scfdie();
scfdie();
if (ret == 0)
scfdie();
scfdie();
scfdie();
scfdie();
scfdie();
if (ret == 0)
scfdie();
scfdie();
SCF_SUCCESS) {
switch (scf_error()) {
case SCF_ERROR_EXISTS:
scfdie();
SCF_SUCCESS) {
switch (scf_error()) {
case SCF_ERROR_EXISTS:
scfdie();
int err;
scfdie();
if (isservice) {
scfdie();
scfdie();
scfdie();
ret = 0;
scfdie();
return (ret);
scfdie();
scfdie();
ret = 0;
scfdie();
return (ret);
static scf_error_t
int isservice;
char *pgty;
switch (result) {
case SCF_ERROR_NONE:
case SCF_ERROR_NO_MEMORY:
return (SCF_ERROR_INVALID_ARGUMENT);
case SCF_ERROR_NOT_FOUND:
goto out;
scfdie();
scfdie();
goto out;
scfdie();
goto out;
scfdie();
goto out;
if (isservice) {
scfdie();
scfdie();
scfdie();
scfdie();
goto out;
if (isservice) {
goto out;
scfdie();
name_buf);
out:
return (result);
scfdie();
if (g_verbose) {
scfdie();
scfdie();
scfdie();
scfdie();
scfdie();
scfdie();
scfdie();
fmri);
fmri);
scfdie();
int ret = 0;
scfdie();
scfdie();
goto out;
goto out;
out:
return (ret);
static uint8_t
char *type;
scfdie();
scfdie();
scfdie();
scfdie();
#define DELETE_SUCCESS_NOEXTDEPS 0
int err;
int external = 0;
char *fmri;
scfdie();
return (DELETE_FAILURE);
scfdie();
scfdie();
scfdie();
scfdie();
scfdie();
return (DELETE_FAILURE);
scfdie();
if (external) {
NULL)
scfdie();
scfdie();
scfdie();
scfdie();
return (DELETE_FAILURE);
scfdie();
return (DELETE_SUCCESS_EXTDEPS);
scfdie();
return (DELETE_FAILURE);
return (DELETE_SUCCESS_NOEXTDEPS);
int ret;
int external = 0;
scfdie();
scfdie();
return (DELETE_FAILURE);
scfdie();
scfdie();
scfdie();
scfdie();
scfdie();
return (DELETE_FAILURE);
scfdie();
if (external != 0)
return (DELETE_SUCCESS_EXTDEPS);
return (DELETE_SUCCESS_NOEXTDEPS);
scfdie();
return (DELETE_FAILURE);
int ret;
char *buf;
scfdie();
scfdie();
SCF_SUCCESS) {
scfdie();
scfdie();
SCF_SUCCESS) {
scfdie();
char *buf;
scfdie();
scfdie();
static boolean_t
return (B_FALSE);
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
return (B_FALSE);
return (B_TRUE);
scfdie();
const char *type;
int multiple_strings = 0;
int ret;
scfdie();
scfdie();
char *buf;
if (vlen < 0)
scfdie();
if (szret < 0)
scfdie();
scfdie();
char *buf;
if (templates == 0)
scfdie();
stability_prop) == 0) {
SCF_TYPE_ASTRING) == 0 &&
char *stability;
scfdie();
scfdie();
buf);
buf);
int as_value)
char *buf;
if (as_value == 0)
if (as_value == 0)
int i, printed = 0;
printed = 0;
printed++;
if (printed++ == 0)
if (printed++ == 0)
int i = 0, printed = 0;
printed = 0;
printed++;
if (printed++ == 0)
if (printed++ == 0)
char *val_buf;
int ret;
scfdie();
scfdie();
scfdie();
scfdie();
char *buf;
buf);
buf);
char *rv;
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
scfdie();
return (rv);
char *pg_name;
int rv;
scfdie();
man_len) == 0) {
scfdie();
done:
scfdie();
char *fmribuf;
char *qual_prop_name;
char *search_name;
int listed = 0;
scfdie();
scfdie();
scfdie();
scfdie();
abort();
listed = 0;
listed++;
(prop_name_size > 0 &&
FNM_PATHNAME) == 0))
void **objects;
char **names;
void **tmpls;
int allocd, i;
int ret;
scfdie();
if (ret != 0) {
int new_pg = 0;
int print_props = 0;
if (pgnlen < 0)
scfdie();
if (szret < 0)
scfdie();
scfdie();
names =
if (only_pgs) {
if (new_pg) {
scfdie();
scfdie();
scfdie();
if (prnlen < 0)
scfdie();
prnbuf) < 0)
if (scf_error() !=
scfdie();
if (new_pg) {
scfdie();
scfdie();
if (ret != 0)
scfdie();
int ret;
const char *cp;
switch (*cp) {
scfdie();
switch (scf_error()) {
case SCF_ERROR_EXISTS:
case SCF_ERROR_BACKEND_ACCESS:
scfdie();
char *pgname;
scf_value_t *v;
char *propname;
int req_quotes = 0;
scfdie();
goto fail;
goto fail;
goto fail;
++propname;
goto fail;
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
goto fail;
goto fail;
scfdie();
scfdie();
scfdie();
goto fail;
scfdie();
scfdie();
svc) == 0 &&
parent_pg) == 0 &&
parent_prop) == 0 &&
¤t_ty) == 0) {
NULL) == 0 &&
NULL) == 0 &&
goto fail;
scfdie();
goto fail;
scfdie();
if (v == NULL)
goto fail;
if (v == NULL) {
goto fail;
} while (result == 0);
if (result < 0) {
scfdie();
goto fail;
ret = 0;
goto cleanup;
fail:
return (ret);
int ret;
scfdie();
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
scfdie();
scfdie();
scfdie();
scfdie();
scfdie();
if (ret == 0)
} while (ret == 0);
if (ret < 0) {
scfdie();
char *fmribuf;
const char *emsg_write_error;
if (fmrilen < 0)
scfdie();
scfdie();
if (fmrilen < 0)
scfdie();
scfdie();
scfdie();
scfdie();
int ret2;
scfdie();
scfdie();
goto out;
scfdie();
int ret3;
int multiple;
int is_str;
scfdie();
scfdie();
goto out;
scfdie();
char *buf;
if (buflen < 0)
scfdie();
scfdie();
if (first)
first = 0;
goto out;
goto out;
goto out;
if (ret3 < 0 &&
scfdie();
goto out;
if (ret2 < 0)
scfdie();
goto out;
if (ret < 0)
scfdie();
out:
if (result == 0) {
return (result);
int tmpfd;
const char *pattern)
int ret;
scfdie();
scfdie();
char *buf;
if (vlen < 0)
scfdie();
if (szret < 0)
scfdie();
scfdie();
scf_value_t *v;
char *propname;
if (!isadd)
scfdie();
goto fail;
goto fail;
goto fail;
++propname;
goto fail;
if (ret != 0) {
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
if (isnotfoundok) {
result = 0;
goto out;
goto fail;
scfdie();
scfdie();
scfdie();
goto fail;
if (ret == 0) {
scfdie();
if (isadd) {
type);
goto fail;
pat++;
if (isadd)
scfdie();
if (isadd) {
goto fail;
scfdie();
} else if (isnotfoundok) {
result = 0;
goto out;
goto out;
goto fail;
scfdie();
if (v == NULL) {
goto fail;
} while (result == 0);
if (result < 0) {
scfdie();
goto fail;
result = 0;
out:
return (result);
fail:
goto out;
int ret;
scfdie();
if (ret == 0) {
scfdie();
goto again;
return (NULL);
int ret;
scfdie();
if (ret != 0) {
switch (scf_error()) {
case SCF_ERROR_EXISTS:
ret = 0;
scfdie();
return (ret);
int ret = 0;
size_t i;
int argc;
char *pattern;
char *prop;
int do_service = 0;
int do_instance = 0;
goto usage;
opterr = 0;
optind = 0;
switch (ret) {
goto usage;
goto usage;
if (!isunset)
goto out;
goto out;
goto out;
goto out;
if (!isunset) {
if (ret != 0)
goto out;
int in_instance;
goto out;
if (!in_instance)
char *buf;
int ret;
scfdie();
if (ret != 0) {
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
goto out;
method);
goto out;
scfdie();
goto out;
out:
return (ret);
goto out;
char *nb;
scfdie();
scfdie();
scfdie();
scfdie();
char *cur_snap_name;
scfdie();
if (nochange)
scfdie();
SCF_SUCCESS) {
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
scfdie();
scfdie();
scfdie();
scfdie();
scf_value_t *v;
char *nbuf;
scfdie();
scfdie();
scfdie();
scfdie();
scfdie();
if (e == NULL)
scfdie();
scfdie();
scfdie();
scfdie();
if (v == NULL)
scfdie();
if (scf_entry_add_value(e, v) != 0)
scfdie();
scfdie();
if (v == NULL)
scfdie();
scfdie();
scfdie();
scfdie();
abort();
scfdie();
SCF_SUCCESS) {
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
scfdie();
scfdie();
scfdie();
scfdie();
scfdie();
scfdie();
goto out;
if (!isinst)
if (r != SCF_SUCCESS)
scfdie();
scfdie();
scfdie();
goto out;
scfdie();
scfdie();
scfdie();
scfdie();
scfdie();
if (!isinst)
if (r != SCF_SUCCESS) {
scfdie();
goto out;
goto out;
goto out;
abort();
scfdie();
scfdie();
SCF_SUCCESS) {
scfdie();
out:
lscf_refresh(void)
char *fmribuf;
if (fmrilen < 0) {
scfdie();
case ECONNABORTED:
case ECANCELED:
case EPERM:
case EACCES:
scfdie();
case ECONNABORTED:
case ECANCELED:
case EPERM:
case ENOSPC:
fmribuf);
int ret = 0;
size_t i;
int argc;
int do_verbose = 0;
int do_templates = 0;
if (hasargs != 0) {
goto usage;
optind = 0;
opterr = 0;
switch (ret) {
goto usage;
goto out;
if (do_templates == 0) {
ret = 0;
out:
return (ret);
goto out;
#ifndef NATIVE_BUILD
char *buf;
scfdie();
scfdie();
scfdie();
scfdie();
if (err != 0)
return (err);
scfdie();
scfdie();
scfdie();
scfdie();
if (err != 0)
return (err);