summaryrefslogtreecommitdiffstats
path: root/source3/smbd/reply.c
Commit message (Collapse)AuthorAgeFilesLines
...
* s3:smbd: fix the lockread 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>
* s3:smbd: pass the final numtoread reply_outbuf() for the lockread reply.Stefan Metzmacher2014-03-051-4/+5
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: fix lockread numtoread calculation to match reply_outbuf() arguments.Stefan Metzmacher2014-03-051-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: smbd - smb1 - fix read of deleted memory in reply_writeclose().Noel Power2014-03-031-11/+13
| | | | | | | | | | | | | While running smbtorture test raw.write under valgrind an "Invalid read" was reported in methid reply_writeclose, it seems after closing a file sometime later we try to access it again. Signed-off-by: Noel Power <noel.power@suse.com> Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Mar 3 20:42:40 CET 2014 on sn-devel-104
* param: change fstype to use a constant stringGarming Sam2014-02-121-1/+1
| | | | | | | | Substitution isn't really necessary for this parameter. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* param: rename lp function and variable from 'dontdescend' to 'dont_descend'Garming Sam2014-02-071-2/+2
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Always use UCF_PREP_CREATEFILE for filename_convert calls to resolve a ↵Jeremy Allison2013-12-091-4/+2
| | | | | | | | | | | | path for open. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10297 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Dec 9 21:02:21 CET 2013 on sn-devel-104
* smbd: change flag name from UCF_CREATING_FILE to UCF_PREP_CREATEFILEJeremy Allison2013-12-091-5/+5
| | | | | | | | | In preparation to using it for all open calls. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10297 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* smbd: Remove a "set but unused" variableVolker Lendecke2013-11-271-1/+0
| | | | | | | | | | This is should have been in a793ac0 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Nov 27 13:30:48 CET 2013 on sn-devel-104
* smbd: Pull mtime handling into open_file_ntcreateVolker Lendecke2013-11-231-12/+0
| | | | | | | | | | | | | | This is a performance improvement for heavily contended files, in particular in a cluster. The separate call to get_file_infos makes us pull the locking.tdb record twice per open. For a contended file this can be a performance penalty, this gets the # of record accesses for the open/close cycle down from 3 to 2. 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): Sat Nov 23 00:40:49 CET 2013 on sn-devel-104
* smbd: Point reply_open at the correct stat structVolker Lendecke2013-11-221-1/+4
| | | | | | | | Not sure if anybody will ever notice this these days, but the same is done in the createfile calls. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Rename the profile enums with a SAMBA_ prefix to avoid conflict with system ↵Jeremy Allison2013-11-221-2/+2
| | | | | | | | | files. WRITE_FLUSH is defined in fs.h in Linux. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* s3-smbd: smbclient shows no error if deleting a directory with del failedJeremy Allison2013-11-141-1/+1
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=10260 Remove unneeded conn argument to dir_check_ftype(). Move to correct uint32_t types. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3-rpc_cli: pass down ndr_interface_table to rpc_pipe_open_interface().Günther Deschner2013-08-051-1/+1
| | | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* smbd: Fix a profile problemVolker Lendecke2013-07-091-23/+25
| | | | | | | | | | | | | | | | | | | | | When trying to read a profile, under certain circumstances Windows tries to read with its machine account first. The profile previously written was stored with an ACL that only allows access for the user and not the machine. Windows should get an NT_STATUS_ACCESS_DENIED when using the machine account, making it retry with the user account (which would then succeed). Samba under these circumstances erroneously gives NT_STATUS_OBJECT_PATH_NOT_FOUND, which makes Windows give up and not retry. The reasons is the "dropbox" patch in unix_convert, turning EACCESS on the last path component to OBJECT_PATH_NOT_FOUND. This patch makes the dropbox behaviour only kick in when we are creating a file. I think this is an abstraction violation. unix_convert() should not have to know about the create_disposition, but given that we have pathname resolution separated from the core open code right now this is the best we can do. Signed-off-by: Volker Lendecke <Volker.Lendecke@SerNet.DE> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Remove unused reply_to_oplock_break_requestsVolker Lendecke2013-04-261-2/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Fix bug in old create temp SMB request. Only use VFS functions.Jeremy Allison2013-04-201-53/+64
| | | | | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Sat Apr 20 21:13:36 CEST 2013 on sn-devel-104
* smbd: Convert rename_internals_fsp to synthetic_smb_fnameVolker Lendecke2013-04-171-4/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Convert copy_file to cp_smb_filenameVolker Lendecke2013-04-171-3/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Convert rename_internals_fsp to cp_smb_filenameVolker Lendecke2013-04-171-2/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: do not access data behind req->buf+req->buflen in ↵Ralph Wuerthner2013-04-101-1/+7
| | | | | | | | | | srvstr_pull_req_talloc() 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 Apr 10 02:03:13 CEST 2013 on sn-devel-104
* s3:smbd: convert srvstr_pull_req_talloc() into a functionRalph Wuerthner2013-04-101-0/+12
| | | | | Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: do not access data behind req->buf+req->buflen in ↵Ralph Wuerthner2013-04-101-3/+10
| | | | | | | srvstr_get_path_req_wcard() Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* Optimization suggested by Volker. Don't do a stat system call on normal read ↵Jeremy Allison2013-03-281-15/+15
| | | | | | | | | | | | path. Only do it if we need it in the sendfile() path. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Thu Mar 28 17:51:22 CET 2013 on sn-devel-104
* s3:smbd: Add functions calc_max_read_pdu()/calc_read_size() to work out the ↵Jeremy Allison2013-03-201-25/+86
| | | | | | | | | | | | length we should return. LARGE_READX test shows it's always safe to return a short read. Windows does so. Do the calculations to return what will fit in a read depending on what the client negotiated. Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:smbd: Remove server_will_accept_large_read() and erroneous comment.Jeremy Allison2013-03-201-28/+1
| | | | | | | | We're going to replace this with a function that calculates the max PDU to return on a read and supports short reads. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Fix bug #9724 - is_encrypted_packet() function incorrectly used inside server.Jeremy Allison2013-03-161-3/+2
| | | | | | | | | | | | | | The is_encrypted_packet() function should only be used on the raw received data to determine if a packet came in encrypted. Once we're inside the SMB1 processing code in smbd/reply.c we should be looking at the smb1request->encrypted field to determine if a packet was really encrypted or not. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Sat Mar 16 12:44:44 CET 2013 on sn-devel-104
* Fix bug #9587 - archive flag is always set on directories.Jeremy Allison2013-01-251-1/+2
| | | | | | | | | | | | Creating a directory to a Samba share sets the attributes to 'D' only (correct) - only when creating a new file should the 'A' attribute be set. However, doing a rename of that directory sets the 'A' attribute in error. This should only be done on a file rename. smbclient regression test to follow. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* Fix bug #9572 - File corruption during SMB1 read by Mac OSX 10.8.2 clients.Jeremy Allison2013-01-241-2/+30
| | | | | | | | | | | | | | | | Accept a large read if we told the client we have UNIX extensions and the client sent a non-zero upper 16-bit size. Do the non-zero upper 16-bit size check first to save a function call in what is a hot path. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Jan 24 21:01:51 CET 2013 on sn-devel-104
* Revert "s3:smbd: SMB ReadX with size > 0xffff should only possible for samba ↵Jeremy Allison2013-01-241-10/+1
| | | | | | | | | | | | | clients." Part of fix for bug #9572 - File corruption during SMB1 read by Mac OSX 10.8.2 clients This reverts commit f8c26c16b82989e002b839fc9eba6386fc036f6a. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3-smbd: Check return code of SMB_VFS_{L}STAT.Andreas Schneider2012-12-211-2/+7
| | | | | | | Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s3:smbd: pass the current time to make_connection[_smb1]()Stefan Metzmacher2012-11-051-2/+3
| | | | | | | | | | Otherwise smbstatus reports the wrong time for tree connects. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org> Autobuild-User(master): Christian Ambach <ambi@samba.org> Autobuild-Date(master): Mon Nov 5 20:43:23 CET 2012 on sn-devel-104
* s3:smbd: update sconn->remote_hostname after the netbios session requestStefan Metzmacher2012-10-191-0/+13
| | | | | | | | | Also update the info in the new smbXsrv structure. This way we can log the remote name in status outputs. metze Signed-off-by: Michael Adam <obnox@samba.org>
* s3:smbd: add support for SMB_EXTENDED_SIGNATURES in SMBtconXStefan Metzmacher2012-08-041-1/+9
| | | | | | | metze Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Sat Aug 4 14:28:04 CEST 2012 on sn-devel-104
* s3:smbd: setup the application session key with the first tcon on a sessionStefan Metzmacher2012-08-041-1/+85
| | | | | | | | | Look for Server.Session.SessionKeyState in [MS-SMB]. The first SMBtconX sets the state to available, which makes it possible to protect the session key at that stage, if client and server support TREE_CONNECT_ANDX_EXTENDED_SIGNATURE. metze
* s3:smbd: add a optional_support helper variable to reply_tcon_and_X()Stefan Metzmacher2012-08-011-4/+7
| | | | | | | metze Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Aug 1 18:25:26 CEST 2012 on sn-devel-104
* s3:smbd: make use of TCONX_FLAG_DISCONNECT_TID defineStefan Metzmacher2012-08-011-1/+1
| | | | metze
* Fix compiler warning.Jeremy Allison2012-07-241-1/+1
|
* Fix problem found by Andrew Bartlett - correctly check encrypted flag.Jeremy Allison2012-07-231-2/+6
|
* s3-smb1: Postpone close_file until all aio is handledVolker Lendecke2012-07-181-1/+81
| | | | | | Thanks to Jeremy for this simple idea Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: Slightly simplify reply_close()Volker Lendecke2012-07-181-25/+13
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.Rusty Russell2012-07-181-7/+9
| | | | | | | | | | They use talloc_tos() internally: hoist that up to the callers, some of whom don't want to us talloc_tos(). A simple patch, but hits a lot of files. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* s3:smbd: make use of smbXsrv_session for smb1Stefan Metzmacher2012-06-251-5/+21
| | | | | | Pair-Programmed-With: Michael Adam <obnox@samba.org> metze
* s3:smbd: make use of smbXsrv_tcon for smb1Stefan Metzmacher2012-06-251-4/+54
| | | | | | Pair-Programmed-With: Michael Adam <obnox@samba.org> metze
* s3:smbd: change reply.c to use fsp_fnum_dbg() for fsp->fnum logging.Michael Adam2012-06-151-50/+50
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3:include: change smb_request->vuid to uint64_tStefan Metzmacher2012-06-061-3/+4
| | | | metze
* s3:smbd: use 'struct user_struct' instead of typedef'ed 'user_struct'Stefan Metzmacher2012-06-061-1/+1
| | | | metze
* s3:smbd: use print_spool_rap_jobid() in reply_ioctl()Stefan Metzmacher2012-06-061-5/+2
| | | | metze
* s3:smbd: use reply_force_doserror(req, ERRSRV, ERRbaduid) on SMBulogoffStefan Metzmacher2012-05-231-0/+5
| | | | | | | | | | | | We don't support security = share anymore, so we should always have a valid session. Found by the raw.context test. metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Wed May 23 12:47:37 CEST 2012 on sn-devel-104
* s3:smbd: remove unused 'connection_struct->used'Michael Adam2012-05-221-2/+0
| | | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Tue May 22 16:42:22 CEST 2012 on sn-devel-104