From 6bb92a6d38db41a11e80c4369623d137763f0f52 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 9 Mar 2000 21:45:16 +0000 Subject: Big update moving the multi-pdu support from 2.0.x into HEAD for JF and the printer functions. Also tidied up some header includes and got the order right so you can now do a : make proto make clean make Jeremy. (This used to be commit 833cd9fba92e4ad5297b235d108dd2be8c17079b) --- source3/include/includes.h | 4 +-- source3/include/msdfs.h | 12 +++++-- source3/include/nt_printing.h | 4 +++ source3/include/ntdomain.h | 84 ++++++++++++++++++++++++++----------------- source3/include/proto.h | 56 ++++++++++++++++++++++------- source3/include/smb.h | 4 +++ 6 files changed, 115 insertions(+), 49 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index d040dada7a..f77e1323d7 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -665,6 +665,8 @@ extern int errno; #include "nterr.h" +#include "msdfs.h" + #ifdef WITH_PROFILE #include "profile.h" #endif @@ -914,6 +916,4 @@ int setresgid(gid_t rgid, gid_t egid, gid_t sgid); #include #endif -#include "msdfs.h" - #endif /* _INCLUDES_H */ diff --git a/source3/include/msdfs.h b/source3/include/msdfs.h index ea72c4c15f..0c2e3c14df 100644 --- a/source3/include/msdfs.h +++ b/source3/include/msdfs.h @@ -22,8 +22,6 @@ #ifndef _MSDFS_H #define _MSDFS_H -#ifdef MS_DFS - #define REFERRAL_TTL 600 /* Flags used in trans2 Get Referral reply */ @@ -46,6 +44,16 @@ struct junction_map struct referral* referral_list; }; +struct dfs_path +{ + pstring hostname; + pstring servicename; + pstring volumename; + pstring restofthepath; +}; + +#ifdef MS_DFS + #define RESOLVE_DFSPATH(name, conn, inbuf, outbuf) \ { if(((SVAL(inbuf,smb_flg2) & FLAGS2_DFS_PATHNAMES)) && \ dfs_redirect(name,conn)) \ diff --git a/source3/include/nt_printing.h b/source3/include/nt_printing.h index 22c837c748..99a427c32d 100644 --- a/source3/include/nt_printing.h +++ b/source3/include/nt_printing.h @@ -1,3 +1,6 @@ +#ifndef NT_PRINTING_H_ +#define NT_PRINTING_H_ + #define ORIENTATION 0x00000001L #define PAPERSIZE 0x00000002L #define PAPERLENGTH 0x00000004L @@ -235,3 +238,4 @@ typedef struct _form UNISTR2 name; } FORM; */ +#endif /* NT_PRINTING_H_ */ diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index 7f3d4b4950..46be965d70 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -24,10 +24,6 @@ #ifndef _NT_DOMAIN_H /* _NT_DOMAIN_H */ #define _NT_DOMAIN_H -/* - * A bunch of stuff that was put into smb.h - * in the NTDOM branch - it didn't belong there. - */ /* dce/rpc support */ #include "rpc_dce.h" @@ -35,8 +31,10 @@ /* miscellaneous structures / defines */ #include "rpc_misc.h" -/* security descriptor structures */ -#include "rpc_secdes.h" +/* + * A bunch of stuff that was put into smb.h + * in the NTDOM branch - it didn't belong there. + */ typedef struct _prs_struct { @@ -63,32 +61,8 @@ typedef struct _prs_struct #define MARSHALLING(ps) (!(ps)->io) #define UNMARSHALLING(ps) ((ps)->io) -typedef struct _input_data { - /* - * This is the current incoming pdu. The data here - * is collected via multiple writes until a complete - * pdu is seen, then the data is copied into the in_data - * structure. The maximum size of this is 64k (2 byte length). - */ - prs_struct in_pdu; - - /* - * The amount of data needed to complete the in_pdu. - * If this is zero, then we are at the start of a new - * pdu. - */ - uint32 in_pdu_needed_len; - - /* - * This is the collection of input data with all - * the rpc headers and auth footers removed. - * The maximum length of this is strictly enforced. - */ - prs_struct in_data; -} input_data; - typedef struct _output_data { - /* + /* * Raw RPC output data. This does not include RPC headers or footers. */ prs_struct rdata; @@ -96,7 +70,7 @@ typedef struct _output_data { /* The amount of data sent from the current rdata struct. */ uint32 data_sent_length; - /* + /* * The current PDU being returned. This inclues * headers, data and authentication footer. */ @@ -109,6 +83,37 @@ typedef struct _output_data { uint32 current_pdu_sent; } output_data; +typedef struct _input_data { + /* + * This is the current incoming pdu. The data here + * is collected via multiple writes until a complete + * pdu is seen, then the data is copied into the in_data + * structure. The maximum size of this is 0x1630 (MAX_PDU_FRAG_LEN). + */ + unsigned char current_in_pdu[MAX_PDU_FRAG_LEN]; + + /* + * The amount of data needed to complete the in_pdu. + * If this is zero, then we are at the start of a new + * pdu. + */ + uint32 pdu_needed_len; + + /* + * The amount of data received so far in the in_pdu. + * If this is zero, then we are at the start of a new + * pdu. + */ + uint32 pdu_received_len; + + /* + * This is the collection of input data with all + * the rpc headers and auth footers removed. + * The maximum length of this (1Mb) is strictly enforced. + */ + prs_struct data; +} input_data; + typedef struct pipes_struct { struct pipes_struct *next, *prev; @@ -145,6 +150,18 @@ typedef struct pipes_struct uid_t uid; gid_t gid; + /* + * Set to true when an RPC bind has been done on this pipe. + */ + + BOOL pipe_bound; + + /* + * Set to true when we should return fault PDU's for everything. + */ + + BOOL fault_state; + /* * Struct to deal with multiple pdu inputs. */ @@ -186,6 +203,9 @@ struct acct_info uint32 smb_userid; /* domain-relative RID */ }; +/* security descriptor structures */ +#include "rpc_secdes.h" + /* different dce/rpc pipes */ #include "rpc_lsa.h" #include "rpc_netlogon.h" diff --git a/source3/include/proto.h b/source3/include/proto.h index f10f006aeb..20a459120f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -24,6 +24,7 @@ BOOL allow_access(char *deny_list,char *allow_list, BOOL check_access(int sock, char *allow_list, char *deny_list); /*The following definitions come from lib/bitmap.c */ + struct bitmap *bitmap_allocate(int n); BOOL bitmap_set(struct bitmap *bm, unsigned i); BOOL bitmap_clear(struct bitmap *bm, unsigned i); @@ -800,6 +801,35 @@ BOOL downgrade_share_oplock(files_struct *fsp); BOOL modify_share_mode(files_struct *fsp, int new_mode, uint16 new_oplock); int share_mode_forall(SHAREMODE_FN(fn)); +/*The following definitions come from msdfs/msdfs.c */ + +void create_nondfs_path(char* pathname, struct dfs_path* pdp); +BOOL parse_dfs_path(char* pathname, struct dfs_path* pdp); +BOOL dfs_redirect(char* pathname, connection_struct* conn); +BOOL dfs_findfirst_redirect(char* pathname, connection_struct* conn); +int setup_dfs_referral(char* pathname, int max_referral_level, + char** ppdata); +int dfs_path_error(char* inbuf, char* outbuf); +int setup_dfs_referral(char* pathname, int max_referral_level, + char** ppdata); +int unistr_to_dos(char* dst,uint16* src) ; + +/*The following definitions come from msdfs/msdfs_tdb.c */ + +BOOL msdfs_open(BOOL update); +BOOL add_junction_entry(struct junction_map* junction); +BOOL get_junction_entry(struct junction_map* junction); +BOOL isDfsShare(char* svc,char* vol); +void msdfs_close(); +void msdfs_end(); + +/*The following definitions come from msdfs/parse_dfs_map.c */ + +BOOL parse_referral(char* s, struct referral* ref); +void load_dfsmaps(); +BOOL load_dfsmap(char* fname, int snum); +void load_dfsmaps(); + /*The following definitions come from nmbd/asyncdns.c */ int asyncdns_fd(void); @@ -1244,6 +1274,7 @@ BOOL lp_nt_acl_support(void); BOOL lp_stat_cache(void); BOOL lp_allow_trusted_domains(void); BOOL lp_restrict_anonymous(void); +BOOL lp_host_msdfs(void); int lp_os_level(void); int lp_max_ttl(void); int lp_max_wins_ttl(void); @@ -1304,12 +1335,13 @@ char *lp_readlist(int ); char *lp_writelist(int ); char *lp_fstype(int ); char *lp_vfsobj(int ); -char *lp_dfsmap(int ); char *lp_mangled_map(int ); char *lp_veto_files(int ); char *lp_hide_files(int ); char *lp_veto_oplocks(int ); char *lp_driverlocation(int ); +char *lp_dfsmap(int ); +BOOL lp_dfsmap_loaded(int ); BOOL lp_preexec_close(int ); BOOL lp_rootpreexec_close(int ); BOOL lp_revalidate(int ); @@ -1368,6 +1400,7 @@ BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir); int lp_add_service(char *pszService, int iDefaultService); BOOL lp_add_printer(char *pszPrintername, int iDefaultService); BOOL lp_file_list_changed(void); +void set_dfsmap_loaded(int i,BOOL b); void *lp_local_ptr(int snum, void *ptr); BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue); BOOL lp_is_default(int snum, struct parm_struct *parm); @@ -2562,17 +2595,21 @@ BOOL api_netlog_rpc(pipes_struct *p, prs_struct *data); /*The following definitions come from rpc_server/srv_pipe.c */ -BOOL readwrite_pipe(pipes_struct *p, char *data, int len, - char **rdata, int *rlen); -ssize_t write_pipe(pipes_struct *p, char *data, size_t n); -int read_pipe(pipes_struct *p, char *data, int n); +BOOL create_next_pdu(pipes_struct *p); +BOOL api_pipe_bind_auth_resp(pipes_struct *p, prs_struct *rpc_in_p); +BOOL setup_fault_pdu(pipes_struct *p); +BOOL api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p); +BOOL api_pipe_auth_process(pipes_struct *p, prs_struct *rpc_in); +BOOL api_pipe_request(pipes_struct *p); +BOOL api_rpcTNP(pipes_struct *p, char *rpc_name, struct api_struct *api_rpc_cmds, + prs_struct *rpc_in); /*The following definitions come from rpc_server/srv_pipe_hnd.c */ void set_pipe_handle_offset(int max_open_files); void reset_chain_p(void); void init_rpc_pipe_hnd(void); -BOOL pipe_init_outgoing_data(output_data *out_data); +BOOL pipe_init_outgoing_data(output_data *o_data); pipes_struct *open_rpc_pipe_p(char *pipe_name, connection_struct *conn, uint16 vuid); ssize_t write_to_pipe(pipes_struct *p, char *data, size_t n); @@ -2583,13 +2620,6 @@ BOOL close_rpc_pipe_hnd(pipes_struct *p, connection_struct *conn); pipes_struct *get_rpc_pipe_p(char *buf, int where); pipes_struct *get_rpc_pipe(int pnum); -/*The following definitions come from rpc_server/srv_pipe_srv.c */ - -BOOL create_next_pdu(pipes_struct *p); -BOOL rpc_command(pipes_struct *p, char *input_data, int data_len); -BOOL api_rpcTNP(pipes_struct *p, char *rpc_name, struct api_struct *api_rpc_cmds, - prs_struct *rpc_in); - /*The following definitions come from rpc_server/srv_reg.c */ BOOL api_reg_rpc(pipes_struct *p, prs_struct *data); diff --git a/source3/include/smb.h b/source3/include/smb.h index c330593b1a..447f2bd3a6 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1145,6 +1145,10 @@ struct bitmap { #define SMB_SUPPORT_SEARCH_BITS 0x0001 #define SMB_SHARE_IN_DFS 0x0002 +/* Named pipe write mode flags. Used in writeX calls. */ +#define PIPE_RAW_MODE 0x4 +#define PIPE_START_MESSAGE 0x8 + /* these are the constants used in the above call. */ /* DesiredAccess */ /* File Specific access rights. */ -- cgit