Print this page
1784 zone configuration passes zonecfg but not zoneadm for limitpriv property

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/zonecfg/zonecfg.c
          +++ new/usr/src/cmd/zonecfg/zonecfg.c
↓ open down ↓ 5721 lines elided ↑ open up ↑
5722 5722          struct zone_attrtab attrtab;
5723 5723          struct zone_rctltab rctltab;
5724 5724          struct zone_dstab dstab;
5725 5725          struct zone_psettab psettab;
5726 5726          struct zone_admintab admintab;
5727 5727          char zonepath[MAXPATHLEN];
5728 5728          char sched[MAXNAMELEN];
5729 5729          char brand[MAXNAMELEN];
5730 5730          char hostidp[HW_HOSTID_LEN];
5731 5731          char fsallowedp[ZONE_FS_ALLOWED_MAX];
     5732 +        priv_set_t *privs;
     5733 +        char *privname = NULL;
5732 5734          int err, ret_val = Z_OK, arg;
5733 5735          int pset_res;
5734 5736          boolean_t save = B_FALSE;
5735 5737          boolean_t arg_err = B_FALSE;
5736 5738          zone_iptype_t iptype;
5737 5739          boolean_t has_cpu_shares = B_FALSE;
5738 5740          boolean_t has_cpu_cap = B_FALSE;
5739 5741          struct xif *tmp;
5740 5742  
5741 5743          optind = 0;
↓ open down ↓ 47 lines elided ↑ open up ↑
5789 5791                  zone_perror(zone, err, B_TRUE);
5790 5792                  return;
5791 5793          }
5792 5794  
5793 5795          if (zonecfg_get_iptype(handle, &iptype) != Z_OK) {
5794 5796                  zerr("%s %s", gettext("cannot get"), pt_to_str(PT_IPTYPE));
5795 5797                  ret_val = Z_REQD_RESOURCE_MISSING;
5796 5798                  saw_error = B_TRUE;
5797 5799          }
5798 5800  
     5801 +        if ((privs = priv_allocset()) == NULL) {
     5802 +                zerr(gettext("%s: priv_allocset failed"), zone);
     5803 +                return;
     5804 +        }
     5805 +        if (zonecfg_get_privset(handle, privs, &privname) != Z_OK) {
     5806 +                zerr(gettext("%s: invalid privilege: %s"), zone, privname);
     5807 +                priv_freeset(privs);
     5808 +                free(privname);
     5809 +                return;
     5810 +        }
     5811 +        priv_freeset(privs);
     5812 +
5799 5813          if (zonecfg_get_hostid(handle, hostidp,
5800 5814              sizeof (hostidp)) == Z_INVALID_PROPERTY) {
5801 5815                  zerr(gettext("%s: invalid hostid: %s"),
5802 5816                      zone, hostidp);
5803 5817                  return;
5804 5818          }
5805 5819  
5806 5820          if (zonecfg_get_fs_allowed(handle, fsallowedp,
5807 5821              sizeof (fsallowedp)) == Z_INVALID_PROPERTY) {
5808 5822                  zerr(gettext("%s: invalid fs-allowed: %s"),
↓ open down ↓ 1406 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX