Print this page
3347 zonecfg(1M) is confused about selection

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libzonecfg/common/libzonecfg.c
          +++ new/usr/src/lib/libzonecfg/common/libzonecfg.c
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  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  /*
       23 + * Copyright 2014 Gary Mills
  23   24   * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  24   25   */
  25   26  
  26   27  #include <libsysevent.h>
  27   28  #include <pthread.h>
  28   29  #include <stdlib.h>
  29   30  #include <errno.h>
  30   31  #include <fnmatch.h>
  31   32  #include <strings.h>
  32   33  #include <unistd.h>
↓ open down ↓ 1727 lines elided ↑ open up ↑
1760 1761  match_prop(xmlNodePtr cur, const xmlChar *attr, char *user_prop)
1761 1762  {
1762 1763          xmlChar *gotten_prop;
1763 1764          int prop_result;
1764 1765  
1765 1766          gotten_prop = xmlGetProp(cur, attr);
1766 1767          if (gotten_prop == NULL)        /* shouldn't happen */
1767 1768                  return (B_FALSE);
1768 1769          prop_result = xmlStrcmp(gotten_prop, (const xmlChar *) user_prop);
1769 1770          xmlFree(gotten_prop);
1770      -        return ((prop_result == 0));
     1771 +        return ((prop_result == 0));    /* empty strings will match */
1771 1772  }
1772 1773  
1773 1774  static int
1774 1775  zonecfg_delete_filesystem_core(zone_dochandle_t handle,
1775 1776      struct zone_fstab *tabptr)
1776 1777  {
1777 1778          xmlNodePtr cur = handle->zone_dh_cur;
1778 1779          boolean_t dir_match, spec_match, raw_match, type_match;
1779 1780  
1780 1781          for (cur = cur->xmlChildrenNode; cur != NULL; cur = cur->next) {
↓ open down ↓ 467 lines elided ↑ open up ↑
2248 2249                  if (xmlStrcmp(cur->name, DTD_ELEM_NET))
2249 2250                          continue;
2250 2251  
2251 2252                  addr_match = match_prop(cur, DTD_ATTR_ADDRESS,
2252 2253                      tabptr->zone_nwif_address);
2253 2254                  allowed_addr_match = match_prop(cur, DTD_ATTR_ALLOWED_ADDRESS,
2254 2255                      tabptr->zone_nwif_allowed_address);
2255 2256                  phys_match = match_prop(cur, DTD_ATTR_PHYSICAL,
2256 2257                      tabptr->zone_nwif_physical);
2257 2258  
2258      -                if ((addr_match || allowed_addr_match) && phys_match) {
     2259 +                if (addr_match && allowed_addr_match && phys_match) {
2259 2260                          xmlUnlinkNode(cur);
2260 2261                          xmlFreeNode(cur);
2261 2262                          return (Z_OK);
2262 2263                  }
2263 2264          }
2264 2265          return (Z_NO_RESOURCE_ID);
2265 2266  }
2266 2267  
2267 2268  int
2268 2269  zonecfg_delete_nwif(zone_dochandle_t handle, struct zone_nwiftab *tabptr)
↓ open down ↓ 5796 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX