From e5a951325a6cac8567af3a66de6d2df577508ae4 Mon Sep 17 00:00:00 2001 From: "Gerald (Jerry) Carter" Date: Wed, 10 Oct 2007 15:34:30 -0500 Subject: [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch. (This used to be commit 5c6c8e1fe93f340005110a7833946191659d88ab) --- source3/include/ads_protos.h | 3 - source3/include/client.h | 24 -- source3/include/dcerpc.h | 0 source3/include/includes.h | 3 + source3/include/ntdomain.h | 10 +- source3/include/ntioctl.h | 2 +- source3/include/popt_common.h | 11 - source3/include/rpc_client.h | 11 +- source3/include/rpc_misc.h | 4 + source3/include/rpc_netlogon.h | 10 + source3/include/rpc_samr.h | 8 +- source3/include/rpc_srvsvc.h | 871 +++++++++++++++++++++++++++++++++++++++++ source3/include/smb.h | 17 +- source3/include/smb_launchd.h | 42 -- source3/include/smb_macros.h | 19 +- source3/include/trans2.h | 24 +- 16 files changed, 928 insertions(+), 131 deletions(-) create mode 100644 source3/include/dcerpc.h create mode 100644 source3/include/rpc_srvsvc.h delete mode 100644 source3/include/smb_launchd.h (limited to 'source3/include') diff --git a/source3/include/ads_protos.h b/source3/include/ads_protos.h index 589bbb5ddb..093b45d7c7 100644 --- a/source3/include/ads_protos.h +++ b/source3/include/ads_protos.h @@ -82,9 +82,6 @@ ADS_STATUS ads_search_retry_extended_dn_ranged(ADS_STRUCT *ads, TALLOC_CTX *mem_ enum ads_extended_dn_flags flags, char ***strings, size_t *num_strings); -BOOL ads_get_dn_from_extended_dn(TALLOC_CTX *mem_ctx, - const char *extended_dn, - char **dn); ADS_STATUS ads_search_retry_sid(ADS_STRUCT *ads, LDAPMessage **res, const DOM_SID *sid, const char **attrs); diff --git a/source3/include/client.h b/source3/include/client.h index f8f6504442..5165b85df1 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -78,28 +78,6 @@ struct rpc_pipe_client { struct dcinfo *dc; }; -/* Transport encryption state. */ -enum smb_trans_enc_type { SMB_TRANS_ENC_NTLM, SMB_TRANS_ENC_GSS }; - -#if defined(HAVE_GSSAPI) && defined(HAVE_KRB5) -struct smb_tran_enc_state_gss { - gss_ctx_id_t gss_ctx; - gss_cred_id_t creds; -}; -#endif - -struct smb_trans_enc_state { - enum smb_trans_enc_type smb_enc_type; - uint16 enc_ctx_num; - BOOL enc_on; - union { - NTLMSSP_STATE *ntlmssp_state; -#if defined(HAVE_GSSAPI) && defined(HAVE_KRB5) - struct smb_tran_enc_state_gss *gss_state; -#endif - } s; -}; - struct cli_state { int port; int fd; @@ -159,8 +137,6 @@ struct cli_state { smb_sign_info sign_info; - struct smb_trans_enc_state *trans_enc_state; /* Setup if we're encrypting SMB's. */ - /* the session key for this CLI, outside any per-pipe authenticaion */ DATA_BLOB user_session_key; diff --git a/source3/include/dcerpc.h b/source3/include/dcerpc.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/source3/include/includes.h b/source3/include/includes.h index 4f11e7a093..a57891b763 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -680,6 +680,7 @@ typedef int BOOL; #include "reg_objects.h" #include "reg_db.h" #include "rpc_samr.h" +#include "rpc_srvsvc.h" #include "rpc_spoolss.h" #include "rpc_eventlog.h" #include "rpc_ds.h" @@ -782,6 +783,8 @@ enum flush_reason_enum { #include "librpc/gen_ndr/srv_svcctl.h" #include "librpc/gen_ndr/srv_lsa.h" #include "librpc/gen_ndr/srv_eventlog.h" +#include "librpc/gen_ndr/srv_winreg.h" +#include "librpc/gen_ndr/srv_initshutdown.h" /***** automatically generated prototypes *****/ #ifndef NO_PROTO_H diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index 147150d978..6ce0ef6464 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -233,9 +233,17 @@ typedef struct pipes_struct { struct dcinfo *dc; /* Keeps the creds data from netlogon. */ /* - * Credentials used for the pipe operations + * Windows user info. + */ + fstring user_name; + fstring domain; + fstring wks; + + /* + * Unix user name and credentials used when a pipe is authenticated. */ + fstring pipe_user_name; struct current_user pipe_user; DATA_BLOB session_key; diff --git a/source3/include/ntioctl.h b/source3/include/ntioctl.h index 2bf9211a1e..c565b8f9a4 100644 --- a/source3/include/ntioctl.h +++ b/source3/include/ntioctl.h @@ -64,7 +64,7 @@ #define FSCTL_DISMOUNT_VOLUME #define FSCTL_GET_NTFS_FILE_RECORD #define FSCTL_ALLOW_EXTENDED_DASD_IO -#define FSCTL_RECALL_FILE 0x00090117 +#define FSCTL_RECALL_FILE #endif diff --git a/source3/include/popt_common.h b/source3/include/popt_common.h index 9944610c62..24c0bbf49c 100644 --- a/source3/include/popt_common.h +++ b/source3/include/popt_common.h @@ -49,17 +49,6 @@ struct user_auth_info { int signing_state; }; -enum smb_server_mode { - /* Daemonize and manage our own sockets */ - SERVER_MODE_DAEMON, - /* Don't daemonize or manage sockets */ - SERVER_MODE_INETD, - /* Don't daemonize, but do manage sockets */ - SERVER_MODE_FOREGROUND, - /* Run in the foreground, log to stdout, don't fork children */ - SERVER_MODE_INTERACTIVE -}; - extern struct user_auth_info cmdline_auth_info; #endif /* _POPT_COMMON_H */ diff --git a/source3/include/rpc_client.h b/source3/include/rpc_client.h index 95aeffdcb9..66c4f58987 100644 --- a/source3/include/rpc_client.h +++ b/source3/include/rpc_client.h @@ -23,15 +23,14 @@ /* autogenerated client stubs */ #include "librpc/gen_ndr/cli_echo.h" -#include "librpc/gen_ndr/cli_unixinfo.h" -#include "librpc/gen_ndr/cli_epmapper.h" -#include "librpc/gen_ndr/cli_dfs.h" #include "librpc/gen_ndr/cli_lsa.h" -#include "librpc/gen_ndr/cli_srvsvc.h" #include "librpc/gen_ndr/cli_svcctl.h" -#include "librpc/gen_ndr/cli_winreg.h" -#include "librpc/gen_ndr/cli_initshutdown.h" #include "librpc/gen_ndr/cli_wkssvc.h" +#include "librpc/gen_ndr/cli_eventlog.h" +#include "librpc/gen_ndr/cli_dfs.h" +#include "librpc/gen_ndr/cli_initshutdown.h" +#include "librpc/gen_ndr/cli_winreg.h" +#include "librpc/gen_ndr/cli_srvsvc.h" /* macro to expand cookie-cutter code in cli_xxx() using rpc_api_pipe_req() */ diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index e50a52fea2..53073c85be 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -92,6 +92,10 @@ enum unistr2_term_codes { UNI_FLAGS_NONE = 0, UNI_STR_TERMINATE = 1, UNI_MAXLEN_ **********************************************************************/ typedef struct policy_handle POLICY_HND; +typedef struct { + uint32 ptr_hnd; /* pointer to enumeration handle */ + uint32 handle; /* enumeration handle */ +} ENUM_HND; #define OUR_HANDLE(hnd) (((hnd)==NULL) ? "NULL" :\ ( IVAL((hnd)->uuid.node,2) == (uint32)sys_getpid() ? "OURS" : \ diff --git a/source3/include/rpc_netlogon.h b/source3/include/rpc_netlogon.h index b2c542a906..a82b977a5b 100644 --- a/source3/include/rpc_netlogon.h +++ b/source3/include/rpc_netlogon.h @@ -45,6 +45,11 @@ #define NET_DSR_GETDCNAMEEX2 0x22 #define NET_SAMLOGON_EX 0x27 +/* Secure Channel types. used in NetrServerAuthenticate negotiation */ +#define SEC_CHAN_WKSTA 2 +#define SEC_CHAN_DOMAIN 4 +#define SEC_CHAN_BDC 6 + /* Returned delta types */ #define SAM_DELTA_DOMAIN_INFO 0x01 #define SAM_DELTA_GROUP_INFO 0x02 @@ -63,6 +68,11 @@ #define SAM_DELTA_DELETE_USER 0x15 #define SAM_DELTA_MODIFIED_COUNT 0x16 +/* SAM database types */ +#define SAM_DATABASE_DOMAIN 0x00 /* Domain users and groups */ +#define SAM_DATABASE_BUILTIN 0x01 /* BUILTIN users and groups */ +#define SAM_DATABASE_PRIVS 0x02 /* Privileges */ + /* flags use when sending a NETLOGON_CONTROL request */ #define NETLOGON_CONTROL_SYNC 0x2 diff --git a/source3/include/rpc_samr.h b/source3/include/rpc_samr.h index 368ebbbc5b..2273fba2e6 100644 --- a/source3/include/rpc_samr.h +++ b/source3/include/rpc_samr.h @@ -4,7 +4,7 @@ Copyright (C) Andrew Tridgell 1992-2000 Copyright (C) Luke Kenneth Casson Leighton 1996-2000 Copyright (C) Paul Ashton 1997-2000 - Copyright (C) Jean François Micouleau 1998-2001 + Copyright (C) Jean François Micouleau 1998-2001 Copyright (C) Jim McDonough 2002 @@ -127,11 +127,11 @@ SamrTestPrivateFunctionsUser #define SAMR_REMOVE_SID_FOREIGN_DOMAIN 0x2d #define SAMR_QUERY_DOMAIN_INFO2 0x2e /* looks like an alias for SAMR_QUERY_DOMAIN_INFO */ #define SAMR_UNKNOWN_2f 0x2f -#define SAMR_QUERY_DISPINFO2 0x30 /* Alias for SAMR_QUERY_DISPINFO +#define SAMR_QUERY_DISPINFO3 0x30 /* Alias for SAMR_QUERY_DISPINFO with info level 3 */ -#define SAMR_GET_DISPENUM_INDEX2 0x31 +#define SAMR_UNKNOWN_31 0x31 #define SAMR_CREATE_USER 0x32 -#define SAMR_QUERY_DISPINFO3 0x33 /* Alias for SAMR_QUERY_DISPINFO +#define SAMR_QUERY_DISPINFO4 0x33 /* Alias for SAMR_QUERY_DISPINFO with info level 4 */ #define SAMR_ADDMULTI_ALIASMEM 0x34 diff --git a/source3/include/rpc_srvsvc.h b/source3/include/rpc_srvsvc.h new file mode 100644 index 0000000000..097c0d4348 --- /dev/null +++ b/source3/include/rpc_srvsvc.h @@ -0,0 +1,871 @@ +/* + Unix SMB/CIFS implementation. + SMB parameters and setup + Copyright (C) Andrew Tridgell 1992-1997 + Copyright (C) Luke Kenneth Casson Leighton 1996-1997 + Copyright (C) Paul Ashton 1997 + Copyright (C) Nigel Williams 2001 + Copyright (C) Gerald (Jerry) Carter 2006. + + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef _RPC_SRVSVC_H /* _RPC_SRVSVC_H */ +#define _RPC_SRVSVC_H + +/* srvsvc pipe */ +#define SRV_NET_CONN_ENUM 0x08 +#define SRV_NET_FILE_ENUM 0x09 +#define SRV_NET_FILE_CLOSE 0x0b +#define SRV_NET_SESS_ENUM 0x0c +#define SRV_NET_SESS_DEL 0x0d +#define SRV_NET_SHARE_ADD 0x0e +#define SRV_NET_SHARE_ENUM_ALL 0x0f +#define SRV_NET_SHARE_GET_INFO 0x10 +#define SRV_NET_SHARE_SET_INFO 0x11 +#define SRV_NET_SHARE_DEL 0x12 +#define SRV_NET_SHARE_DEL_STICKY 0x13 +#define SRV_NET_SRV_GET_INFO 0x15 +#define SRV_NET_SRV_SET_INFO 0x16 +#define SRV_NET_DISK_ENUM 0x17 +#define SRV_NET_REMOTE_TOD 0x1c +#define SRV_NET_NAME_VALIDATE 0x21 +#define SRV_NET_SHARE_ENUM 0x24 +#define SRV_NET_FILE_QUERY_SECDESC 0x27 +#define SRV_NET_FILE_SET_SECDESC 0x28 + +#define MAX_SERVER_DISK_ENTRIES 15 + +typedef struct disk_info { + uint32 unknown; + UNISTR3 disk_name; +} DISK_INFO; + +typedef struct disk_enum_container { + uint32 level; + uint32 entries_read; + uint32 unknown; + uint32 disk_info_ptr; + DISK_INFO *disk_info; +} DISK_ENUM_CONTAINER; + +typedef struct net_srv_disk_enum { + uint32 ptr_srv_name; /* pointer (to server name?) */ + UNISTR2 uni_srv_name; /* server name */ + + DISK_ENUM_CONTAINER disk_enum_ctr; + + uint32 preferred_len; /* preferred maximum length (0xffff ffff) */ + uint32 total_entries; /* total number of entries */ + ENUM_HND enum_hnd; + WERROR status; /* return status */ +} SRV_Q_NET_DISK_ENUM, SRV_R_NET_DISK_ENUM; + +/***************************/ + +typedef struct { + UNISTR2 *servername; + UNISTR2 sharename; + uint32 type; + uint32 flags; + WERROR status; +} SRV_Q_NET_NAME_VALIDATE; + +typedef struct { + WERROR status; +} SRV_R_NET_NAME_VALIDATE; + +/***************************/ + +/* oops - this is going to take up a *massive* amount of stack. */ +/* the UNISTR2s already have 1024 uint16 chars in them... */ + +#define MAX_SESS_ENTRIES 32 + +typedef struct { + UNISTR2 *sharename; +} SESS_INFO_0; + +typedef struct { + uint32 num_entries_read; + uint32 ptr_sess_info; + uint32 num_entries_read2; + SESS_INFO_0 info_0[MAX_SESS_ENTRIES]; +} SRV_SESS_INFO_0; + +typedef struct { + UNISTR2 *sharename; + UNISTR2 *username; + uint32 num_opens; + uint32 open_time; + uint32 idle_time; + uint32 user_flags; +} SESS_INFO_1; + +typedef struct { + uint32 num_entries_read; + uint32 ptr_sess_info; + uint32 num_entries_read2; + SESS_INFO_1 info_1[MAX_SESS_ENTRIES]; +} SRV_SESS_INFO_1; + +typedef struct { + uint32 switch_value; + uint32 ptr_sess_ctr; + union { + SRV_SESS_INFO_0 info0; + SRV_SESS_INFO_1 info1; + } sess; + +} SRV_SESS_INFO_CTR; + +typedef struct { + UNISTR2 *servername; + UNISTR2 *qualifier; + UNISTR2 *username; + uint32 sess_level; + SRV_SESS_INFO_CTR *ctr; + uint32 preferred_len; + ENUM_HND enum_hnd; +} SRV_Q_NET_SESS_ENUM; + +typedef struct { + uint32 sess_level; + SRV_SESS_INFO_CTR *ctr; + uint32 total_entries; + ENUM_HND enum_hnd; + WERROR status; +} SRV_R_NET_SESS_ENUM; + +/***************************/ + +/* SRV_Q_NET_SESS_DEL */ +typedef struct q_net_sess_del +{ + uint32 ptr_srv_name; /* pointer (to server name?) */ + UNISTR2 uni_srv_name; /* server name */ + + uint32 ptr_cli_name; /* pointer (to qualifier name) */ + UNISTR2 uni_cli_name; /* qualifier name "\\qualifier" */ + + uint32 ptr_user_name; /* pointer (to user name */ + UNISTR2 uni_user_name; /* user name */ + +} SRV_Q_NET_SESS_DEL; + +/* SRV_R_NET_SESS_DEL */ +typedef struct r_net_sess_del +{ + WERROR status; /* return status */ + +} SRV_R_NET_SESS_DEL; + +/* CONN_INFO_0 (pointers to level 0 connection info strings) */ +typedef struct ptr_conn_info0 +{ + uint32 id; /* connection id. */ + +} CONN_INFO_0; + +/* oops - this is going to take up a *massive* amount of stack. */ +/* the UNISTR2s already have 1024 uint16 chars in them... */ +#define MAX_CONN_ENTRIES 32 + +/* SRV_CONN_INFO_0 */ +typedef struct srv_conn_info_0_info +{ + uint32 num_entries_read; /* EntriesRead */ + uint32 ptr_conn_info; /* Buffer */ + uint32 num_entries_read2; /* EntriesRead */ + + CONN_INFO_0 info_0 [MAX_CONN_ENTRIES]; /* connection entry pointers */ + +} SRV_CONN_INFO_0; + +/* CONN_INFO_1 (pointers to level 1 connection info strings) */ +typedef struct ptr_conn_info1 +{ + uint32 id; /* connection id */ + uint32 type; /* 0x3 */ + uint32 num_opens; + uint32 num_users; + uint32 open_time; + + uint32 ptr_usr_name; /* pointer to user name. */ + uint32 ptr_net_name; /* pointer to network name (e.g IPC$). */ + +} CONN_INFO_1; + +/* CONN_INFO_1_STR (level 1 connection info strings) */ +typedef struct str_conn_info1 +{ + UNISTR2 uni_usr_name; /* unicode string of user */ + UNISTR2 uni_net_name; /* unicode string of name */ + +} CONN_INFO_1_STR; + +/* SRV_CONN_INFO_1 */ +typedef struct srv_conn_info_1_info +{ + uint32 num_entries_read; /* EntriesRead */ + uint32 ptr_conn_info; /* Buffer */ + uint32 num_entries_read2; /* EntriesRead */ + + CONN_INFO_1 info_1 [MAX_CONN_ENTRIES]; /* connection entry pointers */ + CONN_INFO_1_STR info_1_str[MAX_CONN_ENTRIES]; /* connection entry strings */ + +} SRV_CONN_INFO_1; + +/* SRV_CONN_INFO_CTR */ +typedef struct srv_conn_info_ctr_info +{ + uint32 switch_value; /* switch value */ + uint32 ptr_conn_ctr; /* pointer to conn info union */ + union + { + SRV_CONN_INFO_0 info0; /* connection info level 0 */ + SRV_CONN_INFO_1 info1; /* connection info level 1 */ + + } conn; + +} SRV_CONN_INFO_CTR; + + +/* SRV_Q_NET_CONN_ENUM */ +typedef struct q_net_conn_enum_info +{ + uint32 ptr_srv_name; /* pointer (to server name) */ + UNISTR2 uni_srv_name; /* server name "\\server" */ + + uint32 ptr_qual_name; /* pointer (to qualifier name) */ + UNISTR2 uni_qual_name; /* qualifier name "\\qualifier" */ + + uint32 conn_level; /* connection level */ + + SRV_CONN_INFO_CTR *ctr; + + uint32 preferred_len; /* preferred maximum length (0xffff ffff) */ + ENUM_HND enum_hnd; + +} SRV_Q_NET_CONN_ENUM; + +/* SRV_R_NET_CONN_ENUM */ +typedef struct r_net_conn_enum_info +{ + uint32 conn_level; /* share level */ + + SRV_CONN_INFO_CTR *ctr; + + uint32 total_entries; /* total number of entries */ + ENUM_HND enum_hnd; + + WERROR status; /* return status */ + +} SRV_R_NET_CONN_ENUM; + +/* SH_INFO_0 */ +typedef struct ptr_share_info0 +{ + uint32 ptr_netname; /* pointer to net name. */ +} SH_INFO_0; + +/* SH_INFO_0_STR (level 0 share info strings) */ +typedef struct str_share_info0 +{ + SH_INFO_0 *ptrs; + + UNISTR2 uni_netname; /* unicode string of net name */ + +} SH_INFO_0_STR; + +/* SRV_SHARE_INFO_0 */ +typedef struct share_info_0_info +{ + SH_INFO_0 info_0; + SH_INFO_0_STR info_0_str; + +} SRV_SHARE_INFO_0; + +/* SH_INFO_1 (pointers to level 1 share info strings) */ +typedef struct ptr_share_info1 +{ + uint32 ptr_netname; /* pointer to net name. */ + uint32 type; /* ipc, print, disk ... */ + uint32 ptr_remark; /* pointer to comment. */ + +} SH_INFO_1; + +/* SH_INFO_1_STR (level 1 share info strings) */ +typedef struct str_share_info1 +{ + SH_INFO_1 *ptrs; + + UNISTR2 uni_netname; /* unicode string of net name */ + UNISTR2 uni_remark; /* unicode string of comment */ + +} SH_INFO_1_STR; + +/* SRV_SHARE_INFO_1 */ +typedef struct share_info_1_info +{ + SH_INFO_1 info_1; + SH_INFO_1_STR info_1_str; + +} SRV_SHARE_INFO_1; + +/* SH_INFO_2 (pointers to level 2 share info strings) */ +typedef struct ptr_share_info2 +{ + uint32 ptr_netname; /* pointer to net name. */ + uint32 type; /* ipc, print, disk ... */ + uint32 ptr_remark; /* pointer to comment. */ + uint32 perms; /* permissions */ + uint32 max_uses; /* maximum uses */ + uint32 num_uses; /* current uses */ + uint32 ptr_path; /* pointer to path name */ + uint32 ptr_passwd; /* pointer to password */ + +} SH_INFO_2; + +/* SH_INFO_2_STR (level 2 share info strings) */ +typedef struct str_share_info2 +{ + SH_INFO_2 *ptrs; + + UNISTR2 uni_netname; /* unicode string of net name (e.g NETLOGON) */ + UNISTR2 uni_remark; /* unicode string of comment (e.g "Logon server share") */ + UNISTR2 uni_path; /* unicode string of local path (e.g c:\winnt\system32\repl\import\scripts) */ + UNISTR2 uni_passwd; /* unicode string of password - presumably for share level security (e.g NULL) */ + +} SH_INFO_2_STR; + +/* SRV_SHARE_INFO_2 */ +typedef struct share_info_2_info +{ + SH_INFO_2 info_2; + SH_INFO_2_STR info_2_str; + +} SRV_SHARE_INFO_2; + +typedef struct ptr_share_info501 +{ + uint32 ptr_netname; /* pointer to net name */ + uint32 type; /* ipc, print, disk */ + uint32 ptr_remark; /* pointer to comment */ + uint32 csc_policy; /* client-side offline caching policy << 4 */ +} SH_INFO_501; + +typedef struct str_share_info501 +{ + UNISTR2 uni_netname; /* unicode string of net name */ + UNISTR2 uni_remark; /* unicode string of comment */ +} SH_INFO_501_STR; + +/* SRV_SHARE_INFO_501 */ +typedef struct share_info_501_info +{ + SH_INFO_501 info_501; + SH_INFO_501_STR info_501_str; +} SRV_SHARE_INFO_501; + +/* SH_INFO_502 (pointers to level 502 share info strings) */ +typedef struct ptr_share_info502 +{ + uint32 ptr_netname; /* pointer to net name. */ + uint32 type; /* ipc, print, disk ... */ + uint32 ptr_remark; /* pointer to comment. */ + uint32 perms; /* permissions */ + uint32 max_uses; /* maximum uses */ + uint32 num_uses; /* current uses */ + uint32 ptr_path; /* pointer to path name */ + uint32 ptr_passwd; /* pointer to password */ + uint32 reserved; /* this holds the space taken by the sd in the rpc packet */ + uint32 reserved_offset; /* required for _post operation when marshalling */ + uint32 sd_size; /* size of security descriptor */ + uint32 ptr_sd; /* pointer to security descriptor */ + +} SH_INFO_502; + +/* SH_INFO_502_STR (level 502 share info strings) */ +typedef struct str_share_info502 +{ + SH_INFO_502 *ptrs; + + UNISTR2 uni_netname; /* unicode string of net name (e.g NETLOGON) */ + UNISTR2 uni_remark; /* unicode string of comment (e.g "Logon server share") */ + UNISTR2 uni_path; /* unicode string of local path (e.g c:\winnt\system32\repl\import\scripts) */ + UNISTR2 uni_passwd; /* unicode string of password - presumably for share level security (e.g NULL) */ + + uint32 reserved; + uint32 sd_size; + SEC_DESC *sd; + +} SH_INFO_502_STR; + +/* SRV_SHARE_INFO_502 */ +typedef struct share_info_502_info +{ + SH_INFO_502 info_502; + SH_INFO_502_STR info_502_str; + +} SRV_SHARE_INFO_502; + +typedef struct ptr_share_info1004 +{ + uint32 ptr_remark; + +} SH_INFO_1004; + +typedef struct str_share_info1004 +{ + SH_INFO_1004 *ptrs; + + UNISTR2 uni_remark; + +} SH_INFO_1004_STR; + +typedef struct ptr_info_1004_info +{ + SH_INFO_1004 info_1004; + SH_INFO_1004_STR info_1004_str; +} SRV_SHARE_INFO_1004; + +typedef struct share_info_1005_info +{ + uint32 share_info_flags; +} SRV_SHARE_INFO_1005; + +typedef struct share_info_1006_info +{ + uint32 max_uses; +} SRV_SHARE_INFO_1006; + +typedef struct ptr_share_info1007 +{ + uint32 flags; + uint32 ptr_AlternateDirectoryName; + +} SH_INFO_1007; + +typedef struct str_share_info1007 +{ + SH_INFO_1007 *ptrs; + + UNISTR2 uni_AlternateDirectoryName; + +} SH_INFO_1007_STR; + +typedef struct ptr_info_1007_info +{ + SH_INFO_1007 info_1007; + SH_INFO_1007_STR info_1007_str; +} SRV_SHARE_INFO_1007; + +/* SRV_SHARE_INFO_1501 */ +typedef struct share_info_1501_info +{ + SEC_DESC_BUF *sdb; +} SRV_SHARE_INFO_1501; + +/* SRV_SHARE_INFO_CTR */ +typedef struct srv_share_info_ctr_info +{ + uint32 info_level; + uint32 switch_value; + uint32 ptr_share_info; + + uint32 num_entries; + uint32 ptr_entries; + uint32 num_entries2; + + union { + SRV_SHARE_INFO_0 *info0; + SRV_SHARE_INFO_1 *info1; /* share info level 1 */ + SRV_SHARE_INFO_2 *info2; /* share info level 2 */ + SRV_SHARE_INFO_501 *info501; /* share info level 501 */ + SRV_SHARE_INFO_502 *info502; /* share info level 502 */ + SRV_SHARE_INFO_1004 *info1004; + SRV_SHARE_INFO_1005 *info1005; + SRV_SHARE_INFO_1006 *info1006; + SRV_SHARE_INFO_1007 *info1007; + SRV_SHARE_INFO_1501 *info1501; + void *info; + + } share; + +} SRV_SHARE_INFO_CTR; + +/* SRV_Q_NET_SHARE_ENUM */ +typedef struct q_net_share_enum_info +{ + uint32 ptr_srv_name; /* pointer (to server name?) */ + UNISTR2 uni_srv_name; /* server name */ + + SRV_SHARE_INFO_CTR ctr; /* share info container */ + + uint32 preferred_len; /* preferred maximum length (0xffff ffff) */ + + ENUM_HND enum_hnd; + +} SRV_Q_NET_SHARE_ENUM; + + +/* SRV_R_NET_SHARE_ENUM */ +typedef struct r_net_share_enum_info +{ + SRV_SHARE_INFO_CTR ctr; /* share info container */ + + uint32 total_entries; /* total number of entries */ + ENUM_HND enum_hnd; + + WERROR status; /* return status */ + +} SRV_R_NET_SHARE_ENUM; + + +/* SRV_Q_NET_SHARE_GET_INFO */ +typedef struct q_net_share_get_info_info +{ + uint32 ptr_srv_name; + UNISTR2 uni_srv_name; + + UNISTR2 uni_share_name; + uint32 info_level; + +} SRV_Q_NET_SHARE_GET_INFO; + +/* SRV_SHARE_INFO */ +typedef struct srv_share_info { + uint32 switch_value; + uint32 ptr_share_ctr; + + union { + SRV_SHARE_INFO_0 info0; + SRV_SHARE_INFO_1 info1; + SRV_SHARE_INFO_2 info2; + SRV_SHARE_INFO_501 info501; + SRV_SHARE_INFO_502 info502; + SRV_SHARE_INFO_1004 info1004; + SRV_SHARE_INFO_1005 info1005; + SRV_SHARE_INFO_1006 info1006; + SRV_SHARE_INFO_1007 info1007; + SRV_SHARE_INFO_1501 info1501; + } share; +} SRV_SHARE_INFO; + +/* SRV_R_NET_SHARE_GET_INFO */ +typedef struct r_net_share_get_info_info +{ + SRV_SHARE_INFO info; + WERROR status; + +} SRV_R_NET_SHARE_GET_INFO; + +/* SRV_Q_NET_SHARE_SET_INFO */ +typedef struct q_net_share_set_info_info +{ + uint32 ptr_srv_name; + UNISTR2 uni_srv_name; + + UNISTR2 uni_share_name; + uint32 info_level; + + SRV_SHARE_INFO info; + + uint32 ptr_parm_error; + uint32 parm_error; + +} SRV_Q_NET_SHARE_SET_INFO; + +/* SRV_R_NET_SHARE_SET_INFO */ +typedef struct r_net_share_set_info +{ + uint32 ptr_parm_error; + uint32 parm_error; + + WERROR status; /* return status */ + +} SRV_R_NET_SHARE_SET_INFO; + +/* SRV_Q_NET_SHARE_ADD */ +typedef struct q_net_share_add +{ + uint32 ptr_srv_name; + UNISTR2 uni_srv_name; + + uint32 info_level; + + SRV_SHARE_INFO info; + + uint32 ptr_err_index; /* pointer to error index */ + uint32 err_index; /* index in info to field in error */ + +} SRV_Q_NET_SHARE_ADD; + +/* SRV_R_NET_SHARE_ADD */ +typedef struct r_net_share_add +{ + + uint32 ptr_parm_error; + uint32 parm_error; + + WERROR status; /* return status */ + +} SRV_R_NET_SHARE_ADD; + +/* SRV_Q_NET_SHARE_DEL */ +typedef struct q_net_share_del +{ + uint32 ptr_srv_name; + UNISTR2 uni_srv_name; + UNISTR2 uni_share_name; + uint32 reserved; + +} SRV_Q_NET_SHARE_DEL; + +/* SRV_R_NET_SHARE_DEL */ +typedef struct r_net_share_del +{ + WERROR status; /* return status */ + +} SRV_R_NET_SHARE_DEL; + +/***************************/ + +typedef struct { + uint32 id; /* file index */ + uint32 perms; /* file permissions. don't know what format */ + uint32 num_locks; /* file locks */ + UNISTR2 *path; /* file name */ + UNISTR2 *user; /* file owner */ +} FILE_INFO_3; + +typedef struct { + uint32 level; /* switch value */ + uint32 ptr_file_info; /* pointer to file info union */ + + uint32 num_entries; + uint32 ptr_entries; + uint32 num_entries2; + union { + FILE_INFO_3 *info3; + } file; + +} SRV_FILE_INFO_CTR; + +typedef struct { + UNISTR2 *servername; + UNISTR2 *qualifier; + UNISTR2 *username; + uint32 level; + SRV_FILE_INFO_CTR ctr; + uint32 preferred_len; /* preferred maximum length (0xffff ffff) */ + ENUM_HND enum_hnd; +} SRV_Q_NET_FILE_ENUM; + +typedef struct { + uint32 level; + SRV_FILE_INFO_CTR ctr; + uint32 total_entries; + ENUM_HND enum_hnd; + WERROR status; +} SRV_R_NET_FILE_ENUM; + +/* SRV_INFO_100 */ +typedef struct srv_info_100_info +{ + uint32 platform_id; /* 0x500 */ + uint32 ptr_name; /* pointer to server name */ + + UNISTR2 uni_name; /* server name "server" */ + +} SRV_INFO_100; + +/* SRV_INFO_101 */ +typedef struct srv_info_101_info +{ + uint32 platform_id; /* 0x500 */ + uint32 ptr_name; /* pointer to server name */ + uint32 ver_major; /* 0x4 */ + uint32 ver_minor; /* 0x2 */ + uint32 srv_type; /* browse etc type */ + uint32 ptr_comment; /* pointer to server comment */ + + UNISTR2 uni_name; /* server name "server" */ + UNISTR2 uni_comment; /* server comment "samba x.x.x blah" */ + +} SRV_INFO_101; + +/* SRV_INFO_102 */ +typedef struct srv_info_102_info +{ + uint32 platform_id; /* 0x500 */ + uint32 ptr_name; /* pointer to server name */ + uint32 ver_major; /* 0x4 */ + uint32 ver_minor; /* 0x2 */ + uint32 srv_type; /* browse etc type */ + uint32 ptr_comment; /* pointer to server comment */ + uint32 users; /* 0xffff ffff*/ + uint32 disc; /* 0xf */ + uint32 hidden; /* 0x0 */ + uint32 announce; /* 240 */ + uint32 ann_delta; /* 3000 */ + uint32 licenses; /* 0 */ + uint32 ptr_usr_path; /* pointer to user path */ + + UNISTR2 uni_name; /* server name "server" */ + UNISTR2 uni_comment; /* server comment "samba x.x.x blah" */ + UNISTR2 uni_usr_path; /* "c:\" (eh?) */ + +} SRV_INFO_102; + + +/* SRV_INFO_CTR */ +typedef struct srv_info_ctr_info +{ + uint32 switch_value; /* switch value */ + uint32 ptr_srv_ctr; /* pointer to server info */ + union + { + SRV_INFO_102 sv102; /* server info level 102 */ + SRV_INFO_101 sv101; /* server info level 101 */ + SRV_INFO_100 sv100; /* server info level 100 */ + + } srv; + +} SRV_INFO_CTR; + +/* SRV_Q_NET_SRV_GET_INFO */ +typedef struct q_net_srv_get_info +{ + uint32 ptr_srv_name; + UNISTR2 uni_srv_name; /* "\\server" */ + uint32 switch_value; + +} SRV_Q_NET_SRV_GET_INFO; + +/* SRV_R_NET_SRV_GET_INFO */ +typedef struct r_net_srv_get_info +{ + SRV_INFO_CTR *ctr; + + WERROR status; /* return status */ + +} SRV_R_NET_SRV_GET_INFO; + +/* SRV_Q_NET_SRV_SET_INFO */ +typedef struct q_net_srv_set_info +{ + uint32 ptr_srv_name; + UNISTR2 uni_srv_name; /* "\\server" */ + uint32 switch_value; + + SRV_INFO_CTR *ctr; + +} SRV_Q_NET_SRV_SET_INFO; + + +/* SRV_R_NET_SRV_SET_INFO */ +typedef struct r_net_srv_set_info +{ + uint32 switch_value; /* switch value */ + + WERROR status; /* return status */ + +} SRV_R_NET_SRV_SET_INFO; + +/* SRV_Q_NET_REMOTE_TOD */ +typedef struct q_net_remote_tod +{ + uint32 ptr_srv_name; + UNISTR2 uni_srv_name; /* "\\server" */ + +} SRV_Q_NET_REMOTE_TOD; + +/* TIME_OF_DAY_INFO */ +typedef struct time_of_day_info +{ + uint32 elapsedt; + uint32 msecs; + uint32 hours; + uint32 mins; + uint32 secs; + uint32 hunds; + uint32 zone; + uint32 tintervals; + uint32 day; + uint32 month; + uint32 year; + uint32 weekday; + +} TIME_OF_DAY_INFO; + +/* SRV_R_NET_REMOTE_TOD */ +typedef struct r_net_remote_tod +{ + uint32 ptr_srv_tod; /* pointer to TOD */ + TIME_OF_DAY_INFO *tod; + + WERROR status; /* return status */ + +} SRV_R_NET_REMOTE_TOD; + +/* SRV_Q_NET_FILE_QUERY_SECDESC */ +typedef struct q_net_file_query_secdesc +{ + uint32 ptr_srv_name; + UNISTR2 uni_srv_name; + uint32 ptr_qual_name; + UNISTR2 uni_qual_name; + UNISTR2 uni_file_name; + uint32 unknown1; + uint32 unknown2; + uint32 unknown3; +} SRV_Q_NET_FILE_QUERY_SECDESC; + +/* SRV_R_NET_FILE_QUERY_SECDESC */ +typedef struct r_net_file_query_secdesc +{ + uint32 ptr_response; + uint32 size_response; + uint32 ptr_secdesc; + uint32 size_secdesc; + SEC_DESC *sec_desc; + WERROR status; +} SRV_R_NET_FILE_QUERY_SECDESC; + +/* SRV_Q_NET_FILE_SET_SECDESC */ +typedef struct q_net_file_set_secdesc +{ + uint32 ptr_srv_name; + UNISTR2 uni_srv_name; + uint32 ptr_qual_name; + UNISTR2 uni_qual_name; + UNISTR2 uni_file_name; + uint32 sec_info; + uint32 size_set; + uint32 ptr_secdesc; + uint32 size_secdesc; + SEC_DESC *sec_desc; +} SRV_Q_NET_FILE_SET_SECDESC; + +/* SRV_R_NET_FILE_SET_SECDESC */ +typedef struct r_net_file_set_secdesc +{ + WERROR status; +} SRV_R_NET_FILE_SET_SECDESC; + + +#endif /* _RPC_SRVSVC_H */ diff --git a/source3/include/smb.h b/source3/include/smb.h index 21bdd9b5c5..75ec4363d0 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -78,7 +78,6 @@ #define WRITE_ERROR 4 /* This error code can go into the client smb_rw_error. */ #define READ_BAD_SIG 5 #define DO_NOT_DO_TDIS 6 /* cli_close_connection() check for this when smbfs wants to keep tree connected */ -#define READ_BAD_DECRYPT 7 #define DIR_STRUCT_SIZE 43 @@ -186,10 +185,9 @@ typedef uint32 codepoint_t; #define PIPE_NETDFS "\\PIPE\\netdfs" #define PIPE_ECHO "\\PIPE\\rpcecho" #define PIPE_SHUTDOWN "\\PIPE\\initshutdown" -#define PIPE_EPMAPPER "\\PIPE\\epmapper" +#define PIPE_EPM "\\PIPE\\epmapper" #define PIPE_SVCCTL "\\PIPE\\svcctl" #define PIPE_EVENTLOG "\\PIPE\\eventlog" -#define PIPE_UNIXINFO "\\PIPE\\unixinfo" #define PIPE_NETLOGON_PLAIN "\\NETLOGON" @@ -206,10 +204,8 @@ typedef uint32 codepoint_t; #define PI_INITSHUTDOWN 10 #define PI_SVCCTL 11 #define PI_EVENTLOG 12 -#define PI_UNIXINFO 13 -#define PI_NTSVCS 14 -#define PI_EPMAPPER 15 -#define PI_MAX_PIPES 16 +#define PI_NTSVCS 13 +#define PI_MAX_PIPES 14 /* 64 bit time (100usec) since ????? - cifs6.txt, section 3.5, page 30 */ typedef uint64_t NTTIME; @@ -304,11 +300,10 @@ struct id_map { #include "librpc/ndr/misc.h" #include "librpc/ndr/security.h" #include "librpc/ndr/libndr.h" -#include "librpc/gen_ndr/unixinfo.h" #include "librpc/gen_ndr/lsa.h" #include "librpc/gen_ndr/dfs.h" -#include "librpc/gen_ndr/initshutdown.h" #include "librpc/gen_ndr/winreg.h" +#include "librpc/gen_ndr/initshutdown.h" #include "librpc/gen_ndr/eventlog.h" #include "librpc/gen_ndr/srvsvc.h" #include "librpc/gen_ndr/wkssvc.h" @@ -507,6 +502,7 @@ typedef struct files_struct { BOOL modified; BOOL is_directory; BOOL is_stat; + BOOL aio_write_behind; BOOL lockdb_clean; BOOL initial_delete_on_close; /* Only set at NTCreateX if file was created. */ BOOL posix_open; @@ -657,6 +653,7 @@ typedef struct connection_struct { name_compare_entry *hide_list; /* Per-share list of files to return as hidden. */ name_compare_entry *veto_list; /* Per-share list of files to veto (never show). */ name_compare_entry *veto_oplock_list; /* Per-share list of files to refuse oplocks on. */ + name_compare_entry *aio_write_behind_list; /* Per-share list of files to use aio write behind on. */ struct dfree_cached_info *dfree_info; struct trans_state *pending_trans; struct notify_context *notify_ctx; @@ -1918,6 +1915,4 @@ enum usershare_err { /* Different reasons for closing a file. */ enum file_close_type {NORMAL_CLOSE=0,SHUTDOWN_CLOSE,ERROR_CLOSE}; -#include "librpc/gen_ndr/epmapper.h" - #endif /* _SMB_H */ diff --git a/source3/include/smb_launchd.h b/source3/include/smb_launchd.h deleted file mode 100644 index dcbe43ce71..0000000000 --- a/source3/include/smb_launchd.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - Unix SMB/CIFS implementation. - Launchd integration wrapper API - - Copyright (C) James Peach 2007 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -struct smb_launch_info -{ - int idle_timeout_secs; - int num_sockets; - int *socket_list; -}; - -/* Retrieve launchd configuration. Returns True if we are running under - * launchd, False otherwise. NOTE this does not guarantee to provide a list of - * sockets since this is a user configuration option. - */ -BOOL smb_launchd_checkin(struct smb_launch_info *linfo); - -/* Retrieve launchd configuration. The variadic arguments are a list of - * constant null-terminated strings. The strings are the names of the socket - * dictionaries to retrieve sockets from. The list of names is terminated by a - * NULL. - */ -BOOL smb_launchd_checkin_names(struct smb_launch_info *linfo, ...); - -/* Free any data or state associated with a successful launchd checkin. */ -void smb_launchd_checkout(struct smb_launch_info *linfo); diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index d53d6c3418..aea429d2ea 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -158,10 +158,11 @@ #define SMB_LARGE_LKLEN_OFFSET_HIGH(indx) (12 + (20 * (indx))) #define SMB_LARGE_LKLEN_OFFSET_LOW(indx) (16 + (20 * (indx))) -#define ERROR_DOS(class,code) error_packet(inbuf,outbuf,class,code,NT_STATUS_OK,__LINE__,__FILE__) -#define ERROR_NT(status) error_packet(inbuf,outbuf,0,0,status,__LINE__,__FILE__) -#define ERROR_FORCE_NT(status) error_packet(inbuf,outbuf,-1,-1,status,__LINE__,__FILE__) -#define ERROR_BOTH(status,class,code) error_packet(inbuf,outbuf,class,code,status,__LINE__,__FILE__) +#define ERROR_DOS(class,code) error_packet(outbuf,class,code,NT_STATUS_OK,__LINE__,__FILE__) +#define ERROR_NT(status) error_packet(outbuf,0,0,status,__LINE__,__FILE__) +#define ERROR_OPEN(status) error_open(outbuf,status,__LINE__,__FILE__) +#define ERROR_FORCE_NT(status) error_packet(outbuf,-1,-1,status,__LINE__,__FILE__) +#define ERROR_BOTH(status,class,code) error_packet(outbuf,class,code,status,__LINE__,__FILE__) #define reply_nterror(req,status) reply_nt_error(req,status,__LINE__,__FILE__) #define reply_force_nterror(req,status) reply_force_nt_error(req,status,__LINE__,__FILE__) @@ -170,7 +171,7 @@ #define reply_unixerror(req,defclass,deferror) reply_unix_error(req,defclass,deferror,NT_STATUS_OK,__LINE__,__FILE__) /* this is how errors are generated */ -#define UNIXERROR(defclass,deferror) unix_error_packet(inbuf,outbuf,defclass,deferror,NT_STATUS_OK,__LINE__,__FILE__) +#define UNIXERROR(defclass,deferror) unix_error_packet(outbuf,defclass,deferror,NT_STATUS_OK,__LINE__,__FILE__) /* these are the datagram types */ #define DGRAM_DIRECT_UNIQUE 0x10 @@ -378,4 +379,12 @@ do { \ #define ADD_TO_LARGE_ARRAY(mem_ctx, type, elem, array, num, size) \ add_to_large_array((mem_ctx), sizeof(type), &(elem), (void *)(array), (num), (size)); +#ifndef ISDOT +#define ISDOT(p) (*(p) == '.' && *((p) + 1) == '\0') +#endif /* ISDOT */ + +#ifndef ISDOTDOT +#define ISDOTDOT(p) (*(p) == '.' && *((p) + 1) == '.' && *((p) + 2) == '\0') +#endif /* ISDOTDOT */ + #endif /* _SMB_MACROS_H */ diff --git a/source3/include/trans2.h b/source3/include/trans2.h index 5cc50b193c..f7f3ef2149 100644 --- a/source3/include/trans2.h +++ b/source3/include/trans2.h @@ -530,8 +530,7 @@ findfirst/findnext is SMB_FIND_FILE_UNIX_INFO2. #define CIFS_UNIX_POSIX_PATH_OPERATIONS_CAP 0x20 /* We can cope with POSIX open/mkdir/unlink etc. */ #define CIFS_UNIX_LARGE_READ_CAP 0x40 /* We can cope with 24 bit reads in readX. */ #define CIFS_UNIX_LARGE_WRITE_CAP 0x80 /* We can cope with 24 bit writes in writeX. */ -#define CIFS_UNIX_TRANSPORT_ENCRYPTION_CAP 0x100 /* We can do SPNEGO negotiations for encryption. */ -#define CIFS_UNIX_TRANSPORT_ENCRYPTION_MANDATORY_CAP 0x200 /* We *must* SPNEGO negotiations for encryption. */ + #define SMB_QUERY_POSIX_FS_INFO 0x201 @@ -654,27 +653,6 @@ enum smb_whoami_flags { DOM_SID[] - list of SIDs (may be empty) */ -/* - * The following trans2 is done between client and server - * as a FSINFO call to set up the encryption state for transport - * encryption. - * - * The request looks like : - * - * [data block] -> SPNEGO framed GSSAPI request. - * - * The reply looks like : - * - * [data block] -> SPNEGO framed GSSAPI reply - if error - * is NT_STATUS_OK then we're done, if it's - * NT_STATUS_MORE_PROCESSING_REQUIRED then the - * client needs to keep going. If it's an - * error it can be any NT_STATUS error. - * - */ - -#define SMB_REQUEST_TRANSPORT_ENCRYPTION 0x203 - /* The query/set info levels for POSIX ACLs. */ #define SMB_QUERY_POSIX_ACL 0x204 #define SMB_SET_POSIX_ACL 0x204 -- cgit