summaryrefslogtreecommitdiffstats
path: root/source3/smbd/trans2.c
Commit message (Collapse)AuthorAgeFilesLines
* s3:smbd: push nttrans and trans2 responses with no data to the clientStefan Metzmacher2009-07-021-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
* Ensure we don't use delayed writes on POSIX opened files.Jeremy Allison2009-07-011-0/+5
| | | | | | Don't remove pending writetime changes if no time changes are sent in UNIX_BASIC infolevel. Jeremy
* Fix bug #6520 time stamps - e.g. last mod time is not preserved when "unix ↵Jeremy Allison2009-07-011-3/+31
| | | | | | | | extensions=yes" are set - and using latest cifs vfs client Cancel out any pending "sticky" writes or "last write" changes when doing a UNIX info level set. Jeremy.
* s3: pass a valid stat into file_ntimes()Tim Prouty2009-06-251-1/+1
| | | | file_ntimes() calls can_write_to_file() which expects a valid stat struct
* s3: Change set_ea() and its callers to use smb_filenameTim Prouty2009-06-251-5/+15
|
* s3: Plumb smb_filename through SMB_VFS_STAT and SMB_VFS_LSTATTim Prouty2009-06-241-55/+109
| | | | | | | | | | | | | This patch introduces two new temporary helper functions vfs_stat_smb_fname and vfs_lstat_smb_fname. They basically allowed me to call the new smb_filename version of stat, while avoiding plumbing it through callers that are still too inconvenient. As the conversion moves along, I will be able to remove callers of this, with the goal being to remove all callers. There was also a bug in create_synthetic_smb_fname_split (also a temporary utility function) that caused it to incorrectly handle filenames with ':'s in them when in posix mode. This is now fixed.
* Replace the boilerplate calls to :Jeremy Allison2009-06-181-109/+45
| | | | | | | | | | | | 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.
* Fix msdfs after the change to smb_filename struct. We must *always*Jeremy Allison2009-06-161-6/+23
| | | | | pull the pathname, then call resolve_dfspath(), before unix_convert(). Jeremy.
* s3: Plumb smb_filename through SMB_VFS_CREATE_FILETim Prouty2009-06-121-32/+64
|
* s3: Prepare the first set of SMB_VFS_CREATE_FILE callers to take an ↵Tim Prouty2009-06-101-17/+13
| | | | | | | | | | | | | smb_filename struct Some of the callers required minimal changes, while others (copy_internals) required significant changes. The task is simplified a little bit because we are able to do operations and checks on the base_name when a stream isn't used. This patch should cause no functional changes. Volker, Jeremy: Please check
* s3: Make all callers of SMB_VFS_CREATEFILE call unix_convert firstTim Prouty2009-06-101-23/+35
| | | | | This step is a requirement to change SMB_VFS_CREATEFILE to take an smb_filename struct.
* s3:smbd: move some session specific globals to struct smbd_server_connectionStefan Metzmacher2009-06-031-0/+2
| | | | metze
* Fix bug #6421 - POSIX read-only open fails on read-only shares.Jeremy Allison2009-05-301-5/+9
| | | | | | | | | | The change to smbd/trans2.c opens up SETFILEINFO calls to POSIX_OPEN only. The change to first smbd/open.c closes 2 holes that would have been exposed by allowing POSIX_OPENS on readonly shares, and their ability to set arbitrary flags permutations. The O_CREAT -> O_CREAT|O_EXCL change removes an illegal combination (O_EXCL without O_CREAT) that previously was being passed down to the open syscall. Jeremy.
* Attempt to fix the build on NetBSDVolker Lendecke2009-05-261-6/+0
|
* Fix some nonempty blank linesVolker Lendecke2009-05-261-28/+27
|
* Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STATVolker Lendecke2009-05-261-52/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* TALLOC_FREE happily lives with a NULL ptr. Tim, please check!Volker Lendecke2009-05-241-9/+3
| | | | | | Thanks, Volker
* Ensure we return NT_STATUS_FILE_IS_A_DIRECTORY on a posix open on aJeremy Allison2009-05-221-1/+1
| | | | | directory name. Jeremy.
* s3: Change unix_convert (and its callers) to use struct smb_filenameTim Prouty2009-05-201-41/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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().
* s3: Always allocate memory in dptr_ReadDirNameAravind Srinivasan2009-05-181-4/+18
| | | | | | | | This is a follow up to 69d61453df6019caef4e7960fa78c6a3c51f3d2a to adjust the API to allow the lower layers allocate memory. Now the memory can explicitly be freed rather than relying on talloc_tos(). Signed-off-by: Tim Prouty <tprouty@samba.org>
* Rework Samba3 to use new libcli/auth code (partial)Andrew Bartlett2009-04-141-0/+1
| | | | | | | | | | | This commit is mostly to cope with the removal of SamOemHash (replaced by arcfour_crypt()) and other collisions (such as changed function arguments compared to Samba3). We still provide creds_hash3 until Samba3 uses the credentials code in netlogon server Andrew Bartlett
* Ensure we never enter VFS_CREATE without having initializedJeremy Allison2009-03-251-0/+2
| | | | | | | 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.
* s3:smbd: use new simplified snb_signing code in the serverStefan Metzmacher2009-03-231-2/+3
| | | | | | | | | We keep the seqnum/mid mapping in the smb_request structure. This also moves one global variable into the smbd_server_connection struct. metze
* Make test for open modes more robust against other bits.Jeremy Allison2009-02-251-1/+1
| | | | Jeremy.
* Fix bug in processing of open modes in POSIX open.Jeremy Allison2009-02-251-0/+2
| | | | | | | Was missing case of "If file exists open. If file doesn't exist error." Damn damn damn. CIFSFS client will have to have fallback cases for this error for a long time. Jeremy.
* Allow set attributes on a stream fnum to be redirected to the base filename.Jeremy Allison2009-02-241-2/+10
| | | | | Fixes the new RAW-STREAMS torture test. Jeremy.
* Add VFS ops for Windows BRL: Lock, Unlock and Cancel:Zack Kirsch2009-02-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | This patch adds 3 new VFS OPs for Windows byte range locking: BRL_LOCK_WINDOWS, BRL_UNLOCK_WINDOWS and BRL_CANCEL_WINDOWS. Specifically: * I renamed brl_lock_windows, brl_unlock_windows and brl_lock_cancel to *_default as the default implementations of the VFS ops. * The blocking_lock_record (BLR) is now passed into the brl_lock_windows and brl_cancel_windows paths. The Onefs implementation uses it - future implementations may find it useful too. * Created brl_lock_cancel to do what brl_lock/brl_unlock do: set up a lock_struct and call either the Posix or Windows lock function. These happen to be the same for the default implementation. * Added helper functions: increment_current_lock_count() and decrement_current_lock_count(). * Minor spelling correction in brl_timeout_fn: brl -> blr. * Changed blocking_lock_cancel() to return the BLR that it has cancelled. This allows us to assert its the lock that we wanted to cancel. If this assert ever fires, this path will need to take in the BLR to cancel, rather than choosing on its own. * Adds a small helper function: find_blocking_lock_record_by_id(). Used by the OneFS implementation, but could be useful for others.
* s3: Added SMB_VFS_INIT_SEARCH_OP to initialize data at the beginning of SMB ↵Steven Danneman2009-02-091-3/+9
| | | | | | | | search requests. By default this VFS call is a NOOP, but the onefs vfs module takes advantage of it to initialize direntry search caches at the beginning of each TRANS2_FIND_FIRST, TRANS2_FIND_NEXT, SMBffirst, SMBsearch, and SMBunique
* S3: New module interface for SMB message statistics gatheringtodd stecher2009-02-091-1/+4
| | | | | | | 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.
* s3: Add a new SMB_VFS_GET_ALLOC_SIZE vfs operationTim Prouty2009-01-291-39/+13
| | | | | This allows module implementors to customize what allocation size is returned to the client.
* Extend NTIMES to allow setting create_timetodd stecher2009-01-231-40/+59
| | | | | | | | | 1) Add in smb_file_time struct to clarify code and make room for createtime. 2) Get and set create time from SMB messages. 3) Fixup existing VFS modules + examples Some OS'es allow for the setting of the birthtime through kernel interfaces. This value is generically used for Windows createtime, but is not settable in the code today.
* s3: make better use of ccache by not including version.h in every C-file.Michael Adam2009-01-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | version.h changes rather frequently. Since it is included via includes.h, this means each C file will be a cache miss. This applies to the following situations: * When building a new package with a new Samba version * building in a git branch after calling mkversion.sh after a new commit (i.e. virtually always) This patch improves the situation in the following way: * remove inlude "version.h" from includes.h * Use samba_version_string() instead of SAMBA_VERSION_STRING in files that use no other macro from version.h instead of SAMBA_VERSION_STRING. * explicitly include "version.h" in those files that use more macros from "version.h" than just SAMBA_VERSION_STRING. Michael
* s3:smbd: move all globals and static variables in globals.[ch]Stefan Metzmacher2009-01-081-3/+1
| | | | | | The goal is to move all this variables into a big context structure. metze
* s3:smbd: make static const in mangle_hash2.c really static constStefan Metzmacher2009-01-081-1/+1
| | | | | | | | | | | | | const char *foo, means a non-const pointer to a const char. const char * const foo, means a const pointer to a const char. char * const foo, would mean a const pointer to a non-const char. metze
* Add iconv_convenience argument to size functions.Jelmer Vernooij2009-01-011-0/+2
|
* Rename parent_dirname_talloc() to parent_dirname()Volker Lendecke2008-12-311-2/+1
|
* Use parent_dirname_talloc instead of parent_dirname in smb_unix_mknodVolker Lendecke2008-12-311-3/+7
|
* s3: Fix stream marshalling to return the correct streaminfo statusTim Prouty2008-12-231-10/+1
| | | | | | | | | | | | | | | | When there are enough streams on a file to fill up the max_data_count when responding to a trans2 streaminfo, samba is returning NT_STATUS_BUFFER_TOO_SMALL. Windows handles this by returning NT_STATUS_BUFFER_OVERFLOW while still sending as much of the data that it can fit into the buffer. When the windows client sees BUFFER_OVERFLOW, it retries the streaminfo with a larger buffer (2x). The windows client starts at 2K and will continue increasing the buffer size by two until it reaches 64K. If the streams don't fit in 64K the windows client seems to give up. This patch fixes marshall_stream_info to overfill the buffer by 1 stream so that send_trans2_replies can properly detect the overflow and return the correct status.
* Fix bug #5986 - Editing a stream is broken (rename problems).Jeremy Allison2008-12-191-10/+11
| | | | Jeremy.
* Fix bug #5937 - filenames with "*" char hide other filesJeremy Allison2008-12-041-6/+4
| | | | Jeremy.
* s3: Change SMB_VFS_CREATE_FILE to take a create_file_flags argumentTim Prouty2008-12-031-6/+6
| | | | | | 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.
* s3: Modify direct callers of open_file_ntcreate and open_directory to call ↵Tim Prouty2008-12-031-61/+98
| | | | SMB_VFS_CREATE_FILE
* s3: Add new "is_dos_path" argument to SMB_VFS_CREATE_FILETim Prouty2008-12-031-0/+1
| | | | | Now unix paths can be differentiated from windows paths so the underlying create_file implementations can convert paths correctly.
* s3: Add SMB_VFS_CREATE_FILE to the vfs layerTim Prouty2008-12-031-16/+17
| | | | Modify all callers of create_file to go through SMB_VFS_CREATE_FILE
* s3:smbd: write times should be set on the base file instead of the stream nameStefan Metzmacher2008-12-011-1/+9
| | | | metze
* s3:smbd: return DELETE_PENDING on path based operations on streams, when the ↵Stefan Metzmacher2008-12-011-0/+40
| | | | | | main file was deleted. metze
* s3:smbd: construct the correct newname for stream renamesStefan Metzmacher2008-12-011-16/+32
| | | | | | | | The Windows Explorer creates temporary streams and renames them later via SFILEINFO_RENAME_INFO. The newname comes in as ":Stream:$DATA". metze
* Fix a debug message, append the correct \nVolker Lendecke2008-12-011-1/+1
|
* Remove inbuf references from the trans2ioctl codeVolker Lendecke2008-11-281-4/+4
|
* Consolidate the buffer checks for the reply_trans style functionsVolker Lendecke2008-11-281-57/+18
| | | | | | | | This is the one where I found the problem that led to 3.2.5. So if there is one checkin in the last year that I would like others to review and *understand*, it is this one :-) Volker