Print this page
NEX-17457 kernel share list fails to be updated after fs import
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Reviewed by: Yuri Pankov <yuripv@yuripv.net>
1575 untangle libmlrpc from SMB server
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
NEX-15958 panic importing CA share after failover
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Include in backports of:
  NEX-9808 SMB3 persistent handles
NEX-15958 panic importing CA share after failover
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Include in backports of:
  NEX-9808 SMB3 persistent handles
NEX-9808 SMB3 persistent handles
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
NEX-5665 SMB2 oplock leases
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
NEX-9808 SMB3 persistent handles
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
NEX-5665 SMB2 oplock leases
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
NEX-10098 Disabling SMB server service does not change the sharestate of a smb share to “offline”.
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
NEX-5273 SMB 3 Encryption
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
NEX-3863 Would like an SMB share property to enable/disable quotas
Reviewed by: Bayard Bell <bayard.bell@nexenta.com>
Reviewed by: Kevin Crowe <kevin.crowe@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
SMB-39 Use AF_UNIX pipes for RPC
SMB-50 User-mode SMB server
 Includes work by these authors:
 Thomas Keiser <thomas.keiser@nexenta.com>
 Albert Lee <trisk@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/smbsrv/smb_share.h
          +++ new/usr/src/uts/common/smbsrv/smb_share.h
↓ open down ↓ 13 lines elided ↑ open up ↑
  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   23   * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  24      - * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
       24 + * Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
  25   25   * Copyright (c) 2016 by Delphix. All rights reserved.
  26   26   */
  27   27  
  28   28  #ifndef _SMB_SHARE_H
  29   29  #define _SMB_SHARE_H
  30   30  
  31   31  #include <sys/param.h>
       32 +#include <smb/lmerr.h>
       33 +#include <smb/wintypes.h>
  32   34  #include <smbsrv/string.h>
  33   35  #include <smbsrv/smb_inet.h>
  34   36  #include <smbsrv/hash_table.h>
  35      -#include <smbsrv/wintypes.h>
  36      -#include <smb/lmerr.h>
       37 +#include <smbsrv/smbinfo.h>
  37   38  
  38   39  #if !defined(_KERNEL) && !defined(_FAKE_KERNEL)
  39   40  #include <libshare.h>
  40   41  #endif
  41   42  
  42   43  #ifdef __cplusplus
  43   44  extern "C" {
  44   45  #endif
  45   46  
  46   47  #define SMB_CVOL                "/var/smb/cvol"
↓ open down ↓ 3 lines elided ↑ open up ↑
  50   51  
  51   52  /* Exported named pipes are in... */
  52   53  #define SMB_PIPE_DIR            "/var/smb/pipe"
  53   54  
  54   55  /*
  55   56   * Share Properties:
  56   57   *
  57   58   * name                 Advertised name of the share
  58   59   *
  59   60   * ad-container         Active directory container in which the share
  60      - *                      will be published
       61 + *                      will be published
  61   62   *
  62   63   * abe                  Determines whether Access Based Enumeration is applied
  63   64   *                      to a share
  64   65   *
  65   66   * csc                  Client-side caching (CSC) options applied to this share
  66      - *      disabled        The client MUST NOT cache any files
  67      - *      manual          The client should not automatically cache every file
  68      - *                      that it opens
  69      - *      auto            The client may cache every file that it opens
  70      - *      vdo             The client may cache every file that it opens
       67 + *      disabled        The client MUST NOT cache any files
       68 + *      manual          The client should not automatically cache every file
       69 + *                      that it opens
       70 + *      auto            The client may cache every file that it opens
       71 + *      vdo             The client may cache every file that it opens
  71   72   *                      and satisfy file requests from its local cache.
  72   73   *
  73   74   * catia                CATIA character substitution
  74   75   *
  75   76   * guestok              Determines whether guest access is allowed
  76   77   *
  77      - * next three properties use access-list a al NFS
       78 + * quotas               SMB quotas presented & supported (T/F)
  78   79   *
       80 + * encrypt              Controls SMB3 encryption per-share.
       81 + *      disabled        Server does not tell the client to encrypt requests.
       82 + *      enabled         Server asks, but does not require, that the client
       83 + *                      encrypt its requests.
       84 + *      required        Server denies unencrypted share access.
       85 + *
       86 + * next three properties use access-list a la NFS
       87 + *
  79   88   * ro                   list of hosts that will have read-only access
  80   89   * rw                   list of hosts that will have read/write access
  81   90   * none                 list of hosts that won't be allowed access
  82   91   */
  83   92  #define SHOPT_AD_CONTAINER      "ad-container"
  84   93  #define SHOPT_ABE               "abe"
  85   94  #define SHOPT_NAME              "name"
       95 +#define SHOPT_CA                "ca"
  86   96  #define SHOPT_CSC               "csc"
  87   97  #define SHOPT_CATIA             "catia"
  88   98  #define SHOPT_GUEST             "guestok"
  89   99  #define SHOPT_RO                "ro"
  90  100  #define SHOPT_RW                "rw"
  91  101  #define SHOPT_NONE              "none"
  92  102  #define SHOPT_DFSROOT           "dfsroot"
  93  103  #define SHOPT_DESCRIPTION       "description"
      104 +#define SHOPT_QUOTAS            "quotas"
      105 +#define SHOPT_FSO               "fso"   /* Force Shared Oplocks */
      106 +#define SHOPT_ENCRYPT           "encrypt"
      107 +#define SHOPT_AUTOHOME          "Autohome"
  94  108  
  95  109  #define SMB_DEFAULT_SHARE_GROUP "smb"
  96  110  #define SMB_PROTOCOL_NAME       "smb"
  97  111  
  98  112  /*
  99  113   * RAP protocol share related commands only understand
 100  114   * share names in OEM format and there is a 13 char size
 101  115   * limitation
 102  116   */
 103  117  #define SMB_SHARE_OEMNAME_MAX           13
↓ open down ↓ 59 lines elided ↑ open up ↑
 163  177  #define SMB_SHRF_CSC_AUTO       0x0040
 164  178  #define SMB_SHRF_CSC_VDO        0x0080
 165  179  #define SMB_SHRF_CSC_MASK       0x00F0
 166  180  
 167  181  #define SMB_SHRF_ACC_OPEN       0x0000
 168  182  #define SMB_SHRF_ACC_NONE       0x0100
 169  183  #define SMB_SHRF_ACC_RO         0x0200
 170  184  #define SMB_SHRF_ACC_RW         0x0400
 171  185  #define SMB_SHRF_ACC_ALL        0x0F00
 172  186  
      187 +#define SMB_SHRF_QUOTAS         0x1000  /* Enable SMB Quotas */
      188 +#define SMB_SHRF_FSO            0x2000  /* Force Shared Oplocks */
      189 +#define SMB_SHRF_CA             0x4000  /* Continuous Availability */
      190 +
 173  191  /*
 174  192   * Runtime flags
 175  193   */
 176  194  #define SMB_SHRF_ADMIN          0x01000000
 177  195  #define SMB_SHRF_TRANS          0x10000000
 178  196  #define SMB_SHRF_PERM           0x20000000
 179  197  #define SMB_SHRF_AUTOHOME       0x40000000
      198 +#define SMB_SHRF_REMOVED        0x80000000      /* unshared */
 180  199  
 181  200  #define SMB_SHARE_PRINT         "print$"
 182  201  #define SMB_SHARE_PRINT_LEN     6
 183  202  /*
 184  203   * refcnt is currently only used for autohome.  autohome needs a refcnt
 185  204   * because a user can map their autohome share from more than one client
 186  205   * at the same time and the share should only be removed when the last
 187  206   * one is disconnected
 188  207   */
 189  208  typedef struct smb_share {
↓ open down ↓ 3 lines elided ↑ open up ↑
 193  212          char            shr_container[MAXPATHLEN];
 194  213          uint32_t        shr_flags;
 195  214          uint32_t        shr_type;
 196  215          uint32_t        shr_refcnt;
 197  216          uint32_t        shr_access_value;       /* host return access value */
 198  217          uid_t           shr_uid;                /* autohome only */
 199  218          gid_t           shr_gid;                /* autohome only */
 200  219          char            shr_access_none[MAXPATHLEN];
 201  220          char            shr_access_ro[MAXPATHLEN];
 202  221          char            shr_access_rw[MAXPATHLEN];
      222 +        smb_cfg_val_t   shr_encrypt;
 203  223  } smb_share_t;
 204  224  
 205  225  typedef struct smb_shriter {
 206  226          smb_share_t     si_share;
 207  227          HT_ITERATOR     si_hashiter;
 208  228          boolean_t       si_first;
 209  229  } smb_shriter_t;
 210  230  
 211  231  #define LMSHARES_PER_REQUEST  10
 212  232  typedef struct smb_shrlist {
↓ open down ↓ 21 lines elided ↑ open up ↑
 234  254   */
 235  255  
 236  256  #if !defined(_KERNEL) && !defined(_FAKE_KERNEL)
 237  257  
 238  258  /*
 239  259   * CIFS share management functions exported by libmlsvc
 240  260   */
 241  261  int smb_shr_start(void);
 242  262  void smb_shr_stop(void);
 243  263  void *smb_shr_load(void *);
      264 +void smb_shr_load_execinfo(void);
      265 +void smb_shr_unload(void);
 244  266  void smb_shr_iterinit(smb_shriter_t *);
 245  267  smb_share_t *smb_shr_iterate(smb_shriter_t *);
 246  268  void smb_shr_list(int, smb_shrlist_t *);
 247  269  int smb_shr_count(void);
 248  270  uint32_t smb_shr_add(smb_share_t *);
 249  271  uint32_t smb_shr_remove(char *);
 250  272  uint32_t smb_shr_rename(char *, char *);
 251  273  uint32_t smb_shr_get(char *, smb_share_t *);
 252  274  uint32_t smb_shr_modify(smb_share_t *);
 253  275  uint32_t smb_shr_get_realpath(const char *, char *, int);
↓ open down ↓ 32 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX