Print this page
7851 svccfg restore chokes on services with more than one manpage

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/svc/svccfg/svccfg_xml.c
          +++ new/usr/src/cmd/svc/svccfg/svccfg_xml.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   */
  24   24  /*
  25   25   * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
       26 + * Copyright 2017 RackTop Systems.
  26   27   */
  27   28  
  28   29  
  29   30  /*
  30   31   * XML document manipulation routines
  31   32   *
  32   33   * These routines provide translation to and from the internal representation to
  33   34   * XML.  Directionally-oriented verbs are with respect to the external source,
  34   35   * so lxml_get_service() fetches a service from the XML file into the
  35   36   * internal representation.
↓ open down ↓ 374 lines elided ↑ open up ↑
 410  411  static int
 411  412  new_str_prop_from_attr(pgroup_t *pgrp, const char *pname, scf_type_t ty,
 412  413      xmlNodePtr n, const char *attr)
 413  414  {
 414  415          xmlChar *val;
 415  416          property_t *p;
 416  417          int r;
 417  418  
 418  419          val = xmlGetProp(n, (xmlChar *)attr);
 419  420  
      421 +        /* Some properties may have multiple values. */
      422 +        p = internal_property_find(pgrp, pname);
      423 +        if (p != NULL) {
      424 +                value_t *v = internal_value_new();
      425 +                v->sc_u.sc_string = (char *)val;
      426 +                v->sc_type = ty;
      427 +                internal_attach_value(p, v);
      428 +                return (0);
      429 +        }
      430 +
 420  431          p = internal_property_create(pname, ty, 1, val);
 421  432          r = internal_attach_property(pgrp, p);
 422  433  
 423  434          if (r != 0)
 424  435                  internal_property_free(p);
 425  436  
 426  437          return (r);
 427  438  }
 428  439  
 429  440  static int
↓ open down ↓ 3401 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX