summaryrefslogtreecommitdiffstats
path: root/source3
Commit message (Collapse)AuthorAgeFilesLines
* shadow_copy2: add a comment explaining why we don't talloc_zero_array().Michael Adam2013-12-111-0/+9
| | | | | | | | | | | Since I stumbled over this slighly sublte point, I thought it is worthwile to point it our in a comment. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Wed Dec 11 19:55:20 CET 2013 on sn-devel-104
* shadow_copy2: revert expensive and unnecessary zero-initializationMichael Adam2013-12-111-1/+1
| | | | | | | | | | | | | | | I was being overly cautious. This is initialization is not necessary, since further down in the for-loop, the memory always gets fully initialized because the insert string is inserted at various slash positions. So this talloc_zero_array can be skipped: this an expensive thing to do in virtually every VFS call. This essentially reverts commit 249e9b4a34d8959bd94735c1921ecfc24d6a2705. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3: use directory_create_or_exist_strict() to create corepathGregor Beck2013-12-111-16/+17
| | | | | | | | | This simplifies the code and even works in testenv where the chown call fails. Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3-lib: Fix %G substitution for domain users in smbdAndreas Schneider2013-12-101-1/+11
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=10286 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org> Autobuild-User(master): Christian Ambach <ambi@samba.org> Autobuild-Date(master): Tue Dec 10 16:39:43 CET 2013 on sn-devel-104
* s3:winbindd fix use of uninitialized variablesChristian Ambach2013-12-101-0/+13
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10280 Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:lib/asys modify included headersChristian Ambach2013-12-101-4/+2
| | | | | | | use the headers from libreplace, not the system ones Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Volker Lendecke <vl@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>
* s3-winbindd: Fix DEBUG statement in winbind_msg_offline().Jan Brummer2013-12-091-1/+1
| | | | | | | | | | | | Guenther BUG: https://bugzilla.samba.org/show_bug.cgi?id=10285 Reviewed-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Mon Dec 9 17:28:37 CET 2013 on sn-devel-104
* CVE-2013-4408:s3:Ensure LookupRids() replies arrays are range checked.Jeremy Allison2013-12-096-5/+62
| | | | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185 Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Karolin Seeger <kseeger@samba.org> Autobuild-Date(master): Mon Dec 9 09:00:41 CET 2013 on sn-devel-104
* CVE-2013-4408:s3:Ensure LookupNames replies arrays are range checked.Jeremy Allison2013-12-0911-17/+291
| | | | | | | 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>
* CVE-2013-4408:s3:Ensure LookupSids replies arrays are range checked.Jeremy Allison2013-12-094-3/+56
| | | | | | | 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>
* CVE-2013-4408:s3:Ensure we always check call_id when validating an RPC reply.Jeremy Allison2013-12-091-8/+25
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* CVE-2013-4408:s3:ctdb_conn: add some length verification to ctdb_packet_more()Stefan Metzmacher2013-12-091-0/+5
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* CVE-2013-4408:s3:util_tsock: add some overflow detection to ↵Stefan Metzmacher2013-12-091-0/+5
| | | | | | | | | tstream_read_packet_done() Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* CVE-2013-4408:s3:rpc_client: verify frag_len at least contains the header sizeStefan Metzmacher2013-12-091-0/+8
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* CVE-2013-4408:s3:rpc_client: check for invalid frag_len in ↵Stefan Metzmacher2013-12-091-0/+4
| | | | | | | | | dcerpc_pull_ncacn_packet() Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:vfs_btrfs change includesChristian Ambach2013-12-071-2/+1
| | | | | | | use the ones from libreplace instead of system ones Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
* s3:pam_smbpass change includesChristian Ambach2013-12-071-7/+4
| | | | | | | use the ones from libreplace instead of system ones Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
* s3:vfs fix a compile warningChristian Ambach2013-12-071-1/+1
| | | | | | | | Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Sat Dec 7 14:20:43 CET 2013 on sn-devel-104
* s3:modules:shadow_copy2: remove redundant documentation comment blockMichael Adam2013-12-071-77/+4
| | | | | | | | | and refer to the manual page instead Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:modules:shadow_copy2: improve headline commentMichael Adam2013-12-071-1/+1
| | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:module:shadow_copy2: add my (C)Michael Adam2013-12-071-0/+1
| | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Run smb2.lock tests also against AIO shareChristof Schmitt2013-12-051-0/+4
| | | | | Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-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>
* s3-torture: Call cli_flush().Andreas Schneider2013-12-061-1/+2
| | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Fri Dec 6 03:07:32 CET 2013 on sn-devel-104
* s3-libsmb: Fix a memory leak in get_pdc_ip().Andreas Schneider2013-12-061-0/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3-torture: Make sure status is used initialized.Andreas Schneider2013-12-061-4/+3
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3-torture: Fix several memory leaks in delete_fn().Andreas Schneider2013-12-061-1/+5
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3-utils: Fix a memory leak in smbget.Andreas Schneider2013-12-061-0/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@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>
* idmap_cache: Use gencache_parseVolker Lendecke2013-12-051-32/+47
| | | | | | | | | | This avoids a few tallocs and brings down user CPU a bit more Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Thu Dec 5 03:06:10 CET 2013 on sn-devel-104
* idmap_cache: Use an fstring instead of talloc_asprintfVolker Lendecke2013-12-051-12/+6
| | | | | | | | In a test doing one million uid2sid calls this brings down user CPU from 1.3 seconds to 0.9 seconds. And it saves a few code lines. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* messaging3: Do not go through messages.tdb for self-sendsVolker Lendecke2013-12-051-0/+54
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* test: add fake_snap.pl for snapshot simulationDavid Disseldorp2013-12-051-0/+70
| | | | | | | | The script simulates snapshots by simply copying file data from the base path to a snapshot path located under .snapshots/@GMT-%Y.%m.%d-%H.%M.%S/ Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:utils remove orphaned codeChristian Ambach2013-12-021-96/+0
| | | | | | | this does not even compile at all.. looks like a real orphan Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-By: Jelmer Vernooij <jelmer@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
* build: check linux/fs.h for compression flagsDavid Disseldorp2013-11-271-1/+2
| | | | | | | | | | | | | | Needed for old distributions (e.g. SLES8), which provide a linux/fs.h without the FS_IOC_GETFLAGS/FS_COMPR_FL defines needed for the btrfs VFS module. Reported-by: Andrew Bartlett <abartlet@samba.org> Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Nov 27 18:44:14 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
* torture3: Reproducer for bug 10284Volker Lendecke2013-11-264-0/+89
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Nov 26 22:53:04 CET 2013 on sn-devel-104