summaryrefslogtreecommitdiffstats
path: root/source3/smbd
Commit message (Collapse)AuthorAgeFilesLines
...
* Add name_hash into the share mode entry struct (as yet only use for renames ↵Jeremy Allison2011-01-252-1/+10
| | | | to identify a specific path).
* Add name_hash to files_struct. Set within fsp_set_smb_fname().Jeremy Allison2011-01-251-1/+32
|
* s3-lanman: remove trailing whitespace.Günther Deschner2011-01-211-30/+30
| | | | Guenther
* s3:smbd: use dcerpc_spoolss_X() functionsStefan Metzmacher2011-01-212-32/+50
| | | | | | metze Signed-off-by: Andreas Schneider <asn@samba.org>
* s3: Fix a deadlock between smbd and ctdbdVolker Lendecke2011-01-211-4/+18
| | | | | | | | | | | | Do the notification after we released the share mode lock. Inside notify_fname we take out another tdb lock. With ctdb also accessing our databases, this can lead to deadlocks. Putting this notify after the TALLOC_FREE(lck) above we avoid locking two records simultaneously. Notifies are async and informational only, so calling the notify_fname without holding the share mode lock should not do any harm. Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Fri Jan 21 12:29:21 CET 2011 on sn-devel-104
* Remove all uses of "./" in pathnames - make canonical. This will become ↵Jeremy Allison2011-01-211-50/+78
| | | | | | | important when we need to guarantee canonical names for hashing. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri Jan 21 02:59:56 CET 2011 on sn-devel-104
* Ensure we don't use "./" in findfirst pathnames. Use a directory open of "." ↵Jeremy Allison2011-01-201-4/+8
| | | | instead.
* Make processing of incoming stream rename paths common between reply_mv and ↵Jeremy Allison2011-01-202-4/+47
| | | | ntrename. Ensure we don't depend on "./" in the streams module.
* s3:smbd: use anonymous_shared_free() for shared memory signing stateStefan Metzmacher2011-01-201-0/+7
| | | | | | | metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Thu Jan 20 07:48:29 CET 2011 on sn-devel-104
* lib/util: s/allocate_anonymous_shared/anonymous_shared_allocate/Stefan Metzmacher2011-01-201-1/+1
| | | | metze
* s3-smbd: Fixed a possible null pointer dereference.Andreas Schneider2011-01-191-1/+3
|
* s3: Fix a C++ warningVolker Lendecke2011-01-171-1/+1
|
* s3: Fix bug 7917: Yet another bug in chain_replyVolker Lendecke2011-01-141-2/+2
| | | | | | | Found by Michael Hanscho <samba@micha.priv.at> with a WinCE client. Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Fri Jan 14 17:42:05 CET 2011 on sn-devel-104
* s3-lanman: prefer dcerpc_srvsvc_X functions.Günther Deschner2011-01-131-3/+9
| | | | | | Guenther Signed-off-by: Andreas Schneider <asn@samba.org>
* s3-printing: Initiate pcap reload from parent smbdDavid Disseldorp2011-01-075-40/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 7022554, smbds share a printcap cache (printer_list.tdb), therefore ordering of events between smbd processes is important when updating printcap cache information. Consider the following two process example: 1) smbd1 receives HUP or printcap cache time expiry 2) smbd1 checks whether pcap needs refresh, it does 3) smbd1 marks pcap as refreshed 4) smbd1 forks child1 to obtain cups printer info 5) smbd2 receives HUP or printcap cache time expiry 6) smbd2 checks whether pcap needs refresh, it does not (due to step 3) 7) smbd2 reloads printer shares prior to child1 completion (stale pcap) 8) child1 completion, pcap cache (printer_list.tdb) is updated by smbd1 9) smbd1 reloads printer shares based on new pcap information In this case both smbd1 and smbd2 are reliant on the pcap update performed on child1 completion. The prior commit "reload shares after pcap cache fill" ensures that smbd1 only reloads printer shares following pcap update, however smbd2 continues to present shares based on stale pcap data. This commit addresses the above problem by driving pcap cache and printer share updates from the parent smbd process. 1) smbd0 (parent) receives a HUP or printcap cache time expiry 2) smbd0 forks child0 to obtain cups printer info 3) child0 completion, pcap cache (printer_list.tdb) is updated by smbd0 4) smbd0 reloads printer shares 5) smbd0 notifies child smbds of pcap update via message_send_all() 6) child smbds read fresh pcap data and reload printer shares This architecture has the additional advantage that only a single process (the parent smbd) requests printer information from the printcap backend. Use time_mono in housekeeping functions As suggested by Björn Jacke.
* s3-printing: reload shares after pcap cache fillDavid Disseldorp2011-01-073-7/+12
| | | | | | | | | | | | | | | | Since commit eada8f8a, updates to the cups pcap cache are performed asynchronously - cups_cache_reload() forks a child process to request cups printer information and notify the parent smbd on completion. Currently printer shares are reloaded immediately following the call to cups_cache_reload(), this occurs prior to smbd receiving new cups pcap information from the child process. Such behaviour can result in stale print shares as outlined in bug 7836. This fix ensures print shares are only reloaded after new pcap data has been received. Pair-Programmed-With: Lars Müller <lars@samba.org>
* s3-rpcecho: Only register rpcecho in the developer build.Andreas Schneider2011-01-042-0/+4
| | | | | Autobuild-User: Andreas Schneider <asn@samba.org> Autobuild-Date: Tue Jan 4 18:56:38 CET 2011 on sn-devel-104
* s3-smbd: Call the rpc service shutdown functions.Andreas Schneider2011-01-041-0/+34
|
* s3-smbd: Call all the rpc services in the right order.Andreas Schneider2011-01-041-5/+41
|
* Fix bug #7892 - open_file_fchmod() leaves a stale lock.Jeremy Allison2010-12-293-45/+10
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Dec 29 02:15:23 CET 2010 on sn-devel-104
* All calls to event_add_to_select_args() call GetTimeOfDay() andJeremy Allison2010-12-231-7/+2
| | | | | | | | | | | pass this in as the &now parameter. Push this call inside of event_add_to_select_args() to the correct point so it doesn't get called unless needed. Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Dec 23 01:08:11 CET 2010 on sn-devel-104
* My algorithm for determining whan an incoming sequence number can be allowed ↵Jeremy Allison2010-12-211-6/+7
| | | | | | | | | | is incorrect. (I based it on the text in MS-SMB2, silly me :-). Fix it so incoming sequence numbers can range over the entire allowable bitmap range. This fixes a repeatable disconnect against Win7. Jeremy.
* Keep track of the sparse status of an open file handle. Allows bypass ofJeremy Allison2010-12-213-1/+13
| | | | | | | | strict allocation on sparse files. Files opened as POSIX opens are always sparse. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Tue Dec 21 04:12:22 CET 2010 on sn-devel-104
* Added call out to a Linux-compatible fallocate() when we need to extend a fileJeremy Allison2010-12-211-1/+12
| | | | | | | allocation extent without changing end-of-file size. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Tue Dec 21 02:41:24 CET 2010 on sn-devel-104
* CREATE in a compound CREATE/NOTIFY sequence was being passed through ↵Ken Harris2010-12-201-17/+17
| | | | | | | | | | | | set_operation_credits() twice (ultimately perhaps because of bug 7331 involving this compound sequence and the need to be ready for any incoming CANCEL of the NOTIFY). This had the server thinking it had granted more credit than it actually had, which lead to zero-credits being granted in interim NOTIFY responses. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Mon Dec 20 20:59:55 CET 2010 on sn-devel-104
* From metze's work on sparse attributes. FILE_ATTRIBUTE_SPARSE is valid on ↵Jeremy Allison2010-12-201-1/+2
| | | | | | | get but not on set. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Mon Dec 20 20:11:22 CET 2010 on sn-devel-104
* s3: Reply correctly to FSCTL_IS_VOLUME_DIRTYVolker Lendecke2010-12-191-0/+9
|
* s3: Fix some nonempty blank linesVolker Lendecke2010-12-191-22/+22
|
* s3: re-add some debugs to check_reduced_nameVolker Lendecke2010-12-191-0/+2
|
* s3: Fix some typosVolker Lendecke2010-12-192-4/+4
|
* Rename vfs operation posix_fallocate to just fallocate and add the ↵Jeremy Allison2010-12-181-9/+12
| | | | | | | | | | | | | | | | | | | | | | vfs_fallocate_mode parameter. It turns out we need the fallocate operations to be able to both allocate and extend filesize, and to allocate and not extend filesize, and posix_fallocate can only do the former. So by defining the vfs op as posix_fallocate we lose the opportunity to use any underlying syscalls (like Linux fallocate) that can do the latter as well. We don't currently use the non-extending filesize call, but now I've changed the vfs op definition we can in the future. For the moment simply map the fallocate op onto posix_fallocate for the VFS_FALLOCATE_EXTEND_SIZE case and return ENOSYS for the VFS_FALLOCATE_KEEP_SIZE case. Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sat Dec 18 08:59:27 CET 2010 on sn-devel-104
* Move checks inside file_set_sparse() to allow it to be called from anywhere.Jeremy Allison2010-12-172-19/+21
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri Dec 17 21:56:38 CET 2010 on sn-devel-104
* file_set_sparse needs to be a handle based call.Jeremy Allison2010-12-172-11/+9
|
* s3:smbd: implement FSCTL_SET_SPARSE more correctlyBjörn Jacke2010-12-171-5/+43
| | | | | | | | | | | | | | this is a port of a patch from metze for 3.3: We don't do the "strict allocation" when the sparse bit isn't set, but that shouldn't matter. We now allow windows applications to set and unset the sparse bit. Note that in order to implement this 100% like described in [MS-FSA], we'd have to change our data model and support the sparse flag per stream.
* s3:smbd: add file_set_sparse() functionBjörn Jacke2010-12-171-0/+49
| | | | this is based on a patch for 3.3 from metze
* s3: remove set_sparse_flagBjörn Jacke2010-12-171-15/+1
| | | | | | | | we need to determine sparseness from the sparse flag we store not from the allocation size on the POSIX filesystem. This is how Windows works - in the first place sparseness is a file flag, not the allocation state of the file Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3: add FILE_ATTRIBUTE_SPARSE to get_stat_dos_flagsBjörn Jacke2010-12-171-0/+2
|
* Fix old bug in openX code, exposed when "strict allocate" is set to true.Jeremy Allison2010-12-161-5/+9
| | | | | | | | | | | We need to return the file size here, not the allocation size, but we were not updating the stat struct after the vfs_set_filesize() call. Ensure we always use fresh data in openX replies. Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Dec 16 02:37:58 CET 2010 on sn-devel-104
* Implement "use sendfile = yes" for SMB2. (cherry picked from commit ↵Jeremy Allison2010-12-153-3/+159
| | | | | | | 95cb7adcd03a1abbd0af395b6c96dd8e0eebd3d1) Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Dec 15 02:24:08 CET 2010 on sn-devel-104
* Change interface of schedule_smb2_aio_read() to allocate the return DATA_BLOB.Jeremy Allison2010-12-152-9/+25
| | | | | | | | | Change smb2_read code to allocate return DATA_BLOB just before the read. Preparing for SMB2 sendfile change which will not need to allocate return buffer. Jeremy
* Ensure we use vfs_fsp_stat(), not VFS_STAT directly, and store into ↵Jeremy Allison2010-12-141-19/+20
| | | | | | | | | | | fsp->fsp_name->st instead of a SMB_STRUCT_STAT on the stack. Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Tue Dec 14 05:05:50 CET 2010 on sn-devel-104
* Change crediting so that the credits are returned on the interim async response.Jeremy Allison2010-12-141-4/+7
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Tue Dec 14 01:09:05 CET 2010 on sn-devel-104
* As we handle missing sendfile() inside lib/sendfile.c, remove the ↵Jeremy Allison2010-12-131-7/+0
| | | | | | | WITH_SENDFILE ifdefs. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Mon Dec 13 23:47:07 CET 2010 on sn-devel-104
* We need to start off with smb2.credits_granted == 0. That wayJeremy Allison2010-12-131-2/+3
| | | | | | | when processing the faked up SMB2 NegProt from the SMB1 packet we always allocate one credit on reply. Jeremy.
* Remove extra unused credit arg. to smbd_smb2_request_setup_out()Jeremy Allison2010-12-131-3/+3
|
* Add a SMB2 crediting algorithm, by default the same as Windows. Defaults to ↵Jeremy Allison2010-12-102-24/+136
| | | | | | 128 credits. Jeremy.
* s3-smbd Don't send SPNEGO principal (rfc4178 hint) by defaultAndrew Bartlett2010-12-101-0/+3
| | | | | | | | | | | | | | This patch, based on the suggestion by Goldberg, Neil R. <ngoldber@mitre.org> turns off the sending of the principal in the negprot by default, matching Windows 2008 behaviour. This slowly works us back from this hack, which from an RFC perspective was never the right thing to do in the first place, but we traditionally follow windows behaviour. It also discourages client implmentations from relying on it, as if they do they are more open to man-in-the-middle attacks. Andrew Bartlett
* Merge the two conflicting allocation codes into one function, ↵Jeremy Allison2010-12-031-34/+45
| | | | | | | | vfs_slow_fallocate() and use that from both the truncate and fill_sparse functions. Jeremy.
* Move posix_fallocate into the VFS where it belongs.Jeremy Allison2010-12-021-2/+11
| | | | Jeremy.
* Fix bug #7835 - vfs_fill_sparse() doesn't use posix_fallocate when strict ↵Jeremy Allison2010-12-021-2/+30
| | | | | | | | allocate is on Tries posix_fallocate() and then falls back to old code. Jeremy.