diff options
author | Jeremy Allison <jra@samba.org> | 2004-11-10 23:43:52 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:53:13 -0500 |
commit | 4a69011a632fc6c0d2c1a428b5f812dd4e5084a0 (patch) | |
tree | 87a44b1e4391e3b70ea718f5228c49a36d854e74 /source3/smbd/nttrans.c | |
parent | c0cad75f09ad393fc12a5e49abfac17d678c8ff2 (diff) | |
download | samba-4a69011a632fc6c0d2c1a428b5f812dd4e5084a0.tar.gz samba-4a69011a632fc6c0d2c1a428b5f812dd4e5084a0.tar.bz2 samba-4a69011a632fc6c0d2c1a428b5f812dd4e5084a0.zip |
r3674: Stefan Esser <s.esser@e-matters.de> pointed out that the max data
value is only valid on the initial trans/trans2/nttrans request,
so if there are secondary requests we can't read it from them. Read
it from the initial request and pass as a parameter for those functions
that need it.
Jeremy.
(This used to be commit e007845e67e0604321fb36b216a98e4fca1c98e1)
Diffstat (limited to 'source3/smbd/nttrans.c')
-rw-r--r-- | source3/smbd/nttrans.c | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index e20e433abc..4c17396eb4 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -1143,7 +1143,7 @@ static NTSTATUS set_sd(files_struct *fsp, char *data, uint32 sd_len, uint32 secu static int call_nt_transact_create(connection_struct *conn, char *inbuf, char *outbuf, int length, int bufsize, char **ppsetup, uint32 setup_count, char **ppparams, uint32 parameter_count, - char **ppdata, uint32 data_count) + char **ppdata, uint32 data_count, uint32 max_data_count) { pstring fname; char *params = *ppparams; @@ -1782,7 +1782,7 @@ int reply_nttranss(connection_struct *conn, static int call_nt_transact_notify_change(connection_struct *conn, char *inbuf, char *outbuf, int length, int bufsize, char **ppsetup, uint32 setup_count, char **ppparams, uint32 parameter_count, - char **ppdata, uint32 data_count) + char **ppdata, uint32 data_count, uint32 max_data_count) { char *setup = *ppsetup; files_struct *fsp; @@ -1818,7 +1818,7 @@ name = %s\n", fsp->fsp_name )); static int call_nt_transact_rename(connection_struct *conn, char *inbuf, char *outbuf, int length, int bufsize, char **ppsetup, uint32 setup_count, char **ppparams, uint32 parameter_count, - char **ppdata, uint32 data_count) + char **ppdata, uint32 data_count, uint32 max_data_count) { char *params = *ppparams; pstring new_name; @@ -1885,9 +1885,8 @@ static size_t get_null_nt_acl(TALLOC_CTX *mem_ctx, SEC_DESC **ppsd) static int call_nt_transact_query_security_desc(connection_struct *conn, char *inbuf, char *outbuf, int length, int bufsize, char **ppsetup, uint32 setup_count, char **ppparams, uint32 parameter_count, - char **ppdata, uint32 data_count) + char **ppdata, uint32 data_count, uint32 max_data_count) { - uint32 max_data_count = IVAL(inbuf,smb_nt_MaxDataCount); char *params = *ppparams; char *data = *ppdata; prs_struct pd; @@ -1997,7 +1996,7 @@ security descriptor.\n")); static int call_nt_transact_set_security_desc(connection_struct *conn, char *inbuf, char *outbuf, int length, int bufsize, char **ppsetup, uint32 setup_count, char **ppparams, uint32 parameter_count, - char **ppdata, uint32 data_count) + char **ppdata, uint32 data_count, uint32 max_data_count) { char *params= *ppparams; char *data = *ppdata; @@ -2038,7 +2037,7 @@ static int call_nt_transact_set_security_desc(connection_struct *conn, char *inb static int call_nt_transact_ioctl(connection_struct *conn, char *inbuf, char *outbuf, int length, int bufsize, char **ppsetup, uint32 setup_count, char **ppparams, uint32 parameter_count, - char **ppdata, uint32 data_count) + char **ppdata, uint32 data_count, uint32 max_data_count) { uint32 function; uint16 fidnum; @@ -2115,7 +2114,6 @@ static int call_nt_transact_ioctl(connection_struct *conn, char *inbuf, char *ou * Allocate the correct amount and return the pointer to let * it be deallocated when we return. */ - uint32 max_data_count = IVAL(inbuf,smb_nt_MaxDataCount); SHADOW_COPY_DATA *shadow_data = NULL; TALLOC_CTX *shadow_mem_ctx = NULL; BOOL labels = False; @@ -2288,10 +2286,9 @@ static int call_nt_transact_ioctl(connection_struct *conn, char *inbuf, char *ou static int call_nt_transact_get_user_quota(connection_struct *conn, char *inbuf, char *outbuf, int length, int bufsize, char **ppsetup, uint32 setup_count, char **ppparams, uint32 parameter_count, - char **ppdata, uint32 data_count) + char **ppdata, uint32 data_count, uint32 max_data_count) { NTSTATUS nt_status = NT_STATUS_OK; - uint32 max_data_count = IVAL(inbuf,smb_nt_MaxDataCount); char *params = *ppparams; char *pdata = *ppdata; char *entry; @@ -2538,7 +2535,7 @@ static int call_nt_transact_get_user_quota(connection_struct *conn, char *inbuf, static int call_nt_transact_set_user_quota(connection_struct *conn, char *inbuf, char *outbuf, int length, int bufsize, char **ppsetup, uint32 setup_count, char **ppparams, uint32 parameter_count, - char **ppdata, uint32 data_count) + char **ppdata, uint32 data_count, uint32 max_data_count) { char *params = *ppparams; char *pdata = *ppdata; @@ -2657,10 +2654,10 @@ int reply_nttrans(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize) { int outsize = 0; + uint32 max_data_count = IVAL(inbuf,smb_nt_MaxDataCount); #if 0 /* Not used. */ uint16 max_setup_count = CVAL(inbuf, smb_nt_MaxSetupCount); uint32 max_parameter_count = IVAL(inbuf, smb_nt_MaxParameterCount); - uint32 max_data_count = IVAL(inbuf,smb_nt_MaxDataCount); #endif /* Not used. */ uint32 total_parameter_count = IVAL(inbuf, smb_nt_TotalParameterCount); uint32 total_data_count = IVAL(inbuf, smb_nt_TotalDataCount); @@ -2871,7 +2868,7 @@ due to being in oplock break state.\n", (unsigned int)function_code )); length, bufsize, &setup, setup_count, ¶ms, total_parameter_count, - &data, total_data_count); + &data, total_data_count, max_data_count); END_PROFILE_NESTED(NT_transact_create); break; case NT_TRANSACT_IOCTL: @@ -2880,7 +2877,7 @@ due to being in oplock break state.\n", (unsigned int)function_code )); length, bufsize, &setup, setup_count, ¶ms, total_parameter_count, - &data, total_data_count); + &data, total_data_count, max_data_count); END_PROFILE_NESTED(NT_transact_ioctl); break; case NT_TRANSACT_SET_SECURITY_DESC: @@ -2889,7 +2886,7 @@ due to being in oplock break state.\n", (unsigned int)function_code )); length, bufsize, &setup, setup_count, ¶ms, total_parameter_count, - &data, total_data_count); + &data, total_data_count, max_data_count); END_PROFILE_NESTED(NT_transact_set_security_desc); break; case NT_TRANSACT_NOTIFY_CHANGE: @@ -2898,7 +2895,7 @@ due to being in oplock break state.\n", (unsigned int)function_code )); length, bufsize, &setup, setup_count, ¶ms, total_parameter_count, - &data, total_data_count); + &data, total_data_count, max_data_count); END_PROFILE_NESTED(NT_transact_notify_change); break; case NT_TRANSACT_RENAME: @@ -2907,7 +2904,7 @@ due to being in oplock break state.\n", (unsigned int)function_code )); length, bufsize, &setup, setup_count, ¶ms, total_parameter_count, - &data, total_data_count); + &data, total_data_count, max_data_count); END_PROFILE_NESTED(NT_transact_rename); break; @@ -2917,7 +2914,7 @@ due to being in oplock break state.\n", (unsigned int)function_code )); length, bufsize, &setup, setup_count, ¶ms, total_parameter_count, - &data, total_data_count); + &data, total_data_count, max_data_count); END_PROFILE_NESTED(NT_transact_query_security_desc); break; #ifdef HAVE_SYS_QUOTAS @@ -2927,7 +2924,7 @@ due to being in oplock break state.\n", (unsigned int)function_code )); length, bufsize, &setup, setup_count, ¶ms, total_parameter_count, - &data, total_data_count); + &data, total_data_count, max_data_count); END_PROFILE_NESTED(NT_transact_get_user_quota); break; case NT_TRANSACT_SET_USER_QUOTA: @@ -2936,7 +2933,7 @@ due to being in oplock break state.\n", (unsigned int)function_code )); length, bufsize, &setup, setup_count, ¶ms, total_parameter_count, - &data, total_data_count); + &data, total_data_count, max_data_count); END_PROFILE_NESTED(NT_transact_set_user_quota); break; #endif /* HAVE_SYS_QUOTAS */ |