Print this page
1575 untangle libmlrpc ... (libmlrpc)

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/smbsrv/libmlrpc/common/ndr_server.c
          +++ new/usr/src/lib/libmlrpc/common/ndr_server.c
↓ open down ↓ 28 lines elided ↑ open up ↑
  29   29  
  30   30  #include <sys/byteorder.h>
  31   31  #include <sys/uio.h>
  32   32  #include <errno.h>
  33   33  #include <synch.h>
  34   34  #include <stdlib.h>
  35   35  #include <strings.h>
  36   36  #include <string.h>
  37   37  #include <thread.h>
  38   38  
  39      -#include <smbsrv/libsmb.h>
  40      -#include <smbsrv/libmlrpc.h>
  41      -#include <smbsrv/ntaccess.h>
       39 +#include <libmlrpc.h>
  42   40  
  43   41  #define NDR_PIPE_SEND(np, buf, len) \
  44   42          ((np)->np_send)((np), (buf), (len))
  45   43  #define NDR_PIPE_RECV(np, buf, len) \
  46   44          ((np)->np_recv)((np), (buf), (len))
  47   45  
  48   46  static int ndr_svc_process(ndr_xa_t *);
  49   47  static int ndr_svc_bind(ndr_xa_t *);
  50   48  static int ndr_svc_request(ndr_xa_t *);
  51   49  static void ndr_reply_prepare_hdr(ndr_xa_t *);
↓ open down ↓ 72 lines elided ↑ open up ↑
 124  122  out4:
 125  123          nds_destruct(&mxa->send_nds);
 126  124  out3:
 127  125          nds_destruct(&mxa->recv_nds);
 128  126  out2:
 129  127          ndr_heap_destroy(mxa->heap);
 130  128  out1:
 131  129          return (rc);
 132  130  }
 133  131  
 134      -/*
 135      - * Check whether or not the specified user has administrator privileges,
 136      - * i.e. is a member of Domain Admins or Administrators.
 137      - * Returns true if the user is an administrator, otherwise returns false.
 138      - */
 139      -boolean_t
 140      -ndr_is_admin(ndr_xa_t *xa)
 141      -{
 142      -        smb_netuserinfo_t *ctx = xa->pipe->np_user;
 143      -
 144      -        return (ctx->ui_flags & SMB_ATF_ADMIN);
 145      -}
 146      -
 147      -/*
 148      - * Check whether or not the specified user has power-user privileges,
 149      - * i.e. is a member of Domain Admins, Administrators or Power Users.
 150      - * This is typically required for operations such as managing shares.
 151      - * Returns true if the user is a power user, otherwise returns false.
 152      - */
 153      -boolean_t
 154      -ndr_is_poweruser(ndr_xa_t *xa)
 155      -{
 156      -        smb_netuserinfo_t *ctx = xa->pipe->np_user;
 157      -
 158      -        return ((ctx->ui_flags & SMB_ATF_ADMIN) ||
 159      -            (ctx->ui_flags & SMB_ATF_POWERUSER));
 160      -}
 161      -
 162      -int32_t
 163      -ndr_native_os(ndr_xa_t *xa)
 164      -{
 165      -        smb_netuserinfo_t *ctx = xa->pipe->np_user;
 166      -
 167      -        return (ctx->ui_native_os);
 168      -}
 169      -
 170  132  /*
 171  133   * Receive an entire RPC request (all fragments)
 172  134   * Returns zero or an NDR fault code.
 173  135   */
 174  136  static int
 175  137  ndr_recv_request(ndr_xa_t *mxa)
 176  138  {
 177  139          ndr_common_header_t     *hdr = &mxa->recv_hdr.common_hdr;
 178  140          ndr_stream_t            *nds = &mxa->recv_nds;
 179  141          unsigned long           saved_size;
↓ open down ↓ 659 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX