summaryrefslogtreecommitdiff
path: root/source3/smbd/nttrans.c
AgeCommit message (Collapse)AuthorFilesLines
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
2009-06-10s3: Make all callers of SMB_VFS_CREATEFILE call unix_convert firstTim Prouty1-48/+66
This step is a requirement to change SMB_VFS_CREATEFILE to take an smb_filename struct.
2009-06-03s3:smbd: move some session specific globals to struct smbd_server_connectionStefan Metzmacher1-0/+2
metze
2009-05-26Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STATVolker Lendecke1-15/+13
This patch introduces struct stat_ex { dev_t st_ex_dev; ino_t st_ex_ino; mode_t st_ex_mode; nlink_t st_ex_nlink; uid_t st_ex_uid; gid_t st_ex_gid; dev_t st_ex_rdev; off_t st_ex_size; struct timespec st_ex_atime; struct timespec st_ex_mtime; struct timespec st_ex_ctime; struct timespec st_ex_btime; /* birthtime */ blksize_t st_ex_blksize; blkcnt_t st_ex_blocks; }; typedef struct stat_ex SMB_STRUCT_STAT; It is really large because due to the friendly libc headers playing macro tricks with fields like st_ino, so I renamed them to st_ex_xxx. Why this change? To support birthtime, we already have quite a few #ifdef's at places where it does not really belong. With a stat struct that we control, we can consolidate the nanosecond timestamps and the birthtime deep in the VFS stat calls. At this moment it is triggered by a request to support the birthtime field for GPFS. GPFS does not extend the system level struct stat, but instead has a separate call that gets us the additional information beyond posix. Without being able to do that within the VFS stat calls, that support would have to be scattered around the main smbd code. It will very likely break all the onefs modules, but I think the changes will be reasonably easy to do.
2009-05-24TALLOC_FREE happily lives with a NULL ptr. Tim, please check!Volker Lendecke1-6/+2
Thanks, Volker
2009-05-20s3: Change unix_convert (and its callers) to use struct smb_filenameTim Prouty1-36/+54
This is the first of a series of patches that change path based operations to operate on a struct smb_filename instead of a char *. This same concept already exists in source4. My goals for this series of patches are to eventually: 1) Solve the stream vs. posix filename that contains a colon ambiguity that currently exists. 2) Make unix_convert the only function that parses the stream name. 3) Clean up the unix_convert API. 4) Change all path based vfs operation to take a struct smb_filename. 5) Make is_ntfs_stream_name() a constant operation that can simply check the state of struct smb_filename rather than re-parse the filename. 6) Eliminate the need for split_ntfs_stream_name() to exist. My strategy is to start from the inside at unix_convert() and work my way out through the vfs layer, call by call. This first patch does just that, by changing unix_convert and all of its callers to operate on struct smb_filename. Since this is such a large change, I plan on pushing the patches in phases, where each phase keeps full compatibility and passes make test. The API of unix_convert has been simplified from: NTSTATUS unix_convert(TALLOC_CTX *ctx, connection_struct *conn, const char *orig_path, bool allow_wcard_last_component, char **pp_conv_path, char **pp_saved_last_component, SMB_STRUCT_STAT *pst) to: NTSTATUS unix_convert(TALLOC_CTX *ctx, connection_struct *conn, const char *orig_path, struct smb_filename *smb_fname, uint32_t ucf_flags) Currently the smb_filename struct looks like: struct smb_filename { char *base_name; char *stream_name; char *original_lcomp; SMB_STRUCT_STAT st; }; One key point here is the decision to break up the base_name and stream_name. I have introduced a helper function called get_full_smb_filename() that takes an smb_filename struct and allocates the full_name. I changed the callers of unix_convert() to subsequently call get_full_smb_filename() for the time being, but I plan to eventually eliminate get_full_smb_filename().
2009-03-25Ensure we never enter VFS_CREATE without having initializedJeremy Allison1-0/+4
sbuf as invalid (if not already read via stat()). Still trying to find the build farm RAW-STREAM errors and it's happening in a openX call.... Jeremy.
2009-03-23s3:smbd: use new simplified snb_signing code in the serverStefan Metzmacher1-1/+2
We keep the seqnum/mid mapping in the smb_request structure. This also moves one global variable into the smbd_server_connection struct. metze
2009-03-06s3:signing: the seqnum should only be decremented by 1 for ntcancel requestsStefan Metzmacher1-1/+1
[MS-SMB] 3.3.5.1 Receiving Any Message says that the seqnum is incremented by only for ntcancel requests for any other request it's by incremented by 2, even if it doesn't expect a response. metze
2009-02-19s3: Add extid to the dev/inode pairTim Prouty1-0/+2
This extends the file_id struct to add an additional generic uint64_t field: extid. For backwards compatibility with dev/inodes stored in xattr_tdbs and acl_tdbs, the ext id is ignored for these databases. This patch should cause no functional change on systems that don't use SMB_VFS_FILE_ID_CREATE to set the extid. Existing code that uses the smb_share_mode library will need to be updated to be compatibile with the new extid.
2009-02-09S3: New module interface for SMB message statistics gatheringtodd stecher1-1/+7
This changelist allows for the addition of custom performance monitoring modules through smb.conf. Entrypoints in the main message processing code have been added to capture the command, subop, ioctl, identity and message size statistics.
2009-01-29s3: Add a new SMB_VFS_GET_ALLOC_SIZE vfs operationTim Prouty1-2/+2
This allows module implementors to customize what allocation size is returned to the client.
2009-01-20Remove some smb fsp knowledge from rpc_server/Volker Lendecke1-1/+1
np_open/read/write don't have to know about files_struct
2009-01-11s3: Differentiate between posix files with colons and actual streamsTim Prouty1-2/+34
It is possible for a posix file created locally or over nfs to have a ":" in the name. Since ":" is a reserved character in windows, filenames containing a colon must be mangled in a directory listing. Right now files containing colons will not even be displayed in directory listings if streams modules are in use. During the directory listing the file will be detected as a stream because of the colon, but the streams module will fail to find the stream since it doesn't exist. This fix adds a step to is_ntfs_stream_name that stats the filename to differentiate between actual streams and files containing colons. While this is an improvement, it isn't perfect. Consider the case where there is a file on disk called "a.txt:s1" and also a file called "a.txt" that has a stream called "s1". This patch will always preference "a.txt:s1" over a.txt's s1 stream. The real issue is that at the vfs level, the vfs modules have no way to tell between a demangled name with a colon and an actual stream. A more invasive, but better, long-term fix would be to add all paths that come over the wire into a struct containing metadata about the path. This metadata could include a flag to indicate whether the path came over the wire with a colon ":" (guaranteeing that the client is requesting a stream). Passing this struct down to the lower levels, including all path-based vfs calls, would allow the above case to be handled correctly in all cases.
2009-01-08s3:smbd: move all globals and static variables in globals.[ch]Stefan Metzmacher1-4/+3
The goal is to move all this variables into a big context structure. metze
2009-01-05Fix call to ndr_size_dom_sid, missing parameter.Jeremy Allison1-1/+1
Jeremy.
2009-01-05Merge branch 'master' of ssh://git.samba.org/data/git/sambaJelmer Vernooij1-7/+7
2009-01-04s3: Allow renames of streams via NTRENAME and fix stream error codes on renameTim Prouty1-7/+7
The test_streams_rename2 test in RAW-STREAMS verifies these changes
2009-01-01Add iconv_convenience argument to size functions.Jelmer Vernooij1-1/+1
2008-12-31Rename parent_dirname_talloc() to parent_dirname()Volker Lendecke1-1/+1
2008-12-31Use parent_dirname_talloc instead of parent_dirname in copy_internalsVolker Lendecke1-2/+6
2008-12-03s3: Change SMB_VFS_CREATE_FILE to take a create_file_flags argumentTim Prouty1-4/+4
This replaces the is_dos_path bool with a more future-proof argument. The next step is to plumb INTERNAL_OPEN_ONLY through this flag instead of overridding the oplock_request.
2008-12-03s3: Modify direct callers of open_file_ntcreate and open_directory to call ↵Tim Prouty1-16/+38
SMB_VFS_CREATE_FILE
2008-12-03s3: Add new "is_dos_path" argument to SMB_VFS_CREATE_FILETim Prouty1-0/+2
Now unix paths can be differentiated from windows paths so the underlying create_file implementations can convert paths correctly.
2008-12-03s3: Add SMB_VFS_CREATE_FILE to the vfs layerTim Prouty1-8/+34
Modify all callers of create_file to go through SMB_VFS_CREATE_FILE
2008-11-30Set PRESENT flag when returning NULL [SD]ACL like Windows does.Steven Danneman1-1/+9
This could also be handled inside each ACL VFS module, by setting the PRESENT flag when a NULL [SD]ACL is created.