Print this page
7852 svccfg archive should drop SCF_NOTIFY_PG_POSTFIX
Reviewed by: Dan McDonald <danmcd@omniti.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/svc/svccfg/svccfg_libscf.c
          +++ new/usr/src/cmd/svc/svccfg/svccfg_libscf.c
↓ open down ↓ 10378 lines elided ↑ open up ↑
10379 10379  
10380 10380  /*
10381 10381   * Process notification parameters for a service or instance
10382 10382   */
10383 10383  static void
10384 10384  export_notify_params(scf_propertygroup_t *pg, struct entity_elts *elts)
10385 10385  {
10386 10386          xmlNodePtr n, event, *type;
10387 10387          struct params_elts *eelts;
10388 10388          int ret, err, i;
     10389 +        char *s;
10389 10390  
10390 10391          n = xmlNewNode(NULL, (xmlChar *)"notification_parameters");
10391 10392          event = xmlNewNode(NULL, (xmlChar *)"event");
10392 10393          if (n == NULL || event == NULL)
10393 10394                  uu_die(emsg_create_xml);
10394 10395  
10395 10396          /* event value */
10396 10397          if (scf_pg_get_name(pg, exp_str, max_scf_name_len + 1) < 0)
10397 10398                  scfdie();
     10399 +        /* trim SCF_NOTIFY_PG_POSTFIX appended to name on import */
     10400 +        if ((s = strchr(exp_str, ',')) != NULL)
     10401 +                *s = '\0';
10398 10402          safe_setprop(event, value_attr, exp_str);
10399 10403  
10400 10404          (void) xmlAddChild(n, event);
10401 10405  
10402 10406          if ((type = calloc(URI_SCHEME_NUM, sizeof (xmlNodePtr))) == NULL ||
10403 10407              (eelts = calloc(URI_SCHEME_NUM,
10404 10408              sizeof (struct params_elts))) == NULL)
10405 10409                  uu_die(gettext("Out of memory.\n"));
10406 10410  
10407 10411          err = 0;
↓ open down ↓ 7218 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX