summaryrefslogtreecommitdiff
path: root/source3/smbd/pipes.c
Commit message (Collapse)AuthorAgeFilesLines
* Revert "smbd: add an effective {smb,smbd_smb2}_request->ev_ctx that holds ↵Ralph Boehme2019-01-111-4/+4
| | | | | | | | | | | | | | | | the event context used for the request processing" This reverts commit 894e5001c747ce765dad5517778dda55d7d1f4d9. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: add an effective {smb,smbd_smb2}_request->ev_ctx that holds the event ↵Stefan Metzmacher2018-06-181-4/+4
| | | | | | | | | | context used for the request processing In future this will an impersonation wrapper tevent_context based on the user session. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* rpc_server: Re-order and rename remote and local address in np_open()Gary Lockyer2017-03-291-1/+1
| | | | | | We use this order and name consistently eleswhere. Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* s3: smbd: In reply_read_and_X() SMB1 server is overwriting part of the ↵Jeremy Allison2016-06-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'reserved' zero fields with reply data length. This occurred due to old code that used to do: SSVAL(smb_buf(req->outbuf),-2,nread); to set the reply length. This code was not needed, as srv_set_message() was already correctly setting the bcc length and was probably left from much earlier legacy code. However, in commit ddaa65ef6e049a185281c4d5deca4045e3b085e2 this was converted to do: SSVAL(req->outbuf,smb_vwv11,smb_maxcnt); This code actually overwrites the last 'reserved' field in the SMB_COM_READ_ANDX packet reply, but we never noticed as no client (or server code) looks at or checks vwv11 in a SMB_COM_READ_ANDX reply. [MS-SMB] shows for SMB_COM_READ_ANDX reply: SMB_Parameters { UCHAR WordCount; Words { UCHAR AndXCommand; UCHAR AndXReserved; USHORT AndXOffset; USHORT Available; USHORT DataCompactionMode; USHORT Reserved1; USHORT DataLength; USHORT DataOffset; USHORT DataLengthHigh; USHORT Reserved2[4]; } } SMB_Data { USHORT ByteCount; Bytes { UCHAR Pad[] (optional); UCHAR Data[variable]; } and indeed checking wireshark from Win2012R2 we find that smbd is writing the returned read length into smb_vwv11 and Windows leaves it as zeros (reserved). Also fix the same problem in the named pipes code. Torture test to ensure Reserved2[4] replies are zero to follow. https://bugzilla.samba.org/show_bug.cgi?id=11845 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* s3: Filenames: Add uint32_t flags parameter to synthetic_smb_fname().Jeremy Allison2016-03-241-1/+1
| | | | | | | | | Get it from parent/deriving smb_filename if present. Use 0 (as usually this a Windows-style lookup) if not. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
* Convert all uses of uint8/16/32 to _t in source3/smbd.Richard Sharpe2015-05-061-1/+1
| | | | | Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: pass smbXsrv_connection to srv_send_smb()Stefan Metzmacher2014-09-191-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* smbd: Add padding byte to readx responseChristof Schmitt2014-08-301-4/+7
| | | | | | | | | | | | | | MS-CIFS 2.2.4.42.2 states: "Pad (1 byte): This field is optional. When using the NT LAN Manager dialect, this field can be used to align the Data field to a 16-bit boundary relative to the start of the SMB Header. If Unicode strings are being used, this field MUST be present. When used, this field MUST be one padding byte long." Always add the padding byte to all readx responses to avoid additional complexity. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-rpc_server: Pass the server event context to np_open().Andreas Schneider2013-10-291-0/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Convert open_np_file to synthetic_smb_fnameVolker Lendecke2013-04-171-4/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: change pipes.c to use fsp_fnum_dbg() for fsp->fnum logging.Michael Adam2012-06-151-3/+3
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3:smbd: fix reply_open_pipe_and_X() to behave like windows (2008 R2)Stefan Metzmacher2012-05-281-11/+15
| | | | | | See rpc.samba3.smb1-pipe-name. metze
* s3:smbd: use nt_status_np_pipe for smb1Stefan Metzmacher2012-05-231-0/+2
| | | | metze
* s3: Add smb_request_doneVolker Lendecke2012-03-101-2/+2
| | | | | | | | | | | This is used to enable async chained command sequences. A synchronous reply_xxx command does not need to take are anymore about and_x chaining. The async commands (pipe r/w at this moment) must do so however. When finished, they must inform the main chain engine that they are finished with a smb_request_done call. Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Sat Mar 10 17:14:05 CET 2012 on sn-devel-104
* s3: Remove "req_wct_ofs()"Volker Lendecke2012-03-101-1/+1
| | | | This is fixed up in construct_reply_chain
* s3: Remove chain_replyVolker Lendecke2012-03-101-5/+0
| | | | <insert your favourite tombstone ascii art here>
* s3: Make sure the andX chains are ended correctlyVolker Lendecke2012-03-101-0/+9
| | | | Normally chain_reply took care of this. This will go away soon.
* s3: Fix some blank line endingsVolker Lendecke2012-03-031-5/+5
| | | | | Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Sat Mar 3 03:41:03 CET 2012 on sn-devel-104
* s3:smbd/pipes: avoid passing server_event_context() as event context to ↵Stefan Metzmacher2011-12-121-3/+3
| | | | | | np_{read,write}_send metze
* s3-rpc_server: Migrate rpc function to tsocket_address.Andreas Schneider2011-07-041-1/+0
| | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* s3-globals Remove smbd_event_context() (use server_event_context())Andrew Bartlett2011-05-311-3/+3
| | | | | | | | This has been a wrapper around server_event_context() for some time now, and removing this from dummmysmbd.c assists with library dependencies. Andrew Bartlett
* Fix many const compiler warnings.Jeremy Allison2011-05-051-2/+2
|
* s3-proto: move more rpc_server prototypes out of proto.hGünther Deschner2011-05-021-0/+1
| | | | Guenther
* s3: include smbd/smbd.h where needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3-auth Rename auth_serversupplied_info varaiables: server_info -> session_infoAndrew Bartlett2011-02-221-1/+1
| | | | | | | | | | | | | | | | | | | | | These variables, of type struct auth_serversupplied_info were poorly named when added into 2001, and in good consistant practice, this has extended all over the codebase in the years since. The structure is also not ideal for it's current purpose. Originally intended to convey the results of the authentication modules, it really describes all the essential attributes of a session. This rename will reduce the volume of a future patch to replaced these with a struct auth_session_info, with auth_serversupplied_info confined to the lower levels of the auth subsystem, and then eliminated. (The new structure will be the output of create_local_token(), and the change in struct definition will ensure that this is always run, populating local groups and privileges). Andrew Bartlett Signed-off-by: Stefan Metzmacher <metze@samba.org>
* libcli/security Provide a common, top level libcli/security/security.hAndrew Bartlett2010-10-121-0/+1
| | | | | | | | | | | | | | This will reduce the noise from merges of the rest of the libcli/security code, without this commit changing what code is actually used. This includes (along with other security headers) dom_sid.h and security_token.h Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Tue Oct 12 05:54:10 UTC 2010 on sn-devel-104
* s3: Make srv_send_smb take an sconn instead of a sock fdVolker Lendecke2010-08-241-1/+1
|
* s3: Add "client_id" to pipes_structVolker Lendecke2010-08-181-0/+1
|
* s3: Remove smbd_server_fd from pipe_write_doneVolker Lendecke2010-08-161-1/+1
|
* s3: Lift the smbd_messaging_context from np_openVolker Lendecke2010-08-081-1/+3
|
* s3:rpc_server: pass down local and remote tsocket_address to np_open()Stefan Metzmacher2010-05-271-1/+4
| | | | metze
* s3:smbd: make fsp->fake_file_handle a talloc child of fspStefan Metzmacher2010-04-281-1/+1
| | | | metze
* s3:smbd: add comment about returning STATUS_BUFFER_OVERFLOW in ↵Stefan Metzmacher2010-04-281-1/+15
| | | | | | pipe_read_andx_done() metze
* Fix bug #7020 - smbd using 2G memory.Jeremy Allison2010-01-051-0/+10
| | | | | | | | When deferring an async pipe writeX and readX transfer the outstanding request struct onto the conn struct. This needs freeing after the packet is finally processed. Jeremy.
* Remove all calls to reply_doserror - turn them intoJeremy Allison2009-12-211-7/+7
| | | | | | | correct reply_nterror calls. Next rename reply_doserror -> reply_force_doserror and plumb in when NT_STATUS_DOS is used. Jeremy.
* s3: Change fsp->fsp_name to be an smb_filename struct!Tim Prouty2009-07-201-3/+16
|
* Remove reply_unixerror() - no longer needed. Should make Metze's refactoring ↵Jeremy Allison2009-07-101-5/+18
| | | | | | a lot easier. Jeremy.
* s3:smbd: use new simplified snb_signing code in the serverStefan Metzmacher2009-03-231-0/+1
| | | | | | | | | We keep the seqnum/mid mapping in the smb_request structure. This also moves one global variable into the smbd_server_connection struct. metze
* Convert np_read to tevent_reqVolker Lendecke2009-03-171-7/+7
|
* Convert np_write to tevent_reqVolker Lendecke2009-03-171-14/+14
|
* S3: New module interface for SMB message statistics gatheringtodd stecher2009-02-091-1/+2
| | | | | | | This changelist allows for the addition of custom performance monitoring modules through smb.conf. Entrypoints in the main message processing code have been added to capture the command, subop, ioctl, identity and message size statistics.
* Make reply_pipe_read_andx asyncVolker Lendecke2009-01-311-13/+57
|
* Make reply_pipe_write asyncVolker Lendecke2009-01-311-13/+48
|
* Make reply_pipe_write_and_X asyncVolker Lendecke2009-01-311-20/+52
|
* Make-np_write-handle-0-byte-writes-as-NT_STATUS_OKVolker Lendecke2009-01-311-43/+27
|
* Remove some smb fsp knowledge from rpc_server/Volker Lendecke2009-01-201-4/+50
| | | | np_open/read/write don't have to know about files_struct
* Correctly calculate the offset for read&xVolker Lendecke2009-01-161-2/+6
|
* Replace some pointless variables in reply_open_pipe_and_X by commentsVolker Lendecke2008-12-071-12/+6
|
* Remove "conn" parameter from np_open, smb_request contains itVolker Lendecke2008-11-281-1/+1
|
* Remove a bunch of direct inbuf references by adding "vwv" to smb_requestVolker Lendecke2008-11-021-11/+10
|