Print this page
NEX-16818 Add fksmbcl development tool
NEX-17264 SMB client test tp_smbutil_013 fails after NEX-14666
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Matt Barden <matt.barden@nexenta.com>
and: (fix ref leaks)

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libsmbfs/smb/acl_api.c
          +++ new/usr/src/lib/libsmbfs/smb/acl_api.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 + * Copyright 2017 Nexenta Systems, Inc.  All rights reserved.
  25   27   */
  26   28  
  27   29  /*
  28   30   * ACL API for smbfs
  29   31   */
  30   32  
  31   33  #include <sys/types.h>
  32   34  #include <sys/errno.h>
  33   35  #include <sys/cred.h>
  34   36  #include <sys/cmn_err.h>
↓ open down ↓ 41 lines elided ↑ open up ↑
  76   78  {
  77   79          ioc_sdbuf_t     iocb;
  78   80          struct mbuf     *m;
  79   81          int             error;
  80   82  
  81   83          error = mb_init_sz(mbp, MAX_RAW_SD_SIZE);
  82   84          if (error)
  83   85                  return (error);
  84   86  
  85   87          m = mbp->mb_top;
       88 +        bzero(&iocb, sizeof (iocb));
  86   89          iocb.addr = mtod(m, uintptr_t);
  87   90          iocb.alloc = m->m_maxlen;
  88   91          iocb.used = 0;
  89   92          iocb.selector = selector;
  90   93  
  91   94          /*
  92   95           * This does the OTW Get.
  93   96           */
  94      -        if (ioctl(fd, SMBFSIO_GETSD, &iocb) < 0) {
       97 +        if (nsmb_ioctl(fd, SMBFSIO_GETSD, &iocb) < 0) {
  95   98                  error = errno;
  96   99                  goto errout;
  97  100          }
  98  101  
  99  102          m->m_len = iocb.used;
 100  103          return (0);
 101  104  
 102  105  errout:
 103  106          mb_done(mbp);
 104  107          return (error);
↓ open down ↓ 8 lines elided ↑ open up ↑
 113  116          int             error;
 114  117  
 115  118          /* Make the data contiguous. */
 116  119          error = m_lineup(mbp->mb_top, &m);
 117  120          if (error)
 118  121                  return (error);
 119  122  
 120  123          if (mbp->mb_top != m)
 121  124                  mb_initm(mbp, m);
 122  125  
      126 +        bzero(&iocb, sizeof (iocb));
 123  127          iocb.addr = mtod(m, uintptr_t);
 124  128          iocb.alloc = m->m_maxlen;
 125  129          iocb.used  = m->m_len;
 126  130          iocb.selector = selector;
 127  131  
 128  132          /*
 129  133           * This does the OTW Set.
 130  134           */
 131      -        if (ioctl(fd, SMBFSIO_SETSD, &iocb) < 0)
      135 +        if (nsmb_ioctl(fd, SMBFSIO_SETSD, &iocb) < 0)
 132  136                  error = errno;
 133  137  
 134  138          return (error);
 135  139  }
 136  140  
 137  141  /*
 138  142   * Get an NT SD from the open file via ioctl.
 139  143   */
 140  144  int
 141  145  smbfs_acl_getsd(int fd, uint32_t selector, i_ntsd_t **sdp)
↓ open down ↓ 183 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX