summaryrefslogtreecommitdiff
path: root/source3/smbd/nttrans.c
AgeCommit message (Collapse)AuthorFilesLines
2010-04-12Move to using 64-bit mid values in our internal open file database.Jeremy Allison1-1/+2
This will allow us to share logic much easier between SMB1 and SMB2 servers. Jeremy
2010-04-07s3: add comment about what the FSCTL_QUERY_ALLOCATED_RANGES currently doesBjörn Jacke1-0/+6
2010-04-05Add FSCTL_QUERY_ALLOCATED_RANGES to the list of Windows ioctls we support.Jeremy Allison1-0/+52
Based on a patch reported and tested by Ira Cooper <samba@ira.wakeful.net>. Jeremy.
2010-03-30Second part of fix for bug #6494 - Incorrect FileStatus returned in ↵Jeremy Allison1-1/+19
NT_CREATE_ANDX. Ensure we do this in nttrans create too. Jeremy.
2010-03-05Fix for bug #7189 - Open txt files with notepad on samba shares creates problem.Jeremy Allison1-0/+4
Ensure we don't use any of the create_options for Samba private use. Add a new parameter to the VFS_CREATE call (private_flags) which is only used internally. Renumber NTCREATEX_OPTIONS_PRIVATE_DENY_DOS and NTCREATEX_OPTIONS_PRIVATE_DENY_FCB to match the S4 code). Rev. the VFS interface to version 28. Jeremy.
2009-12-21Remove all calls to reply_doserror - turn them intoJeremy Allison1-42/+42
correct reply_nterror calls. Next rename reply_doserror -> reply_force_doserror and plumb in when NT_STATUS_DOS is used. Jeremy.
2009-12-17Vector correctly through reply_openerror() (which uses the same logic).Jeremy Allison1-6/+1
Jeremy.
2009-11-24Fix make test. Only do POSIX case conversion if FILE_FLAG_POSIX_SEMANTICS ↵Jeremy Allison1-8/+12
set. Doh ! Jeremy.
2009-11-23Restore NtCreateX case handling with FILE_FLAG_POSIX_SEMANTICS to the wayJeremy Allison1-5/+68
it worked in 3.3.x and 3.2.x. UCF_POSIX_PATHNAMES may no longer be needed, as lp_posix_pathnames() being set isn't the same as case handling from NtCreateX (lp_posix_pathnames() changes the STAT calls to LSTAT, not the case semantics). Jeremy.
2009-11-23Proper fix for #6898 - Samba duplicates file content on appending. Pointed ↵Jeremy Allison1-12/+18
out by Volker.Restores the pathname handling for FILE_FLAG_POSIX_SEMANTICS but still prevents the O_APPEND problems. Jeremy.
2009-11-23Fix bug #6898 - Samba duplicates file content on appendingJeremy Allison1-0/+10
Clients using a Windows open call should not be able to set FILE_FLAG_POSIX_SEMANTICS in an open. Jeremy.
2009-11-23Revert "s3: Move the global variable Protocol to struct smbd_server_connection"Volker Lendecke1-1/+1
This reverts commit c85a4c9ba4a7de65a7850f6f9708df66bd24deea.
2009-11-21s3: Move the global variable Protocol to struct smbd_server_connectionVolker Lendecke1-1/+1
2009-11-17Remove "store create time" code, cause create time to be storedJeremy Allison1-8/+10
in the "user.DOSATTRIB" EA. From the docs: In Samba 3.5.0 and above the "user.DOSATTRIB" extended attribute has been extended to store the create time for a file as well as the DOS attributes. This is done in a backwards compatible way so files created by Samba 3.5.0 and above can still have the DOS attribute read from this extended attribute by earlier versions of Samba, but they will not be able to read the create time stored there. Storing the create time separately from the normal filesystem meta-data allows Samba to faithfully reproduce NTFS semantics on top of a POSIX filesystem. Passes make test but will need more testing. Jeremy.
2009-11-05Got the logic simplification worked out so we still passJeremy Allison1-1/+1
BASE-DELAYWRITE and also RAW-CLOSE. Jeremy.
2009-11-05Revert commit "0551284dc08eb93ef7b2b2227a45e5ec21d482fb" - simplifyJeremy Allison1-1/+1
the logic. This was incorrect (I'll revisit this tomorrow). Jeremy.
2009-11-05Simplify the logic - remove extraneous argument and calls to ↵Jeremy Allison1-1/+1
set_close_write_time(). We were treating a file time set on close as a sticky write time set, and I don't think it is. I will add a torture test later to RAW-CLOSE to confirm this. Jeremy.
2009-11-05Get closer to an accurate model of Windows timestamp changes.Jeremy Allison1-1/+1
"Normal" non truncate writes always cause the timestamp to be set on close. Once a close is done on a handle this can reset the sticky write time to current time also. Updated smbtorture4 confirms this. Jeremy.
2009-11-04Remove "Protocol" as an extern, and add accessor functions.Jeremy Allison1-2/+1
Jeremy.
2009-10-08s3: Fix shadow copy display on Windows 7Volker Lendecke1-1/+1
Windows 7 is a bit more picky on our NT_STATUS_BUFFER_TOO_SMALL. Announce the right buffer size, the same amount we later check for.
2009-09-17We now pass the Microsoft SMB2 fileio test with EA's and streams...Jeremy Allison1-1/+1
Jeremy.
2009-09-14Fix bug 6494 - Incorrect FileStatus returned in NT_CREATE_ANDX.Jeremy Allison1-1/+19
Lookup the EA and Stream status on CreateX. Jeremy.
2009-08-24Second attempt at fix for bug 6529 - Offline files conflict with Vista and ↵Jeremy Allison1-8/+8
Office 2003. Confirmation from reporter that this fixes the issue in master on ext3/ext4. Back-ports to follow. Jeremy.
2009-08-12Add "store create time" parameter (docs to follow)Jeremy Allison1-4/+4
that stores the create time in the user.DosTimestamps EA. Jeremy.
2009-08-10Refactor the use of create_time and change time to goJeremy Allison1-10/+22
through functions. Will aid in making us pass RAW-SETFILEINFO. Jeremy.
2009-07-24s3: Convert a few callers of unix_convert() over to filename_convert()Tim Prouty1-2/+2
This patch also changes the unix convert flags to make sure the correct semantics are preservered for allowing/disallowing wildcards in the last component of the path.
2009-07-24s3: Simplify rename_internals() by passing in smb_filename structsTim Prouty1-69/+52
2009-07-24s3: Allow filename_convert() to pass through unix_convert_flags and let the ↵Tim Prouty1-0/+8
caller know if the path has a wildcard This also eliminates the need for resolve_dfspath().
2009-07-21s3: Remove the now unused fname parameter from filename_convert()Tim Prouty1-8/+4
2009-07-21s3: Fix RENAME_FLAG_RENAME path to stop calling unix_convert twiceTim Prouty1-50/+75
2009-07-20s3: Move is_ntfs_stream*() to filename.cTim Prouty1-24/+0
2009-07-20s3: Change fsp->fsp_name to be an smb_filename struct!Tim Prouty1-9/+11
2009-07-08s3: Remove is_ntfs_stream_name() and split_ntfs_stream_name()Tim Prouty1-48/+1
Actually I moved split_ntfs_stream_name into torture.c which is the one consumer of it. This could probably be changed at some point.
2009-07-08s3: Plumb smb_filename through dos_mode() and related funtionsTim Prouty1-12/+6
2009-07-08Rename update_stat_ex_writetime() -> update_stat_ex_mtime()Jeremy Allison1-2/+2
to better describe what we're doing here. Jeremy
2009-07-08The migration to struct stat_ex broke the calculation ofJeremy Allison1-0/+18
create time from the existing timestamps (for systems that need to do this). Once the write time is changed via a sticky write, the create time might need to be recalculated. To do this I needed to add a bool into struct stat_ex to remember if the st_ex_btime field was calculated, or read from the OS. Also fixed the returning of modified write timestamps in the return from NTCreateX, SMBattr and SMBattrE (which weren't taking into account the modified timestamp stored in the open file table). Attempting to fix an issue with Excel 2003 and offline files. Volker and Metze, please review. Jeremy
2009-07-06s3: Plumb smb_filename around SMB_VFS_CHFLAGSTim Prouty1-11/+3
SMB_VFS_CHFLAGS isn't actually getting the smb_filename struct for now since it only operates on the basefile. This is the strategy for all path-based operations that will never actually operate on a stream. By clarifying the meaning of path based operations that don't take an smb_filename struct, modules that implement streams such as vfs_onefs no longer need to implement SMB_VFS_CHFLAGS to ensure it's only called on the base_name.
2009-07-06s3: Change some filename_convert to pass in NULL for char **fname argumentTim Prouty1-2/+2
2009-07-02s3:smbd: make change_notify_reply() more generic and hide send_nt_replies() ↵Stefan Metzmacher1-2/+11
behind a callback This prepares change notify support for SMB2. metze
2009-07-02s3:smbd: simplify the notify code a bit and always reply via ↵Stefan Metzmacher1-1/+3
change_notify_reply() -> send_nt_replies() metze
2009-07-02s3:smbd: push nttrans and trans2 responses with no data to the clientStefan Metzmacher1-0/+8
For sync replies it's not a problem, as construct_reply() will send the response, but for async replies we would not send the reply to the client. Currently the notify code works arround this manually, so I assume we didn't have a bug here. But the next commits will simplify the notify code. metze
2009-07-02s3:smbd: restore the 3.0.x bahavior of send_nt_replies()Stefan Metzmacher1-0/+5
We should also set the error code, when we return no parameters or data. metze
2009-06-25s3 file_access: Convert some more functions over to use smb_filneameTim Prouty1-2/+2
2009-06-25s3: simplify some redundant logic in is_ntfs_default_stream_smb_fname()Tim Prouty1-5/+1
2009-06-18Add some const to the stat struct in the dosmode calls.Jeremy Allison1-34/+6
Fix a couple more unix_convert uses to filename_convert. Fix bug in acl_group_override() where an uninitialized struct could be used. Move unix_convert with wildcard use in SMBsearch reply to boilerplate code. Jeremy.
2009-06-18Replace the boilerplate calls to :Jeremy Allison1-18/+12
resolve_dfspath() -> unix_convert() -> get_full_smb_filename() -> check_name() with a new function filename_convert(). This restores the check_name() calls that had gone missing since the default create_file was changed. All "standard" pathname processing now goes through filename_convert(). I'll take a look at the non-standard pathname processing next. As a benefit, fixed a missing resolve_dfspath() in the trans2 mkdir call. Jeremy.
2009-06-17s3: Change SMB_VFS_OPEN to take an smb_filename structTim Prouty1-0/+16
This was a little messy because of all of the vfs modules I had to touch. Most of them were pretty straight forward, but the streams modules required a little attention to handle smb_filename. Since the use of smb_filename enables the vfs modules to access the raw, over-the-wire stream, a little bit of the handling that was being done by split_ntfs_stream_name has now been shifted into the individual stream modules. It may be a little more code, but overall it gives more flexibility to the streams modules, while also allowing correct stream handling.
2009-06-17s3: Plumb smb_filename from create_file all of the way down to fd_openTim Prouty1-0/+12
I used the smb_filename struct everywhere that was feasible for the first pass. There are still some places in this path that need to be changed to use smb_filename, but this is a good start. I also: - Removed fname/path arguments from a few functions that weren't really using them. - Added a utility function for detecting whether an smb_filename is a stream.
2009-06-16Fix msdfs after the change to smb_filename struct. We must *always*Jeremy Allison1-4/+38
pull the pathname, then call resolve_dfspath(), before unix_convert(). Jeremy.
2009-06-12s3: Plumb smb_filename through SMB_VFS_CREATE_FILETim Prouty1-58/+45