From 4338ee78c3d7bcf4b9fac383ff2f572d882ab97c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 8 Jun 2001 03:02:34 +0000 Subject: [PATCH] Extra stuff for large readwrite support. Jeremy. --- source/include/proto.h | 6 ++---- source/include/smb.h | 3 ++- source/param/loadparm.c | 4 ++++ source/smbd/negprot.c | 3 ++- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/source/include/proto.h b/source/include/proto.h index f654f2bec88..830cc1927da 100644 --- a/source/include/proto.h +++ b/source/include/proto.h @@ -509,7 +509,6 @@ void out_ascii(FILE *f, unsigned char *buf,int len); void out_data(FILE *f,char *buf1,int len, int per_line); void print_asc(int level, unsigned char *buf,int len); void dump_data(int level,char *buf1,int len); -void dump_datac(int class, int level, char *buf1, int len); char *tab_depth(int depth); int str_checksum(const char *s); void zero_free(void *p, size_t size); @@ -636,7 +635,6 @@ BOOL send_smb(int fd,char *buffer); BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type); int open_socket_in(int type, int port, int dlevel,uint32 socket_addr, BOOL rebind); int open_socket_out(int type, struct in_addr *addr, int port ,int timeout); -void reset_globals_after_fork(void); void client_setfd(int fd); char *client_name(void); char *client_addr(void); @@ -1272,8 +1270,6 @@ void SMBOWFencrypt(uchar passwd[16], uchar *c8, uchar p24[24]); void NTLMSSPOWFencrypt(uchar passwd[8], uchar *ntlmchalresp, uchar p24[24]); void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); BOOL make_oem_passwd_hash(char data[516], const char *passwd, uchar old_pw_hash[16], BOOL unicode); -BOOL encode_pw_buffer(char buffer[516], const char *new_pass, - int new_pw_len, BOOL nt_pass_set); BOOL decode_pw_buffer(char in_buffer[516], char *new_pwrd, int new_pwrd_size, uint32 *new_pw_len, uchar nt_p16[16], uchar p16[16]); @@ -1863,6 +1859,7 @@ BOOL lp_use_rhosts(void); BOOL lp_readprediction(void); BOOL lp_readbmpx(void); BOOL lp_readraw(void); +BOOL lp_large_readwrite(void); BOOL lp_writeraw(void); BOOL lp_null_passwords(void); BOOL lp_obey_pam_restrictions(void); @@ -2204,6 +2201,7 @@ BOOL secrets_fetch_trust_account_password(char *domain, uint8 ret_pwd[16], time_t *pass_last_set_time); BOOL secrets_store_trust_account_password(char *domain, uint8 new_pwd[16]); BOOL trust_password_delete(char *domain); +void reset_globals_after_fork(void); /* The following definitions come from passdb/smbpassfile.c */ diff --git a/source/include/smb.h b/source/include/smb.h index d810e11340f..12b6bfd4a0e 100644 --- a/source/include/smb.h +++ b/source/include/smb.h @@ -1323,8 +1323,9 @@ char *strdup(char *s); #define CAP_LOCK_AND_READ 0x0100 #define CAP_NT_FIND 0x0200 #define CAP_DFS 0x1000 +#define CAP_W2K_SMBS 0x2000 #define CAP_LARGE_READX 0x4000 -#define CAP_LARGE_WRITEX 0x8000 +#define CAP_LARGE_WRITEX 0x8000 #define CAP_EXTENDED_SECURITY 0x80000000 /* protocol types. It assumes that higher protocols include lower protocols diff --git a/source/param/loadparm.c b/source/param/loadparm.c index 476a10f881a..98dddda02f4 100644 --- a/source/param/loadparm.c +++ b/source/param/loadparm.c @@ -250,6 +250,7 @@ typedef struct BOOL bObeyPamRestrictions; BOOL bLoadPrinters; BOOL bUseRhosts; + BOOL bLargeReadwrite; BOOL bReadRaw; BOOL bWriteRaw; BOOL bReadPrediction; @@ -780,6 +781,7 @@ static struct parm_struct parm_table[] = { {"Protocol Options", P_SEP, P_SEPARATOR}, {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, + {"large readwrite", P_BOOL, P_GLOBAL, &Globals.bLargeReadwrite, NULL, NULL, 0}, {"max protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, {"min protocol", P_ENUM, P_GLOBAL, &Globals.minprotocol, NULL, enum_protocol, 0}, {"unicode", P_BOOL, P_GLOBAL, &Globals.bUnicode, NULL, NULL, 0}, @@ -1234,6 +1236,7 @@ static void init_globals(void) Globals.pwordlevel = 0; Globals.unamelevel = 0; Globals.deadtime = 0; + Globals.bLargeReadwrite = False; Globals.max_log_size = 5000; Globals.max_open_files = MAX_OPEN_FILES; Globals.maxprotocol = PROTOCOL_NT1; @@ -1530,6 +1533,7 @@ FN_GLOBAL_BOOL(lp_use_rhosts, &Globals.bUseRhosts) FN_GLOBAL_BOOL(lp_readprediction, &Globals.bReadPrediction) FN_GLOBAL_BOOL(lp_readbmpx, &Globals.bReadbmpx) FN_GLOBAL_BOOL(lp_readraw, &Globals.bReadRaw) +FN_GLOBAL_BOOL(lp_large_readwrite, &Globals.bLargeReadwrite) FN_GLOBAL_BOOL(lp_writeraw, &Globals.bWriteRaw) FN_GLOBAL_BOOL(lp_null_passwords, &Globals.bNullPasswords) FN_GLOBAL_BOOL(lp_obey_pam_restrictions, &Globals.bObeyPamRestrictions) diff --git a/source/smbd/negprot.c b/source/smbd/negprot.c index 6c45e376540..83c809de1cb 100644 --- a/source/smbd/negprot.c +++ b/source/smbd/negprot.c @@ -160,7 +160,8 @@ static int reply_nt1(char *outbuf) /* dual names + lock_and_read + nt SMBs + remote API calls */ int capabilities = CAP_NT_FIND|CAP_LOCK_AND_READ|CAP_LEVEL_II_OPLOCKS| (lp_nt_smb_support() ? CAP_NT_SMBS | CAP_RPC_REMOTE_APIS : 0) | - CAP_LARGE_READX | CAP_LARGE_WRITEX | + ((lp_large_readwrite() && (SMB_OFF_T_BITS == 64)) ? + CAP_LARGE_READX | CAP_LARGE_WRITEX | CAP_W2K_SMBS : 0) | (SMB_OFF_T_BITS == 64 ? CAP_LARGE_FILES : 0); -- 2.11.4.GIT