Print this page
11083 support NFS server in zone
Portions contributed by: Dan Kruchinin <dan.kruchinin@nexenta.com>
Portions contributed by: Stepan Zastupov <stepan.zastupov@gmail.com>
Portions contributed by: Joyce McIntosh <joyce.mcintosh@nexenta.com>
Portions contributed by: Mike Zeller <mike@mikezeller.net>
Portions contributed by: Dan McDonald <danmcd@joyent.com>
Portions contributed by: Gordon Ross <gordon.w.ross@gmail.com>
Portions contributed by: Vitaliy Gusev <gusev.vitaliy@gmail.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Jason King <jbk@joyent.com>
Reviewed by: C Fraire <cfraire@me.com>
Change-Id: I22f289d357503f9b48a0bc2482cc4328a6d43d16

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/dfs.cmds/sharemgr/commands.c
          +++ new/usr/src/cmd/dfs.cmds/sharemgr/commands.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  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   23   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
       25 + */
       26 +
       27 +/*
  25   28   * Copyright 2012 Milan Jurik. All rights reserved.
       29 + * Copyright 2018 Nexenta Systems, Inc.
  26   30   * Copyright 2019, Joyent, Inc.
  27   31   */
  28   32  
  29   33  #include <sys/types.h>
  30   34  #include <sys/stat.h>
  31   35  #include <fcntl.h>
  32   36  #include <stdlib.h>
  33   37  #include <stdio.h>
  34   38  #include <string.h>
  35   39  #include <ctype.h>
↓ open down ↓ 2124 lines elided ↑ open up ↑
2160 2164  /*
2161 2165   * show_group(group, verbose, properties, proto, subgroup)
2162 2166   *
2163 2167   * helper function to show the contents of a group.
2164 2168   */
2165 2169  
2166 2170  static void
2167 2171  show_group(sa_group_t group, int verbose, int properties, char *proto,
2168 2172      char *subgroup)
2169 2173  {
2170      -        sa_share_t share;
2171 2174          char *groupname;
2172 2175          char *zfs = NULL;
2173 2176          int iszfs = 0;
2174 2177          char *sharepath;
2175 2178  
2176 2179          groupname = sa_get_group_attr(group, "name");
2177 2180          if (groupname != NULL) {
     2181 +                sa_share_t share;
     2182 +
2178 2183                  if (proto != NULL && !has_protocol(group, proto)) {
2179 2184                          sa_free_attr_string(groupname);
2180 2185                          return;
2181 2186                  }
2182 2187                  /*
2183 2188                   * check to see if the group is managed by ZFS. If
2184 2189                   * there is an attribute, then it is. A non-NULL zfs
2185 2190                   * variable will trigger the different way to display
2186 2191                   * and will remove the transient property indicator
2187 2192                   * from the output.
2188 2193                   */
2189 2194                  zfs = sa_get_group_attr(group, "zfs");
2190 2195                  if (zfs != NULL) {
2191 2196                          iszfs = 1;
2192 2197                          sa_free_attr_string(zfs);
2193 2198                  }
2194      -                share = sa_get_share(group, NULL);
     2199 +
2195 2200                  if (subgroup == NULL)
2196 2201                          (void) printf("%s", groupname);
2197 2202                  else
2198 2203                          (void) printf("    %s/%s", subgroup, groupname);
2199 2204                  if (properties)
2200 2205                          show_properties(group, proto, "");
2201 2206                  (void) printf("\n");
2202 2207                  if (strcmp(groupname, "zfs") == 0) {
2203 2208                          sa_group_t zgroup;
2204 2209  
↓ open down ↓ 3813 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX