Lines Matching refs:group

62  * has_protocol(group, proto)
63 * If the group has an optionset with the specified protocol,
67 has_protocol(sa_group_t group, char *protocol)
72 optionset = sa_get_optionset(group, protocol);
458 sa_group_t group;
477 group = sa_get_parent_group(parent);
479 if (group == NULL) {
483 for (opt = sa_get_optionset(group, NULL);
524 * enable_group(group, updateproto, notify, proto)
526 * enable all the shares in the specified group. This is a helper for
533 enable_group(sa_group_t group, char *updateproto, int notify, char *proto)
537 for (share = sa_get_share(group, NULL);
550 * isenabled(group)
552 * Returns B_TRUE if the group is enabled or B_FALSE if it isn't.
557 isenabled(sa_group_t group)
562 if (group != NULL) {
563 state = sa_get_group_attr(group, "state");
591 sa_group_t group;
595 group = (sa_group_t)work->item;
601 * group.
604 ret = sa_set_group_attr(group, "state", "enabled");
610 * Check to see if group is enabled. If it isn't, skip
612 * group is disabled. The properties may have been
614 * group is enabled.
616 if (!isenabled(group))
642 /* if itemdata == NULL then the whole group */
644 zfs = sa_get_group_attr(group, "zfs");
652 enable_group(group, zfs == NULL ? updateproto : NULL,
657 for (subgroup = sa_get_sub_group(group);
666 zfs = sa_get_group_attr(group, "zfs");
667 name = sa_get_group_attr(group, "name");
810 * add_optionset(group, optlist, protocol, *err)
812 * to the group.
818 add_optionset(sa_group_t group, struct options *optlist, char *proto, int *err)
825 optionset = sa_get_optionset(group, proto);
827 optionset = sa_create_optionset(group, proto);
836 handle = sa_find_group_handle(group);
900 * resource_compliant(group)
902 * Go through all the shares in the group. Assume compliant, but if
907 resource_compliant(sa_group_t group)
911 for (share = sa_get_share(group, NULL); share != NULL;
1012 * make_resources(group)
1014 * Go through all the shares in the group and make them have resource
1018 make_resources(sa_group_t group)
1024 for (share = sa_get_share(group, NULL); share != NULL;
1054 * check_valid_group(group, protocol)
1056 * Check to see that the group should have the protocol added (if
1061 check_valid_group(sa_group_t group, char *groupname, char *protocol)
1065 if (has_protocol(group, protocol)) {
1089 * enforce_featureset(group, protocol, dryrun, force)
1091 * Check the protocol featureset against the group and enforce any
1096 enforce_featureset(sa_group_t group, char *protocol, boolean_t dryrun,
1106 * allow on a group. Only server protocols are allowed here.
1121 !resource_compliant(group)) {
1123 make_resources(group);
1135 * set_all_protocols(group)
1138 * group.
1142 set_all_protocols(sa_group_t group)
1152 * group. Only server protocols can go here.
1158 optionset = sa_create_optionset(group, protolist[i]);
1174 * create a new group
1183 sa_group_t group;
1273 (void) printf(gettext("\textraneous group(s) at end\n"));
1295 * If a group already exists, we can only add a new protocol
1304 group = sa_get_group(handle, groupname);
1305 if (group != NULL) {
1306 /* group exists so must be a protocol add */
1307 ret = check_valid_group(group, groupname, protocol);
1315 (void) printf(gettext("Invalid group name: %s\n"),
1324 group, NULL);
1328 if (group == NULL) {
1329 group = sa_create_group(handle, (char *)groupname,
1333 if (group != NULL) {
1337 * Check group and protocol against featureset
1340 ret = enforce_featureset(group, protocol,
1347 * optionset(s) to the group.
1350 (void) add_optionset(group, optlist, protocol,
1353 optionset = sa_create_optionset(group,
1358 /* default group create so add all protocols */
1359 ret = set_all_protocols(group);
1362 * We have a group and legal additions
1374 if (group != NULL)
1375 (void) sa_remove_group(group);
1379 (void) printf(gettext("Could not create group: %s\n"),
1390 ret = sa_remove_group(group);
1397 * group_status(group)
1399 * return the current status (enabled/disabled) of the group.
1403 group_status(sa_group_t group)
1408 state = sa_get_group_attr(group, "state");
1421 * Delete a group.
1428 sa_group_t group;
1508 (void) printf(gettext("\textraneous group(s) at end\n"));
1521 * Determine if the group already exists since it must in
1526 * - group is empty
1532 group = sa_get_group(handle, groupname);
1533 if (group == NULL) {
1539 share = sa_get_share(group, NULL);
1558 ret = sa_remove_group(group);
1571 security = sa_get_security(group, sectype, protocol);
1577 optionset = sa_get_optionset(group, protocol);
1591 sa_get_security(group, NULL, NULL);
1614 for (share = sa_get_share(group, NULL);
1623 (void) printf(gettext("Could not delete group: %s\n"),
1667 * group_proto(group)
1670 * with this group.
1674 group_proto(sa_group_t group)
1683 * group and extracting the type value. The initial call to
1688 for (optionset = sa_get_optionset(group, NULL);
1718 sa_group_t group;
1779 for (group = sa_get_group(handle, NULL);
1780 group != NULL;
1781 group = sa_get_next_group(group)) {
1784 if (protocol == NULL || has_protocol(group, protocol)) {
1785 name = sa_get_group_attr(group, "name");
1796 (void) printf("\t%s", isenabled(group) ?
1799 proto = group_proto(group);
1866 * show_properties(group, protocol, prefix)
1868 * print the properties for a group. If protocol is NULL, do all
1879 show_properties(sa_group_t group, char *protocol, char *prefix)
1887 optionset = sa_get_optionset(group, protocol);
1893 security = sa_get_security(group, protocol, NULL);
1900 for (optionset = sa_get_optionset(group, protocol);
1911 for (security = sa_get_security(group, NULL, protocol);
2156 * show_group(group, verbose, properties, proto, subgroup)
2158 * helper function to show the contents of a group.
2162 show_group(sa_group_t group, int verbose, int properties, char *proto,
2171 groupname = sa_get_group_attr(group, "name");
2173 if (proto != NULL && !has_protocol(group, proto)) {
2178 * check to see if the group is managed by ZFS. If
2184 zfs = sa_get_group_attr(group, "zfs");
2189 share = sa_get_share(group, NULL);
2195 show_properties(group, proto, "");
2200 for (zgroup = sa_get_sub_group(group);
2210 * Have a group, so list the contents. Resource and
2213 for (share = sa_get_share(group, NULL);
2252 * show_group_xml(doc, group)
2254 * Copy the group info into the XML doc.
2258 show_group_xml(xmlDocPtr doc, sa_group_t group)
2264 node = xmlCopyNode((xmlNodePtr)group, 1);
2284 sa_group_t group;
2355 /* No group specified so go through them all */
2356 for (group = sa_get_group(handle, NULL);
2357 group != NULL;
2358 group = sa_get_next_group(group)) {
2360 * Have a group so check if one we want and then list
2364 show_group_xml(doc, group);
2366 show_group(group, verbose, properties, protocol,
2372 group = sa_get_group(handle, argv[optind]);
2373 if (group != NULL) {
2375 show_group_xml(doc, group);
2377 show_group(group, verbose, properties,
2395 * enable_share(group, share, update_legacy)
2397 * helper function to enable a share if the group is enabled.
2401 enable_share(sa_handle_t handle, sa_group_t group, sa_share_t share,
2414 * need to enable this share if the group is enabled but not
2416 * represented in the group.
2418 value = sa_get_group_attr(group, "state");
2425 zfs = sa_get_group_attr(group, "zfs");
2432 * Step through each optionset at the group level and
2434 * works because protocols must be set on the group
2438 for (optionset = sa_get_optionset(group, NULL);
2487 * sa_require_resource(group)
2489 * if any of the defined protocols on the group require resource
2494 sa_require_resource(sa_group_t group)
2498 for (optionset = sa_get_optionset(group, NULL);
2531 sa_group_t group;
2564 * Save share path into group. Currently limit
2678 group = sa_get_group(handle, argv[optind]);
2679 if (group != NULL) {
2680 if (sa_require_resource(group) == B_TRUE &&
2685 "in group\n"));
2690 ret = sa_check_path(group, sharepath,
2693 share = sa_add_share(group, sharepath,
2698 * share into a different group than it already is in.
2703 if (parent != group) {
2743 group,
2749 group,
2808 sa_group_t group;
2834 * Remove share path from group. Currently limit
2895 group = sa_get_group(handle, argv[optind]);
2896 if (group == NULL) {
2933 zfsnew = sa_get_group_attr(group, "zfs");
2944 if (ret == SA_OK && parent != group && !dryrun) {
2948 * "unshared" if the new group is disabled and
2950 * share to update if the new group is
2954 * aren't in the new group.
2966 ret = sa_move_share(group, share);
2971 if (ret == SA_OK && parent != group && !dryrun) {
2974 (void) enable_share(handle, group, share, 1);
3004 sa_group_t group;
3025 * Remove share path from group. Currently limit
3038 * Remove share from group if last resource or remove
3091 (void) printf(gettext("Extraneous group(s) at end of "
3095 group = sa_get_group(handle, argv[optind]);
3096 if (group == NULL) {
3103 group = NULL;
3124 if (group != NULL)
3125 share = sa_get_share(group, sharepath);
3160 if (group != NULL)
3161 share = sa_get_share(group, dir);
3179 if (group != NULL)
3180 (void) printf(gettext("Share not found in group %s:"
3187 if (group == NULL)
3188 group = sa_get_parent_group(share);
3236 pname = sa_get_group_attr(group, "name");
3263 sa_group_t group, sharegroup;
3301 * Save share path into group. Currently limit
3350 (void) printf(gettext("\tExtraneous group(s) at end\n"));
3369 group = sa_get_group(handle, groupname);
3371 group = NULL;
3421 if (group != NULL && group != sharegroup) {
3522 * add_security(group, sectype, optlist, proto, *err)
3525 * group.
3529 add_security(sa_group_t group, char *sectype,
3538 security = sa_get_security(group, sectype, proto);
3540 security = sa_create_security(group, sectype, proto);
3548 handle = sa_find_group_handle(group);
3611 * zfscheck(group, share)
3615 * acceptable is the path that defines the zfs sub-group (dataset with
3620 * If group is not a ZFS group/subgroup, we assume OK since the check
3622 * for here is that the group is ZFS and the share is not the defining
3627 zfscheck(sa_group_t group, sa_share_t share)
3632 if (sa_group_is_zfs(group)) {
3634 * The group is a ZFS group. Does the share represent
3635 * the dataset that defined the group? It is only OK
3659 * the sharepath if present or group if present, otherwise it is used
3671 sa_group_t group;
3676 group = sa_get_group(handle, groupname);
3677 if (group != NULL) {
3683 * the group.
3686 share = sa_get_share(group, sharepath);
3689 "Share does not exist in group %s\n"),
3693 /* if ZFS and OK, then only group */
3694 ret = zfscheck(group, share);
3696 sa_group_is_zfs(group))
3700 "Properties on ZFS group shares "
3708 * group. Also check the protocol to see if it
3719 resource = sa_get_resource(group, rsrcname);
3740 /* group must exist */
3742 share == NULL ? group : share, NULL);
3748 change |= add_optionset(group, optlist,
3751 worklist = add_list(worklist, group,
3761 * we have a group and potentially legal additions
3790 sa_group_t group;
3805 group = sa_get_group(handle, groupname);
3806 if (group != NULL) {
3809 share = sa_get_share(group, sharepath);
3812 "Share does not exist in group %s\n"),
3816 /* if ZFS and OK, then only group */
3817 ret = zfscheck(group, share);
3819 sa_group_is_zfs(group))
3823 "Properties on ZFS group shares "
3828 /* group must exist */
3830 share == NULL ? group : share, sectype);
3836 change = add_security(group, sectype,
3844 worklist = add_list(worklist, group, share,
3854 * We have a group and potentially legal additions.
4015 (void) printf(gettext("Changing properties for group "
4036 * remove_options(group, optlist, proto, *err)
4038 * Helper function to actually remove options from a group after all
4043 remove_options(sa_group_t group, struct options *optlist,
4052 optionset = sa_get_optionset(group, proto);
4073 * valid_unset(group, optlist, proto)
4080 valid_unset(sa_group_t group, struct options *optlist, char *proto)
4087 optionset = sa_get_optionset(group, proto);
4103 * valid_unset_security(group, optlist, proto)
4110 valid_unset_security(sa_group_t group, struct options *optlist, char *proto,
4120 security = sa_get_security(group, sec, proto);
4142 * remove_security(group, optlist, proto)
4148 remove_security(sa_group_t group, char *sectype,
4156 security = sa_get_security(group, sectype, proto);
4197 sa_group_t group;
4204 group = sa_get_group(handle, groupname);
4205 if (group == NULL)
4210 * the group.
4213 share = sa_get_share(group, sharepath);
4216 "Share does not exist in group %s\n"),
4224 * group. Also check the protocol to see if it
4234 resource = sa_get_resource(group, rsrcname);
4255 /* group must exist */
4256 ret = valid_unset(share != NULL ? share : group,
4277 change |= remove_options(group,
4281 worklist = add_list(worklist, group, share,
4295 * We have a group and potentially legal additions
4320 sa_group_t group;
4326 group = sa_get_group(handle, groupname);
4327 if (group == NULL) {
4332 share = sa_get_share(group, sharepath);
4335 "Share does not exist in group %s\n"),
4340 ret = valid_unset_security(share != NULL ? share : group,
4362 change = remove_security(group, sectype,
4369 security = sa_get_security(group, sec, protocol);
4386 worklist = add_list(worklist, group, 0, protocol);
4390 * We have a group and potentially legal additions
4552 * If a group already exists, we can only add a new
4591 sa_group_t group;
4646 (void) printf(gettext("\tmust specify group\n"));
4651 group = sa_get_group(handle, argv[optind]);
4652 if (group != NULL) {
4655 state = sa_get_group_attr(group, "state");
4666 worklist = add_list(worklist, group,
4670 "Enabling group \"%s\"\n"),
4681 for (group = sa_get_group(handle, NULL);
4682 group != NULL;
4683 group = sa_get_next_group(group)) {
4684 worklist = add_list(worklist, group, 0, protocol);
4691 (void) printf(gettext("Could not enable group: %s\n"),
4706 * disable_group(group, proto)
4708 * Disable all the shares in the specified group.. This is a helper
4714 disable_group(sa_group_t group, char *proto)
4723 if (!has_protocol(group, proto))
4726 for (share = sa_get_share(group, NULL);
4745 * provided. It optionally marks the group as disabled. Used by both
4753 sa_group_t subgroup, group;
4756 group = (sa_group_t)work->item;
4758 ret = sa_set_group_attr(group, "state", "disabled");
4761 name = sa_get_group_attr(group, "name");
4764 for (subgroup = sa_get_sub_group(group);
4771 ret = disable_group(group, work->proto);
4806 sa_group_t group;
4863 (void) printf(gettext("\tmust specify group\n"));
4868 group = sa_get_group(handle, argv[optind]);
4869 if (group != NULL) {
4872 state = sa_get_group_attr(group, "state");
4883 worklist = add_list(worklist, group, 0,
4887 "Disabling group "
4898 for (group = sa_get_group(handle, NULL);
4899 group != NULL;
4900 group = sa_get_next_group(group))
4901 worklist = add_list(worklist, group, 0, protocol);
4907 (void) printf(gettext("Could not disable group: %s\n"),
4924 * of the group(s) and only enables shares if the group is already
4938 sa_group_t group;
5000 group = sa_get_group(handle, argv[optind]);
5001 if (group != NULL) {
5002 state = sa_get_group_attr(group, "state");
5005 worklist = add_list(worklist, group, 0,
5009 "Starting group \"%s\"\n"),
5018 if (sa_get_optionset(group,
5029 for (group = sa_get_group(handle, NULL);
5030 group != NULL;
5031 group = sa_get_next_group(group)) {
5032 state = sa_get_group_attr(group, "state");
5034 worklist = add_list(worklist, group, 0,
5053 * of the group(s) and only disables shares if the group is already
5066 sa_group_t group;
5126 group = sa_get_group(handle, argv[optind]);
5127 if (group != NULL) {
5128 state = sa_get_group_attr(group, "state");
5131 worklist = add_list(worklist, group, 0,
5135 "Stopping group \"%s\"\n"),
5146 for (group = sa_get_group(handle, NULL);
5147 group != NULL;
5148 group = sa_get_next_group(group)) {
5149 state = sa_get_group_attr(group, "state");
5151 worklist = add_list(worklist, group, 0,
5281 * out_share(out, group, proto)
5288 out_share(FILE *out, sa_group_t group, char *proto)
5299 if (proto != NULL && sa_get_optionset(group, proto) == NULL)
5314 for (share = sa_get_share(group, NULL);
5331 groupname = sa_get_group_attr(group, "name");
5393 sa_group_t group;
5395 for (group = sa_get_group(handle, NULL);
5396 group != NULL;
5397 group = sa_get_next_group(group)) {
5403 * the group appropriately.
5406 zfs = sa_get_group_attr(group, "zfs");
5410 for (zgroup = sa_get_sub_group(group);
5414 /* got a group, so display it */
5418 out_share(out, group, proto);
5441 sa_group_t group = NULL;
5546 * The legacy group is always present and zfs groups
5548 * the zfs share will already be in that group so it
5549 * isn't an error. If the protocol is "smb", the group
5561 * group.
5564 group = sa_get_parent_group(share);
5566 group = sa_get_group(handle, legacygroup);
5567 if (group == NULL && strcmp(legacygroup, "smb") == 0) {
5569 * This group may not exist, so create
5573 group = sa_create_group(handle, legacygroup,
5575 if (group != NULL)
5576 (void) sa_create_optionset(group,
5581 if (group == NULL) {
5586 groupstatus = group_status(group);
5588 share = sa_add_share(group, sharepath,
5598 group = sa_get_group(handle,
5600 if (group == NULL) {
5608 group, sharepath,
5663 /* Have a group to hold this share path */
5906 "[-d \"description text\"] -s sharepath group");
5910 "create [-nvh] [-P proto [-p property=value]] group");
5913 ret = gettext("delete [-nvh] [-P proto] [-f] group");
5916 ret = gettext("disable [-nvh] {-a | group ...}");
5919 ret = gettext("enable [-nvh] {-a | group ...}");
5926 "move-share [-nvh] -s sharepath destination-group");
5931 "group");
5936 "group");
5940 "[-p property=value]* group");
5944 "[-d \"description text\"] -s sharepath group");
5947 ret = gettext("show [-pvxh] [-P proto] [group ...]");
5954 ret = gettext("start [-vh] [-P proto] {-a | group ...}");
5957 ret = gettext("stop [-vh] [-P proto] {-a | group ...}");
5961 "[-p property]* group");
5965 "-S security-type [-p property]* group");