summaryrefslogtreecommitdiffstats
path: root/source3/smbd/reply.c
Commit message (Collapse)AuthorAgeFilesLines
* s3/vfs: remove unused SMB_VFS_DISK_FREE() small_query parameterDavid Disseldorp2015-02-171-1/+1
| | | | | | | | | | | | | | | The small_query parameter for SMB_VFS_DISK_FREE() was, prior to the previous commit, used to obtain 16-bit wide free-space information for the deprecated dskattr SMB_COM_QUERY_INFORMATION_DISK command. With the dskattr handler now performing the 16-bit collapse directly, the small_query parameter can be removed from the entire code path. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Feb 17 05:37:20 CET 2015 on sn-devel-104
* smbd/reply: convert free space to 16bit in dskattr handlerDavid Disseldorp2015-02-171-1/+20
| | | | | | | | | | | | | | | | | | The deprecated Core Protocol dskattr SMB_COM_QUERY_INFORMATION_DISK command provides free space information in the form of 16-bit words. Until now, this has been handled by passing the dskattr specific small_query boolean through to disk_norm() via the SMB_VFS_DISK_FREE VFS hook. disk_norm(small_query=true) then modifies the block size and free space values such that they fit in the 16-bit field. This change adds the command specific logic to the dskattr handler, so that it can be removed from the SMB_VFS_DISK_FREE()->disk_norm() code path. In doing so, it fixes dskattr request handling against opaque VFS backends that don't call disk_norm(), such as vfs_glusterfs. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Split out write_data[_iov]Volker Lendecke2014-12-071-0/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: read_data->read_data_ntstatusVolker Lendecke2014-12-071-1/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:vfs: add create tags to SMB_VFS_CREATEFILERalph Boehme2014-12-041-10/+20
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use MIN macro in fake_sendfileChristof Schmitt2014-10-041-5/+1
| | | | | Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: pass smbXsrv_connection to open_was_deferred()Stefan Metzmacher2014-09-191-7/+7
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: use xconn->client->sconn in reply_special()Stefan Metzmacher2014-09-191-1/+1
| | | | | | | xconn->sconn will go away soon. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: pass smb_request to make_connection()Stefan Metzmacher2014-09-191-4/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: use req->sconn in reply.c where possibleStefan Metzmacher2014-09-191-3/+3
| | | | | | | xconn->sconn will go away soon. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: pass smbXsrv_connection to srv_send_smb()Stefan Metzmacher2014-09-191-6/+5
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3: smbd: Change the function signature of srvstr_push() from returning a ↵Jeremy Allison2014-09-161-7/+23
| | | | | | | | | | | | | | | | | length to returning an NTSTATUS with a length param. srvstr_push_fn() now returns an NTSTATUS reporting any string conversion failure. We need to get serious about returning character set conversion errors inside smbd. Bug 10775 - smbd crashes when accessing garbage filenames https://bugzilla.samba.org/show_bug.cgi?id=10775 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* smbd: Move make_dir_struct() to reply.cVolker Lendecke2014-09-091-0/+46
| | | | | | | | This routine has nothing to do with dptr handling, it is SMB1 marshalling called only from reply_search(). Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* smbd: Add padding byte to readx responseChristof Schmitt2014-08-301-8/+13
| | | | | | | | | | | | | | 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>
* vfs3: Pass "lease" through SMB_VFS_CREATE_FILEVolker Lendecke2014-08-111-0/+10
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: pass smbXsrv_connection to smbd_[un]lock_socket()Stefan Metzmacher2014-08-061-5/+4
| | | | | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Wed Aug 6 12:15:57 CEST 2014 on sn-devel-104
* s3:smbd: pass smbXsrv_connection explicitly to sendfile_short_send()Stefan Metzmacher2014-08-061-14/+30
| | | | | | | | We now let the caller terminate the connection. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: pass smbXsrv_connection explicitly to fake_sendfile()Stefan Metzmacher2014-08-061-5/+5
| | | | | | | | | In future (with multi-channel) a fsp can be used from multiple connections, we need to make it explicit on which we want to reply. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: use req->xconn in reply.cStefan Metzmacher2014-08-061-17/+16
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: pass smbXsrv_connection to reply_readbraw_error()Stefan Metzmacher2014-08-061-13/+11
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: pass smbXsrv_connection to is_valid_writeX_buffer()Stefan Metzmacher2014-08-061-2/+2
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: remove unused 'sconn' from is_encrypted_packet()Stefan Metzmacher2014-08-061-1/+1
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: pass smbXsrv_connection to netbios_session_retarget()Stefan Metzmacher2014-08-061-3/+3
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: pass smbXsrv_connection to reply_special()Stefan Metzmacher2014-08-061-3/+3
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: move sconn->smb1.echo_handler.* to xconn->smb1.echo_handler.*Stefan Metzmacher2014-08-061-2/+2
| | | | | | | | This prepares the structures for multi-channel support. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: move sconn->smb1.signing_state to xconn->smb1.signing_stateStefan Metzmacher2014-08-061-5/+6
| | | | | | | | This prepares the structures for multi-channel support. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: move sconn->smb1.sessions.* to xconn->smb1.sessions.*Stefan Metzmacher2014-08-061-9/+14
| | | | | | | | This prepares the structures for multi-channel support. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: move sconn->smb1.negprot.* to xconn->smb1.negprot.*Stefan Metzmacher2014-08-061-2/+4
| | | | | | | | This prepares the structures for multi-channel support. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: move sconn->sock to xconn->transport.sockStefan Metzmacher2014-08-061-12/+14
| | | | | | | | This prepares the structures for multi-channel support. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: move sconn->nbt.* to xconn->transport.nbt.*Stefan Metzmacher2014-08-061-2/+3
| | | | | | | | This prepares the structures for multi-channel support. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: avoid get_peer_addr() and use smbXsrv_connection_dbg()Stefan Metzmacher2014-08-061-42/+55
| | | | | | | | | There's no need to do syscalls, if we already have the information in userspace. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* smbd: ?True:False is pretty pointless :-)Volker Lendecke2014-07-221-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Add missing {}Volker Lendecke2014-07-221-1/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Remove superfluous ()Volker Lendecke2014-07-221-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Fix a typoVolker Lendecke2014-07-221-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: "err" is no longer set in get_lock_offsetVolker Lendecke2014-07-221-24/+3
| | | | | | | This was only referenced in the !HAVE_LONGLONG section Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Add commentsVolker Lendecke2014-07-221-0/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd/nmbd: Remove HAVE_LONGLONGVolker Lendecke2014-07-221-83/+0
| | | | | | | We always have 64-bit variables available by now Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: do_lock_cancel does not need "blr" anymoreVolker Lendecke2014-07-041-2/+1
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Jul 4 08:52:31 CEST 2014 on sn-devel-104
* smbd: do_lock does not need "blr" anymoreVolker Lendecke2014-07-041-4/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Remove two outdated commentsVolker Lendecke2014-07-041-5/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Factor out unlocking from smbd_do_lockingVolker Lendecke2014-07-041-37/+55
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: smbd : Fix wildcard unlink to fail if we get an error rather than trying ↵Jeremy Allison2014-04-301-1/+2
| | | | | | | | | | to continue. This can break smbd if we end up leaving a SHARING_VIOLATION retry record on the queue. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3:smbd: use smb1srv_open_lookup() in is_valid_writeX_buffer()Stefan Metzmacher2014-04-111-9/+20
| | | | | | | | | It's more logical to check the fnum instead of tid here. This will make it easier to reuse the logic for SMB2 and allows per fsp recvfile detection. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: let srvstr_pull_req_talloc() take 'const uint8_t *src'Stefan Metzmacher2014-04-021-9/+11
| | | | | | | | | | This is the correct thing to do the smb request buffer contains just bytes (uint8_t). It also avoids strange casting in the callers. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* smbd: Explicitly pass "file_id" to rename_share_filenameVolker Lendecke2014-03-211-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Explicitly pass "file_id" to rename_open_filesVolker Lendecke2014-03-211-3/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: fix the maxentries calculation depending on the max_send.Stefan Metzmacher2014-03-051-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: simplify maxentries calculation in reply_search()Stefan Metzmacher2014-03-051-5/+4
| | | | | | | Using helper variables make it much easier to understand. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: fix the read numtoread calculation depending on the max_send.Stefan Metzmacher2014-03-051-9/+9
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>