summaryrefslogtreecommitdiffstats
path: root/source3/smbd/trans2.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix Coverity CID 929. Potential NULL deref after code refactoring.Jeremy Allison2009-07-171-0/+5
| | | | Jeremy.
* Fix coverity CID 930. Pointer check can never be null here.Jeremy Allison2009-07-171-1/+1
| | | | Jeremy
* Fix coverity CID 931. This check is redundent as smb_fname canJeremy Allison2009-07-171-1/+1
| | | | | never be null in this function. Jeremy.
* s3:smbd: try to fix a compiler warning on i386 : left shift count >= width ↵Stefan Metzmacher2009-07-151-1/+1
| | | | | | of type metze
* s3:smbd: check quota access against sec_initial_uid() instead of 0Stefan Metzmacher2009-07-151-6/+6
| | | | | | And return an NTSTATUS mapped from errno. Instead of hardcoded values. metze
* Fix set_posix_lock check which had been reversed in the recentJeremy Allison2009-07-131-1/+1
| | | | | changes. Jeremy.
* s3:smbd: make smbd_do_qfsinfo() non static for use in SMB2 GetInfoStefan Metzmacher2009-07-131-8/+8
| | | | metze
* s3:smbd: split out smbd_do_qfsinfo() from call_trans2qfsinfo()Stefan Metzmacher2009-07-131-79/+93
| | | | metze
* s3:smbd: make smbd_do_setfilepathinfo() non static for use in SMB2 SetInfoStefan Metzmacher2009-07-131-8/+8
| | | | metze
* s3:smbd: split out smbd_do_setfilepathinfo() from call_trans2setfilepathinfo()Stefan Metzmacher2009-07-131-188/+216
| | | | metze
* s3:smbd: add support for marshalling SMB2 FileFullEaInformationStefan Metzmacher2009-07-121-0/+92
| | | | metze
* s3:smbd: add support for marshalling SMB2 FileAllInformationStefan Metzmacher2009-07-121-0/+36
| | | | metze
* s3:smbd: filter out SMB2 specific private query info levels for SMB1Stefan Metzmacher2009-07-121-0/+9
| | | | metze
* s3:smbd: make smbd_do_qfilepathinfo() non static for use in SMB2Stefan Metzmacher2009-07-121-15/+15
| | | | metze
* s3:smbd: split calculation and mashalling of file index and access_maskStefan Metzmacher2009-07-121-13/+19
| | | | metze
* s3:smbd: split out smbd_do_qfilepathinfo() from call_trans2qfilepathinfo()Stefan Metzmacher2009-07-121-459/+504
| | | | | | This prepares SMB2 GetInfo. metze
* s3:smbd: add missing return after reply_nterror()Stefan Metzmacher2009-07-121-0/+1
| | | | metze
* Remove reply_unixerror() - no longer needed. Should make Metze's refactoring ↵Jeremy Allison2009-07-101-19/+18
| | | | | | a lot easier. Jeremy.
* s3 plumb smb_filename through smb_set_file_allocation_info()Tim Prouty2009-07-081-23/+12
|
* s3: Remove is_ntfs_stream_name() and split_ntfs_stream_name()Tim Prouty2009-07-081-1/+2
| | | | | 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.
* s3: Plumb smb_filename through dos_mode() and related funtionsTim Prouty2009-07-081-56/+64
|
* Rename update_stat_ex_writetime() -> update_stat_ex_mtime()Jeremy Allison2009-07-081-2/+2
| | | | | to better describe what we're doing here. Jeremy
* The migration to struct stat_ex broke the calculation ofJeremy Allison2009-07-081-10/+11
| | | | | | | | | | | | | | | | 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
* s3: Plumb smb_filename through SMB_VFS_NTIMESTim Prouty2009-07-061-71/+65
|
* s3 sticky write time: Removed unused args and tighten up a function by ↵Tim Prouty2009-07-061-3/+2
| | | | making an arg const
* s3: Plumb smb_filename around SMB_VFS_CHFLAGSTim Prouty2009-07-061-3/+14
| | | | | | | | | | | 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.
* s3: Change some filename_convert to pass in NULL for char **fname argumentTim Prouty2009-07-061-2/+2
|
* s3: Plumb smb_filename through SMB_VFS_UNLINKTim Prouty2009-07-061-78/+105
|
* s3: Plumb smb_filename through SMB_VFS_RENAMETim Prouty2009-07-061-10/+38
|
* 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