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

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/smbsrv/libmlsvc/common/mlsvc_util.c
          +++ new/usr/src/lib/smbsrv/libmlsvc/common/mlsvc_util.c
↓ open down ↓ 417 lines elided ↑ open up ↑
 418  418                      xlate_nt_status(status));
 419  419          }
 420  420          return (status);
 421  421  }
 422  422  
 423  423  void
 424  424  mlsvc_disconnect(const char *server)
 425  425  {
 426  426          smbrdr_disconnect(server);
 427  427  }
      428 +
      429 +/*
      430 + * A few more helper functions for RPC services.
      431 + */
      432 +
      433 +/*
      434 + * Check whether or not the specified user has administrator privileges,
      435 + * i.e. is a member of Domain Admins or Administrators.
      436 + * Returns true if the user is an administrator, otherwise returns false.
      437 + */
      438 +boolean_t
      439 +ndr_is_admin(ndr_xa_t *xa)
      440 +{
      441 +        smb_netuserinfo_t *ctx = xa->pipe->np_user;
      442 +
      443 +        return (ctx->ui_flags & SMB_ATF_ADMIN);
      444 +}
      445 +
      446 +/*
      447 + * Check whether or not the specified user has power-user privileges,
      448 + * i.e. is a member of Domain Admins, Administrators or Power Users.
      449 + * This is typically required for operations such as managing shares.
      450 + * Returns true if the user is a power user, otherwise returns false.
      451 + */
      452 +boolean_t
      453 +ndr_is_poweruser(ndr_xa_t *xa)
      454 +{
      455 +        smb_netuserinfo_t *ctx = xa->pipe->np_user;
      456 +
      457 +        return ((ctx->ui_flags & SMB_ATF_ADMIN) ||
      458 +            (ctx->ui_flags & SMB_ATF_POWERUSER));
      459 +}
      460 +
      461 +int32_t
      462 +ndr_native_os(ndr_xa_t *xa)
      463 +{
      464 +        smb_netuserinfo_t *ctx = xa->pipe->np_user;
      465 +
      466 +        return (ctx->ui_native_os);
      467 +}
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX