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


  20  */
  21 
  22 /*
  23  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  24  * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
  25  */
  26 
  27 /*
  28  * NETR SamLogon and SamLogoff RPC client functions.
  29  */
  30 
  31 #include <stdio.h>
  32 #include <strings.h>
  33 #include <stdlib.h>
  34 #include <time.h>
  35 #include <alloca.h>
  36 #include <unistd.h>
  37 #include <netdb.h>
  38 #include <thread.h>
  39 

  40 #include <smbsrv/libsmb.h>
  41 #include <smbsrv/libmlrpc.h>
  42 #include <smbsrv/libmlsvc.h>
  43 #include <smbsrv/ndl/netlogon.ndl>
  44 #include <smbsrv/netrauth.h>
  45 #include <smbsrv/smbinfo.h>
  46 #include <smbsrv/smb_token.h>
  47 #include <mlsvc.h>
  48 
  49 #define NETLOGON_ATTEMPTS       2
  50 
  51 static uint32_t netlogon_logon(smb_logon_t *, smb_token_t *);
  52 static uint32_t netr_server_samlogon(mlsvc_handle_t *, netr_info_t *, char *,
  53     smb_logon_t *, smb_token_t *);
  54 static void netr_invalidate_chain(void);
  55 static void netr_interactive_samlogon(netr_info_t *, smb_logon_t *,
  56     struct netr_logon_info1 *);
  57 static void netr_network_samlogon(ndr_heap_t *, netr_info_t *,
  58     smb_logon_t *, struct netr_logon_info2 *);
  59 static void netr_setup_identity(ndr_heap_t *, smb_logon_t *,
  60     netr_logon_id_t *);
  61 static boolean_t netr_isadmin(struct netr_validation_info3 *);




  20  */
  21 
  22 /*
  23  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  24  * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
  25  */
  26 
  27 /*
  28  * NETR SamLogon and SamLogoff RPC client functions.
  29  */
  30 
  31 #include <stdio.h>
  32 #include <strings.h>
  33 #include <stdlib.h>
  34 #include <time.h>
  35 #include <alloca.h>
  36 #include <unistd.h>
  37 #include <netdb.h>
  38 #include <thread.h>
  39 
  40 #include <libmlrpc/libmlrpc.h>
  41 #include <smbsrv/libsmb.h>

  42 #include <smbsrv/libmlsvc.h>
  43 #include <smbsrv/ndl/netlogon.ndl>
  44 #include <smbsrv/netrauth.h>
  45 #include <smbsrv/smbinfo.h>
  46 #include <smbsrv/smb_token.h>
  47 #include <mlsvc.h>
  48 
  49 #define NETLOGON_ATTEMPTS       2
  50 
  51 static uint32_t netlogon_logon(smb_logon_t *, smb_token_t *);
  52 static uint32_t netr_server_samlogon(mlsvc_handle_t *, netr_info_t *, char *,
  53     smb_logon_t *, smb_token_t *);
  54 static void netr_invalidate_chain(void);
  55 static void netr_interactive_samlogon(netr_info_t *, smb_logon_t *,
  56     struct netr_logon_info1 *);
  57 static void netr_network_samlogon(ndr_heap_t *, netr_info_t *,
  58     smb_logon_t *, struct netr_logon_info2 *);
  59 static void netr_setup_identity(ndr_heap_t *, smb_logon_t *,
  60     netr_logon_id_t *);
  61 static boolean_t netr_isadmin(struct netr_validation_info3 *);