summaryrefslogtreecommitdiffstats
path: root/source3/smbd
Commit message (Collapse)AuthorAgeFilesLines
* s3:smbd: Fix Coverity ID 937, REVERSE_INULLVolker Lendecke2009-09-041-2/+2
|
* Hopefully last part of the fix for bug 6651 - smbd SIGSEGV when breaking ↵Jeremy Allison2009-09-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | oplocks. This one is subtle. There is a race condition where a signal can be queued for oplock break, and then the file can be closed by the client before the signal can be processed. Currently if this occurs we panic (we can't match an incoming signal fd with a fsp pointer). Simply log the error (at debug level 10 right now, might be too much) and then return without processing the break request. It looks like there is another race condition with this fix, but here's why it won't happen. If the signal was pending (caused by a kernel oplock break from a local file open), and the client closed the file and then re-opened another file which happened to use the same file descriptor as the file just closed, then theoretically the oplock break requests could be processed on the wrong fd. Here's why this should be very rare.. Processing a pending signal always take precedence over an incoming network request, so as long as the client close request is non-chained then the break signal should always be harmlessly processed *before* the open can be called. If the open is chained onto the close, and the fd on the new open is the same as the old closed fd, then it's possible this race will occur. However, all that will happen is that we'll lose the oplock on this file. A shame, but not a fatal event. Jeremy.
* s3: Add a new VFS op called SMB_VFS_TRANSLATE_NAMEAravind Srinivasan2009-08-285-24/+92
| | | | | | | | | | | This vop is designed to work in tandem with SMB_VFS_READDIR to allow vfs modules to make modifications to arbitrary filenames before they're consumed by callers. Subsequently the core directory enumeration code in smbd is now changed to free the memory that may be allocated in a module. This vop enables the new version of catia in the following patch. Signed-off-by: Tim Prouty <tprouty@samba.org>
* s3:smbd: teach filename_convert() about fake files (2nd fix for bug #6642)Stefan Metzmacher2009-08-271-0/+11
| | | | metze
* s3:smbd: add is_fake_file_path() that takes only the raw path as stringStefan Metzmacher2009-08-271-14/+22
| | | | metze
* s3:streams: check for :$DATA only in the backend (fix bug #6642)Stefan Metzmacher2009-08-271-3/+0
| | | | | | | We need to allow "\\$Extend\\$Quota:$Q:$INDEX_ALLOCATION" to pass check_path(), so that the Quota Dialog works. metze
* s3/smbd: open the share_info.tdb on startup instead of tconxSteven Danneman2009-08-261-0/+9
| | | | | | | | This is a small performance optimization. Instead of opening the tdb on every smb connection in the forked child process, we now open it in the parent and share the fd. This also reduces the total fd usage in the system.
* Help debug for bug 6651 - smbd SIGSEGV when breaking oplocks.Jeremy Allison2009-08-241-0/+4
| | | | | | Should help track if we get invoked with an invalid fd from the signal handler. Jeremy.
* Second attempt at fix for bug 6529 - Offline files conflict with Vista and ↵Jeremy Allison2009-08-247-94/+62
| | | | | | | | Office 2003. Confirmation from reporter that this fixes the issue in master on ext3/ext4. Back-ports to follow. Jeremy.
* Second part of fix for 6529 - Offline files conflict with Vista and Office 2003.Jeremy Allison2009-08-241-0/+11
| | | | | | ext4 may be able to store ns timestamps, but the only API to *set* timestamps takes usec, not nsec. Round to usec on set requests. Jeremy.
* Log debug message when hires timestamps are available on theJeremy Allison2009-08-211-0/+4
| | | | | share. Jeremy.
* Fix bug 6529 - Offline files conflict with Vista and Office 2003Jeremy Allison2009-08-213-1/+27
| | | | | | | | On filesystems that can't store less than one second timestamps, round the incoming timestamp set requests so the client can't discover that a time set request has been truncated by the filesystem. Needs backporting to 3.4, 3.3, 3.2 and (even) 3.0. Jeremy
* Fix coverity CID: 932 - forward null.Jeremy Allison2009-08-211-2/+4
| | | | Jeremy.
* s3:smbd: implement SMB2 Find (Query Directory)Stefan Metzmacher2009-08-191-1/+197
| | | | metze
* s3:smbd: store a dirptr on the files_struct for SMB2 Query DirectoryStefan Metzmacher2009-08-191-0/+4
| | | | metze
* s3:smbd: add a generic smbd_dirptr_lanman2_entry() functionStefan Metzmacher2009-08-192-46/+214
| | | | | | | | This can we used by SMB2, the key difference between SMB1 and SMB2 is that with SMB2 entries are aligned to 8 bytes and there's no padding at the end of the last entry. metze
* s3:smbd: implement all SMB2 Create contexts except "ExtA"Stefan Metzmacher2009-08-191-8/+217
| | | | metze
* s3:smbd: make smbd_check_open_rights() function non-static for use in SMB2Stefan Metzmacher2009-08-192-8/+13
| | | | metze
* s3:smbd: parse context blobs in SMB2 CreateStefan Metzmacher2009-08-191-48/+150
| | | | metze
* s3:smbd: add support for canceling SMB2 Notify calls.Stefan Metzmacher2009-08-171-0/+17
| | | | metze
* s3:smbd: add smbd_notify_cancel_by_smbreq()Stefan Metzmacher2009-08-172-0/+23
| | | | | | This function will be used by the SMB2 notify code. metze
* s3:smbd: implement SMB2 Cancel correctly.Stefan Metzmacher2009-08-1713-60/+32
| | | | metze
* s3:smbd: allow SMB2 Cancel to have the async flag setStefan Metzmacher2009-08-141-6/+8
| | | | metze
* s3:smbd: fix parsing of the SMB2 bodyStefan Metzmacher2009-08-141-5/+7
| | | | | | Maybe there's no dynamic part on the wire. metze
* Fix BASE-DELAYWRITE test by removing const from struct smb_filenameJeremy Allison2009-08-123-21/+21
| | | | | | | | in smbd_do_qfilepathinfo(). update_stat_ex_mtime() modifies the stat struct inside the smb_fname so don't make a copy of that stat struct, use it directly - it's meant to be updated and represent the state of the file we're returning. Jeremy.
* Add "store create time" parameter (docs to follow)Jeremy Allison2009-08-125-13/+106
| | | | | that stores the create time in the user.DosTimestamps EA. Jeremy.
* libcli: move some common SMB and SMB2 stuff into libcli/smb/Stefan Metzmacher2009-08-1219-19/+19
| | | | | | This will hold code that's shared between source3 and source4. metze
* s3:smbd: as check_path_syntax() changes the string, we need to copy the ↵Stefan Metzmacher2009-08-121-2/+8
| | | | | | string before metze
* s3:smbd: avoid 'goto out' in smbd_smb2_create_send()Stefan Metzmacher2009-08-121-20/+15
| | | | metze
* s3:smbd: make sure we don't call conn_free() with a NULL pointer for SMB2Stefan Metzmacher2009-08-121-1/+3
| | | | metze
* s3:smbd: correctly invalidate vuids when SMB2 is usedStefan Metzmacher2009-08-122-0/+5
| | | | metze
* Ensure the fsp->fsp_name stat_ex struct is alwaysJeremy Allison2009-08-101-0/+1
| | | | | up to date after the open. Jeremy.
* Refactor the use of create_time and change time to goJeremy Allison2009-08-104-26/+66
| | | | | through functions. Will aid in making us pass RAW-SETFILEINFO. Jeremy.
* s3:smbd: convert '\\' into '/' in SMB2 CreateStefan Metzmacher2009-08-081-0/+8
| | | | metze
* s3:smbd: rename conn => sconn for smbd_server_connection structsStefan Metzmacher2009-08-0815-118/+118
| | | | | | | This should avoid confusion between smbd_server_connection and connection_struct variables. metze
* Move the checks for null timestamps down below the VFS_NTIMESJeremy Allison2009-08-071-30/+3
| | | | | | layer (as it's done in onefs). This simplifies greatly the code in smb_set_file_time() w.r.t. changenotify messages. Jeremy.
* Correctly send out notify messages for timestamp changes.Jeremy Allison2009-08-071-5/+3
| | | | | | | "change time" has no notify message, so don't send anything out when we change it. Use FILE_NOTIFY_CHANGE_CREATION correctly when changing the create time. Jeremy.
* s3:smbd: split the dir entry marshalling into smbd_marshall_dir_entry()Stefan Metzmacher2009-08-071-443/+482
| | | | | | So that we can reuse it for SMB2 Find. metze
* s3:smbd: move dptr globals into struct smbd_server_connectionStefan Metzmacher2009-08-077-88/+135
| | | | metze
* s3:smbd: remove dirptr and dirpath from connection_structStefan Metzmacher2009-08-075-48/+46
| | | | | | | They're both only used in the context of a function, so we can make them stack variables. metze
* s3:smbd: implement get_lanman2_dir_entry() on top of smbd_dirptr_get_entry()Stefan Metzmacher2009-08-071-229/+215
| | | | metze
* s3:smbd: let get_dir_entry() use smbd_dirptr_get_entry()Stefan Metzmacher2009-08-071-139/+89
| | | | metze
* s3:smbd: add generic smbd_dirptr_get_entry()Stefan Metzmacher2009-08-072-0/+163
| | | | metze
* s3:smbd: conn_free_internal() can be static nowStefan Metzmacher2009-08-073-17/+17
| | | | metze
* s3:smbd: add a smbd_server_connection pointer to connection_structStefan Metzmacher2009-08-075-31/+35
| | | | | | | This can be NULL for faked connection structs used in the rpc server or printing code. metze
* s3:smbd: don't ignore check_descend in get_dir_entry()Stefan Metzmacher2009-08-071-0/+6
| | | | metze
* s3: Fix a bug in renames of directoriesTim Prouty2009-08-061-6/+19
| | | | | | | | | Recently code was added to match windows semantics of denying the rename of a directory if there are open files underneath it. This does partly match windows semantics, but it turns out the rename should be allowed if the open file handle is for the directory being renamed, or for a stream on the directory being renamed. This patch refines the check to better follow these rename semantics.
* Remove a const warning.Jeremy Allison2009-08-061-1/+1
| | | | Jeremy.
* Put SMB_INFO_STANDARD back into setfileinfo, but do it rightJeremy Allison2009-08-061-0/+45
| | | | | this time :-). Jeremy.
* We're not changing last write, but setting this to be ↵Jeremy Allison2009-07-311-1/+1
| | | | | | | | FILE_NOTIFY_CHANGE_CREATION doesn't work. So use FILE_NOTIFY_CHANGE_LAST_WRITE (now seems to reliably fix bug #6529 - Offline files conflict with Vista and Office 2003. Jeremy.