summaryrefslogtreecommitdiffstats
path: root/source3/smbd
Commit message (Collapse)AuthorAgeFilesLines
...
* dbwrap: add a dbwrap_flags argument to db_open_tdb()Michael Adam2014-02-071-1/+1
| | | | | | | | ...for consistency and in preparation of future flags that the tdb backend might be aware of. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dbwrap: add a dbwrap_flags argument to db_open()Michael Adam2014-02-075-5/+9
| | | | | | | | | | This is in preparation to support handing flags to backends, in particular activating read only record support for ctdb databases. For a start, this does nothing but adding the parameter, and all databases use DBWRAP_FLAG_NONE. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd/smb2_ioctl: fail zero length copy chunk requestsDavid Disseldorp2014-02-061-1/+16
| | | | | | | | | | | | | | | As documented in MS-SMB2 3.3.5.15.6 Handling a Server-Side Data Copy Request, an invalid parameter response should be sent when: The Length value in a single chunk is greater than ServerSideCopyMaxChunkSize or *equal to zero*. We do not currently abide by the latter part of this clause. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10424 Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* pysmbd: improve the return of error codes in the python smbd bindingsGarming Sam2014-02-051-31/+27
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
* loadparm: rename lp[cfg]_dir_mask to lp[cfg]_directory_mask for consistency ↵Michael Adam2014-02-032-2/+2
| | | | | | | | | with docs Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* loadparm: rename lp[cfg]_print_ok to lp[cfg]_printable for consistency with docsMichael Adam2014-02-033-5/+5
| | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* loadparm: rename lp[cfg]_readonly to lp[cfg]_read_only for consistency with docsMichael Adam2014-02-031-1/+1
| | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* loadparm: rename lp[cfg]_hostsdeny to lp[cfg]_hosts_deny for consistency ↵Michael Adam2014-02-032-3/+3
| | | | | | | | | with docs Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* loadparm: rename lp[cfg]_hostsallow to lp[cfg]_hosts_allow for consistency ↵Michael Adam2014-02-032-3/+3
| | | | | | | | | with docs Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* loadparm: rename lp[cfg]_pathname to lp[cfg]_path for consistency with docsMichael Adam2014-02-034-9/+9
| | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* s3:smbd: skip empty records in smbXsrv_open_cleanup()Stefan Metzmacher2014-01-301-0/+9
| | | | | | | | | | | This should avoid scary ndr_pull errors, if there's a cleanup race. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Thu Jan 30 18:49:37 CET 2014 on sn-devel-104
* smbd:smb2: fix durable reconnect: set fsp->fnum from the smbXsrv_open->local_idMichael Adam2014-01-301-0/+1
| | | | | | | Originally, fsp->fnum was left at the INVALID fnum value. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3: Don't open the dir for stat/attr/acl related maskAbhidnya Joshi2014-01-231-10/+21
| | | | | | | | | Signed-off-by: Abhidnya Joshi <achirmul@in.ibm.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Jan 23 03:56:35 CET 2014 on sn-devel-104
* smbd: Use messaging_read_send in smbXsrv_session.cVolker Lendecke2014-01-211-15/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-smbd: Log user change information.Andreas Schneider2014-01-171-0/+6
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s3:dir - Introduce a 64-bit directory offset <-> 32 bit wire offset map ↵Jeremy Allison2014-01-151-2/+87
| | | | | | | | | | | using memcache. Should fix the DOS clients against 64-bit smbd's bug. https://bugzilla.samba.org/show_bug.cgi?id=2662 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:dir - Map wire offsets to native directory cookies.Jeremy Allison2014-01-151-5/+17
| | | | | | | | | Take care of the special offsets. https://bugzilla.samba.org/show_bug.cgi?id=2662 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:dir - Cope with fixed mapping of 'special' values.Jeremy Allison2014-01-151-0/+7
| | | | | | | https://bugzilla.samba.org/show_bug.cgi?id=2662 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3: dir - Introduce 32-bit wire versions of the 'special' values.Jeremy Allison2014-01-151-0/+5
| | | | | | | https://bugzilla.samba.org/show_bug.cgi?id=2662 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:dir - Introduce a function to map a directory cookie to a 32-bit wire cookie.Jeremy Allison2014-01-151-1/+10
| | | | | | | | | Make this an identity for now. https://bugzilla.samba.org/show_bug.cgi?id=2662 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:dir - In the old SMB1 search code, rename offset to wire_offset to ↵Jeremy Allison2014-01-151-8/+8
| | | | | | | | | | | distinguish between wire and native offsets. Rename uint32 type to correct uint32_t. https://bugzilla.samba.org/show_bug.cgi?id=2662 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* smbd: Avoid duplicate debug header linesVolker Lendecke2014-01-151-7/+7
| | | | | | | | | | | | | | This is what gets created in log.smbd: DEBUGLVL generates an empty header line, CHECK_DEBUGLVL avoids this. [2014/01/10 12:58:24.971658, 10, pid=2329, effective(1001, 1001), real(0, 0)] ../source3/smbd/smbXsrv_open.c:696(smbXsrv_open_global_store) [2014/01/10 12:58:24.971690, 10, pid=2329, effective(1001, 1001), real(0, 0)] ../source3/smbd/smbXsrv_open.c:698(smbXsrv_open_global_store) 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): Wed Jan 15 04:02:58 CET 2014 on sn-devel-104
* s3: set native os according to Windows and NBT_ANNOUNCE_VERSION definesBjörn Jacke2014-01-141-1/+5
| | | | | | | | | | | | | | When the native os in sessionsetup is "Unix" then broken Konica Minolta printers refuse to talk to those CIFS servers. Other CIFS servers also announce themselves with native os Windows. Let's do the same to improve interoperability with broken devices like those printers from Konica Minolta. Thanks to Daniel Hoffmann for finding and reporting this Konika printer brokenness. https://bugzilla.samba.org/show_bug.cgi?id=10168 Signed-off-by: Bjoern Jacke <bj@sernet.de> Reviewed-by: Jeremy Allison <jra@samba.org>
* dfs: always call create_conn_struct with root privilegesGarming Sam2014-01-101-1/+30
| | | | | | | | | | | | | | | | | | This fixes a bug in dfs_samba4 identified by Daniel Müller. create_conn_struct calls SMB_VFS_CONNECT which requires root privileges. SMB_VFS_CONNECT in turn calls dfs_samba4_connect which connects to samdb. Calls were made to this function without ever becoming root (notably via setup_dfs_referral) which resulted in an error and the VFS connect failing. This happens when you have an active directory domain controller with host msdfs = yes in smb.conf and dfs links in place. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Bjoern Baumbach <bb@sernet.de> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Jan 10 20:11:03 CET 2014 on sn-devel-104
* smbd: Make "num_children" available by smbcontrolVolker Lendecke2014-01-062-0/+18
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christof Schmit <cs@samba.org>
* smbd: Fix CID 1138328 Logically dead codeVolker Lendecke2013-12-171-0/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: avoid calling fd_is_readable() without async echo handlerStefan Metzmacher2013-12-141-11/+13
| | | | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Sat Dec 14 20:19:10 CET 2013 on sn-devel-104
* s3:smbd: use PATH_MAX for the buffer passed to full_path_tos()Stefan Metzmacher2013-12-142-2/+2
| | | | | | | We use this in other places too and it's better than a hardcoded value. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* smbd: Implement and use full_path_tosVolker Lendecke2013-12-143-15/+60
| | | | | | | | Yes, this looks like a hack, but talloc_asprintf does show up high in profiles called from these routines Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Avoid pointless strcsequal callsVolker Lendecke2013-12-141-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Fix a false DEBUG fn nameVolker Lendecke2013-12-141-2/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:smbd/smb2 fix compiler warningsChristian Ambach2013-12-122-10/+10
| | | | | | | about a potentially uninitialized variables Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd react on message that client should be disconnectedChristian Ambach2013-12-122-0/+45
| | | | | | | | | if MSG_SMB_KILL_CLIENT_IP message comes in and our client has the IP address given as argument, then shutdown the connection immediately Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Christof Schmitt <cs@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-093-10/+5
| | | | | | | | | | | | 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-095-10/+10
| | | | | | | | | 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: Fix regression for the dropbox case.Volker Lendecke2013-12-091-5/+5
| | | | | | | | | | We need to allow to save a file to a directory with perm -wx. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10297 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* CVE-2013-4408:s3:Ensure LookupNames replies arrays are range checked.Jeremy Allison2013-12-091-0/+8
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185 Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: Return correct error code from SMB2 AIO read failureChristof Schmitt2013-12-051-1/+1
| | | | | | | | | This is similar to commit 27e20d5d60ea8aa526bcb7c2dfc18dd2de0bb97b which fixed the same case for SMB2 writes: When sending the AIO read fails, return the real error instead of mapping it to NT_STATUS_FILE_CLOSED. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-aio: Use correct locking context for SMB2Christof Schmitt2013-12-051-2/+2
| | | | | | | | | The synchronous SMB2 reads and writes use open_persistent_id. The AIO codepathes have to use the same, otherwise a write will conflict with a lock on the same open file. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Fix a panic when a smb2 brlock times outVolker Lendecke2013-12-051-1/+1
| | | | | | | | | | Found by Peter Somogyi. 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): Thu Dec 5 21:21:35 CET 2013 on sn-devel-104
* smbd - allow updates on directory write times on open handles.Jeremy Allison2013-12-051-1/+8
| | | | | | | | | | | | | | | | | | | If we set a non-null 'old timestamp' in the share mode database when creating a directory handle, this prevents mtime (write time) updates from being seen by clients, as we will always return the timestamp stored in the database whilst the handle is open. For files this is ok, as we update the stored timestamp ourselves when we write to the handle. For directories we should just rely on the mtime value from the underlying filesystem. Torture test to follow. BUG: https://bugzilla.samba.org/show_bug.cgi?id=9870 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* smbd: Avoid calling notify_filter_string for low debuglevelsVolker Lendecke2013-12-041-1/+1
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Dec 4 20:09:39 CET 2013 on sn-devel-104
* s3:smb2_server: avoid calling set_current_user_info() for each requestStefan Metzmacher2013-11-273-7/+9
| | | | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Nov 27 16:31:44 CET 2013 on sn-devel-104
* s3:smb2_server: generate a header blob for the sendfile pathStefan Metzmacher2013-11-273-5/+40
| | | | | | | | | | We need to pass the NBT header, SMB2 header and SMB2 Read header as header blob to SMB_VFS_SENDFILE(). This allows the usage of MSG_SEND or other tricks to avoid multiple TCP packets on the wire. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* s3:smb2_server: allocate smbd_smb2_request on talloc_tos()Stefan Metzmacher2013-11-271-1/+3
| | | | | | | | This matches the behavior for smb1 requests and avoids an additional malloc() per request. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* s3:smb2_server: use tevent_req_notify_callback() in ↵Stefan Metzmacher2013-11-271-0/+7
| | | | | | | | | | | smbd_smb2_request_pending_queue() If the request is already done we can avoid one iteration of tevent_loop_once(), which means we avoids one talloc_stackframe_pool/talloc_free pair. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* s3:smb2_server: for performance reasons we use tevent_fd and readv/writev ↵Stefan Metzmacher2013-11-272-438/+402
| | | | | | | | | | | | | | | | | | | | | directly Going via tevent_req_create/talloc_free at multiple layer costs too much cpu cycles per request. I tested downloading a 16GB (sparse) file with smbclient -b1 -mNT1, and -mSMB2_02. Using smb2 max read = 64512, which means smb1 and smb2 will use the same read size. I build with -O3 -g and compared the results with valgrind --tool=callgrind. With -mNT1 the server uses about 2.000.000.000 cpu cycles. This patch reduces the userspace cpu cycles for -mSMB2_02 from about ~ 8.000.000.000 down to ~ 4.000.000.000. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* s3:smb2_server: fix drain_socket error handlingStefan Metzmacher2013-11-271-3/+17
| | | | | | | | smbd_smb2_request_error_ex() should return NTSTATUS and the caller will terminate the connection. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* smbd: Fix a typoVolker Lendecke2013-11-271-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@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