summaryrefslogtreecommitdiff
path: root/source3/smbd/reply.c
AgeCommit message (Collapse)AuthorFilesLines
2009-07-08s3: Plumb smb_filename through dos_mode() and related funtionsTim Prouty1-28/+37
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/+28
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-07s3:smbd: cancel all locks that are made before the first failureStefan Metzmacher1-6/+6
s3:smbd: cancel all locks that are made before the first failure We never reached the cleanup code and directly returned the error. metze
2009-07-06s3: Plumb smb_filename through SMB_VFS_NTIMESTim Prouty1-27/+29
2009-07-06s3: Plumb smb_filename around SMB_VFS_CHFLAGSTim Prouty1-1/+1
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-5/+6
2009-07-06s3: Plumb smb_filename through SMB_VFS_UNLINKTim Prouty1-45/+82
2009-07-06s3: Plumb smb_filename through SMB_VFS_RENAMETim Prouty1-104/+210
2009-07-01s3:smbd: remove unused variables passed to parent_dirname()Stefan Metzmacher1-3/+2
metze
2009-06-24s3: Plumb smb_filename through SMB_VFS_STAT and SMB_VFS_LSTATTim Prouty1-75/+58
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.
2009-06-18Add some const to the stat struct in the dosmode calls.Jeremy Allison1-18/+18
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-133/+35
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-16Fix msdfs after the change to smb_filename struct. We must *always*Jeremy Allison1-16/+63
pull the pathname, then call resolve_dfspath(), before unix_convert(). Jeremy.
2009-06-12s3: Plumb smb_filename through SMB_VFS_CREATE_FILETim Prouty1-92/+57
2009-06-11s3: Prepare the rename path for passing smb_filename to SMB_VFS_CREATE_FILETim Prouty1-106/+133
2009-06-11s3: Prepare the do_unlink path for passing smb_filname to SMB_VFS_CREATE_FILETim Prouty1-72/+77
2009-06-11s3: refactor utility function to handle splitting the directory from the maskTim Prouty1-11/+35
2009-06-10s3: Prepare the first set of SMB_VFS_CREATE_FILE callers to take an ↵Tim Prouty1-130/+192
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
2009-06-10s3: Make all callers of SMB_VFS_CREATEFILE call unix_convert firstTim Prouty1-60/+82
This step is a requirement to change SMB_VFS_CREATEFILE to take an smb_filename struct.
2009-06-04s3:smbd: fix potential fsp leak if print_fsp_open() failsStefan Metzmacher1-0/+1
metze
2009-06-03s3:smbd: move tcon specific globals to struct smbd_server_connectionStefan Metzmacher1-3/+5
metze
2009-06-03s3:smbd: move more session specific globals to struct smbd_server_connectionStefan Metzmacher1-5/+7
metze
2009-06-03s3:smbd: move some session specific globals to struct smbd_server_connectionStefan Metzmacher1-0/+1
metze
2009-06-03s3:smbd: move already_got_session to struct smbd_server_connectionStefan Metzmacher1-2/+2
metze
2009-06-03s3:smbd: move max_recv to struct smbd_server_connectionStefan Metzmacher1-7/+12
metze
2009-06-03s3:smbd: move negprot related globals to struct smbd_server_connectionStefan Metzmacher1-1/+2
metze
2009-05-26Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STATVolker Lendecke1-33/+34
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-26s3:smbd: move SMB1 specific stuff into a substructure of smbd_server_connectionStefan Metzmacher1-2/+2
metze
2009-05-24TALLOC_FREE happily lives with a NULL ptr. Tim, please check!Volker Lendecke1-33/+11
Thanks, Volker
2009-05-20s3: Change unix_convert (and its callers) to use struct smb_filenameTim Prouty1-215/+273
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-05-18s3 sendfile: Fix two bugs in sendfileTim Prouty1-3/+4
These were found interally via code inspection. 1) fake_sendfile was incorrectly writing zeros over real data on a short read. 2) sendfile_short_send was doing 4 byte writes instead of 1024 byte writes due to an incorrect sizeof usage. Jermey, Vl please check
2009-05-14Remove one use of mangle_is_8_3(), not needed.Jeremy Allison1-4/+2
Jeremy.
2009-05-14Fix a type-punned warningVolker Lendecke1-1/+1
2009-05-12s3: Fix strict locking with chained readsTim Prouty1-22/+24
Move the strict lock/unlock code down a level for reads to avoid calling chain_reply before the unlock.
2009-05-11Fix warning about unused label with no sendfile.Jeremy Allison1-1/+2
Jeremy.
2009-05-05Fix bug 6302: Give the VFS a chance to read from 0-byte filesVolker Lendecke1-8/+9
2009-04-20Remove smb_mkstemp() - libreplace will now provide a secure mkstemp() ifJelmer Vernooij1-2/+2
the system one is broken.
2009-04-12Add "netbios retarget"Volker Lendecke1-0/+93
This is fun -- XP still does this :-) netbios retarget : foo = 192.168.234.10:1139 and if you connect to port 139 name foo, XP will happily do SMB over 1139
2009-04-12Extract and print the server name type the client connects toVolker Lendecke1-7/+7
2009-03-27s3: ifdef sendfile code that's only used in other ifdef'ed sendfile codeBjörn Jacke1-0/+2
This fixes a "defined but not used" compile warning.
2009-03-25Ensure we never enter VFS_CREATE without having initializedJeremy Allison1-0/+6
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-9/+15
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-18Fix bug #6196 - Unable to serve files with colons to Linux CIFS/VFS clientJeremy Allison1-2/+7
Looks like the pathname parsing for POSIX paths got broken when the code for doing Windows streams parsing got added. Jeremy.
2009-03-13s3: Add strict lock/unlock calls to the vfs layer to replace is_lockedDave Richards1-63/+116
2009-02-26Make us pass the RAW-RENAME torture test I just added.Jeremy Allison1-0/+10
Inside a directory, keep a file open and then renaming the directory should fail with ACCESS_DENIED. Jeremy.
2009-02-25Fix some NetBSD warnings.Jeremy Allison1-1/+1
Jeremy.
2009-02-21s3: If sendfile returns 0 bytes read, fall back to the normal read pathTim Prouty1-0/+24
This allows sendfile implementations that are atomic to avoid having to send zeros or kill the client connection on a short read (usually the file was truncated).
2009-02-19S3: Make changes to perfcount API set for when a single request leads to ↵todd stecher1-2/+15
multiple replies (e.g. reply_echo). Change test and onefs modules to match new api set (thanks Volker!).
2009-02-13s3: Fix uninitialized variable warning (and bug).Zack Kirsch1-1/+1