Print this page
2988 nfssrv: need ability to go to submounts for v3 and v2 protocols
Portions contributed by: Marcel Telka <marcel.telka@nexenta.com>
Portions contributed by: Jean McCormack <jean.mccormack@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>
Reviewed by: Dan Fields <dan.fields@nexenta.com>
Reviewed by: Dan McDonald <danmcd@joyent.com>
Change-Id: I6fdf110cc17e789353c4442b83a46cb80643456e


 157 #define OPT_PUBLIC      10
 158         {SHOPT_PUBLIC, OPT_PUBLIC, OPT_TYPE_BOOLEAN, OPT_SHARE_ONLY},
 159 #define OPT_INDEX       11
 160         {SHOPT_INDEX, OPT_INDEX, OPT_TYPE_FILE},
 161 #define OPT_LOG         12
 162         {SHOPT_LOG, OPT_LOG, OPT_TYPE_LOGTAG},
 163 #define OPT_CKSUM       13
 164         {SHOPT_CKSUM, OPT_CKSUM, OPT_TYPE_STRINGSET},
 165 #define OPT_NONE        14
 166         {SHOPT_NONE, OPT_NONE, OPT_TYPE_ACCLIST},
 167 #define OPT_ROOT_MAPPING        15
 168         {SHOPT_ROOT_MAPPING, OPT_ROOT_MAPPING, OPT_TYPE_USER},
 169 #define OPT_CHARSET_MAP 16
 170         {"", OPT_CHARSET_MAP, OPT_TYPE_ACCLIST},
 171 #define OPT_NOACLFAB    17
 172         {SHOPT_NOACLFAB, OPT_NOACLFAB, OPT_TYPE_BOOLEAN},
 173 #define OPT_UIDMAP      18
 174         {SHOPT_UIDMAP, OPT_UIDMAP, OPT_TYPE_MAPPING},
 175 #define OPT_GIDMAP      19
 176         {SHOPT_GIDMAP, OPT_GIDMAP, OPT_TYPE_MAPPING},


 177 #ifdef VOLATILE_FH_TEST /* XXX added for testing volatile fh's only */
 178 #define OPT_VOLFH       20
 179         {SHOPT_VOLFH, OPT_VOLFH},
 180 #endif /* VOLATILE_FH_TEST */
 181         NULL
 182 };
 183 
 184 /*
 185  * Codesets that may need to be converted to UTF-8 for file paths.
 186  * Add new names here to add new property support. If we ever get a
 187  * way to query the kernel for character sets, this should become
 188  * dynamically loaded. Make sure changes here are reflected in
 189  * cmd/fs.d/nfs/mountd/nfscmd.c
 190  */
 191 
 192 static char *legal_conv[] = {
 193         "euc-cn",
 194         "euc-jp",
 195         "euc-jpms",
 196         "euc-kr",
 197         "euc-tw",
 198         "iso8859-1",


1010                                 value = strdup("global");
1011                         if (value != NULL)
1012                                 configlog(export,
1013                                     strlen(value) ? value : "global");
1014                         break;
1015                 case OPT_CHARSET_MAP:
1016                         /*
1017                          * Set EX_CHARMAP when there is at least one
1018                          * charmap conversion property. This will get
1019                          * checked by the nfs server when it needs to.
1020                          */
1021                         export->ex_flags |= EX_CHARMAP;
1022                         break;
1023                 case OPT_NOACLFAB:
1024                         if (value != NULL && (strcasecmp(value, "true") == 0 ||
1025                             strcmp(value, "1") == 0))
1026                                 export->ex_flags |= EX_NOACLFAB;
1027                         else
1028                                 export->ex_flags &= ~EX_NOACLFAB;
1029                         break;








1030                 default:
1031                         /* have a syntactic error */
1032                         (void) printf(dgettext(TEXT_DOMAIN,
1033                             "NFS: unrecognized option %s=%s\n"),
1034                             name != NULL ? name : "",
1035                             value != NULL ? value : "");
1036                         break;
1037                 }
1038                 if (name != NULL)
1039                         sa_free_attr_string(name);
1040                 if (value != NULL)
1041                         sa_free_attr_string(value);
1042         }
1043         return (ret);
1044 }
1045 
1046 /*
1047  * cleanup_export(export)
1048  *
1049  * Cleanup the allocated areas so we don't leak memory




 157 #define OPT_PUBLIC      10
 158         {SHOPT_PUBLIC, OPT_PUBLIC, OPT_TYPE_BOOLEAN, OPT_SHARE_ONLY},
 159 #define OPT_INDEX       11
 160         {SHOPT_INDEX, OPT_INDEX, OPT_TYPE_FILE},
 161 #define OPT_LOG         12
 162         {SHOPT_LOG, OPT_LOG, OPT_TYPE_LOGTAG},
 163 #define OPT_CKSUM       13
 164         {SHOPT_CKSUM, OPT_CKSUM, OPT_TYPE_STRINGSET},
 165 #define OPT_NONE        14
 166         {SHOPT_NONE, OPT_NONE, OPT_TYPE_ACCLIST},
 167 #define OPT_ROOT_MAPPING        15
 168         {SHOPT_ROOT_MAPPING, OPT_ROOT_MAPPING, OPT_TYPE_USER},
 169 #define OPT_CHARSET_MAP 16
 170         {"", OPT_CHARSET_MAP, OPT_TYPE_ACCLIST},
 171 #define OPT_NOACLFAB    17
 172         {SHOPT_NOACLFAB, OPT_NOACLFAB, OPT_TYPE_BOOLEAN},
 173 #define OPT_UIDMAP      18
 174         {SHOPT_UIDMAP, OPT_UIDMAP, OPT_TYPE_MAPPING},
 175 #define OPT_GIDMAP      19
 176         {SHOPT_GIDMAP, OPT_GIDMAP, OPT_TYPE_MAPPING},
 177 #define OPT_NOHIDE      20
 178         {SHOPT_NOHIDE, OPT_NOHIDE, OPT_TYPE_BOOLEAN},
 179 #ifdef VOLATILE_FH_TEST /* XXX added for testing volatile fh's only */
 180 #define OPT_VOLFH       21
 181         {SHOPT_VOLFH, OPT_VOLFH},
 182 #endif /* VOLATILE_FH_TEST */
 183         NULL
 184 };
 185 
 186 /*
 187  * Codesets that may need to be converted to UTF-8 for file paths.
 188  * Add new names here to add new property support. If we ever get a
 189  * way to query the kernel for character sets, this should become
 190  * dynamically loaded. Make sure changes here are reflected in
 191  * cmd/fs.d/nfs/mountd/nfscmd.c
 192  */
 193 
 194 static char *legal_conv[] = {
 195         "euc-cn",
 196         "euc-jp",
 197         "euc-jpms",
 198         "euc-kr",
 199         "euc-tw",
 200         "iso8859-1",


1012                                 value = strdup("global");
1013                         if (value != NULL)
1014                                 configlog(export,
1015                                     strlen(value) ? value : "global");
1016                         break;
1017                 case OPT_CHARSET_MAP:
1018                         /*
1019                          * Set EX_CHARMAP when there is at least one
1020                          * charmap conversion property. This will get
1021                          * checked by the nfs server when it needs to.
1022                          */
1023                         export->ex_flags |= EX_CHARMAP;
1024                         break;
1025                 case OPT_NOACLFAB:
1026                         if (value != NULL && (strcasecmp(value, "true") == 0 ||
1027                             strcmp(value, "1") == 0))
1028                                 export->ex_flags |= EX_NOACLFAB;
1029                         else
1030                                 export->ex_flags &= ~EX_NOACLFAB;
1031                         break;
1032                 case OPT_NOHIDE:
1033                         if (value != NULL && (strcasecmp(value, "true") == 0 ||
1034                             strcmp(value, "1") == 0))
1035                                 export->ex_flags |= EX_NOHIDE;
1036                         else
1037                                 export->ex_flags &= ~EX_NOHIDE;
1038 
1039                         break;
1040                 default:
1041                         /* have a syntactic error */
1042                         (void) printf(dgettext(TEXT_DOMAIN,
1043                             "NFS: unrecognized option %s=%s\n"),
1044                             name != NULL ? name : "",
1045                             value != NULL ? value : "");
1046                         break;
1047                 }
1048                 if (name != NULL)
1049                         sa_free_attr_string(name);
1050                 if (value != NULL)
1051                         sa_free_attr_string(value);
1052         }
1053         return (ret);
1054 }
1055 
1056 /*
1057  * cleanup_export(export)
1058  *
1059  * Cleanup the allocated areas so we don't leak memory