summaryrefslogtreecommitdiff
path: root/source3/smbd/vfs.c
AgeCommit message (Collapse)AuthorFilesLines
2010-03-05Fix for bug #7189 - Open txt files with notepad on samba shares creates problem.Jeremy Allison1-1/+3
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.
2010-02-11Remove lp_safe_widelinks() -> convert to just lp_widelinks. Suggestion from ↵Jeremy Allison1-1/+1
Volker. Create widelinks_warning(int snum) to cover the message needed in make_connection. Jeremy.
2010-02-11Introduce lp_safe_widelinks()Simo Sorce1-1/+1
This way we avoid any chance that a configuration reload may turn back on wide links when unix extensions are enabled.
2010-02-05Fix bug 7104 - "wide links" and "unix extensions" are incompatible.Jeremy Allison1-1/+1
Change parameter "wide links" to default to "no". Ensure "wide links = no" if "unix extensions = yes" on a share. Fix man pages to refect this. Remove "within share" checks for a UNIX symlink set - even if widelinks = no. The server will not follow that link anyway. Correct DEBUG message in check_reduced_name() to add missing "\n" so it's really clear when a path is being denied as it's outside the enclosing share path. Jeremy.
2010-01-12Remove the global char *LastDir.Jeremy Allison1-20/+1
This is no longer used for anything.
2009-11-24Allow us to pass RAW-CHKPATH with FILE_FLAG_POSIX_SEMANTICS set or withJeremy Allison1-3/+11
wide links = no. Jeremy.
2009-11-18s3: Do not talloc in readdirVolker Lendecke1-18/+24
This is a hot codepath (called from the stat cache)
2009-11-12s3: Fix debug messages in check_reduced_nameVolker Lendecke1-13/+24
2009-10-06s3: Add access_mask to the flock VFS callAbhidnya P Chirmule1-2/+4
2009-10-02Remove lots of duplicate code and move it into oneJeremy Allison1-0/+25
function vfs_stat_fsp(). Stops code looking at fsp->posix_open except for exceptional circumstances. Jeremy.
2009-10-02Fix more use of VFS_STAT when posix pathnames selected.Jeremy Allison1-1/+6
Jeremy.
2009-09-24vfs catia: Fix the double translation that was happening with createfile and ↵Aravind Srinivasan1-3/+5
open. Since the catia translation is implemented for open, it should not also be done in createfile. By removing createfile from catia, translation is now done correctly for the primary open path. In order to support systems that have custom createfile implementations that don't eventually call SMB_VFS_OPEN, SMB_VFS_TRANSLATE_NAME has been expanded to take an additional argument that specifies direction. Signed-off-by: Tim Prouty <tprouty@samba.org>
2009-08-28s3: Add a new VFS op called SMB_VFS_TRANSLATE_NAMEAravind Srinivasan1-2/+19
This vop is designed to work in tandem with SMB_VFS_READDIR to allow vfs modules to make modifications to arbitrary filenames before they're consumed by callers. Subsequently the core directory enumeration code in smbd is now changed to free the memory that may be allocated in a module. This vop enables the new version of catia in the following patch. Signed-off-by: Tim Prouty <tprouty@samba.org>
2009-08-24Second attempt at fix for bug 6529 - Offline files conflict with Vista and ↵Jeremy Allison1-2/+3
Office 2003. Confirmation from reporter that this fixes the issue in master on ext3/ext4. Back-ports to follow. Jeremy.
2009-07-25First patch for "new VFS" portabilityVolker Lendecke1-5/+5
2009-07-24add my copyright after the VFS rewriteVolker Lendecke1-0/+1
2009-07-24Make the smbd VFS typesafeVolker Lendecke1-32/+838
2009-07-24Fix some nonempty blank linesVolker Lendecke1-4/+4
2009-07-22s3: Convert some callers of vfs_lstat_smb_fname to SMB_VFS_LSTAT()Tim Prouty1-3/+16
2009-07-20s3: Separate out a new file: filename_utils.cTim Prouty1-0/+55
This is to ease the linking pain of everything that links LOCKING_OBJ
2009-07-20s3: Change fsp->fsp_name to be an smb_filename struct!Tim Prouty1-13/+23
2009-06-24s3: Plumb smb_filename through SMB_VFS_STAT and SMB_VFS_LSTATTim Prouty1-72/+38
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-10s3: Prepare the first set of SMB_VFS_CREATE_FILE callers to take an ↵Tim Prouty1-8/+18
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-02Add SMB_VFS_CONNECTPATH operationVolker Lendecke1-8/+22
This is required for the shadow_copy2 module and "wide links = no". The file system snapshots by nature are typically outside of share directory. So the REALPATH result fails the wide links = no test.
2009-06-02Remove a variable used just onceVolker Lendecke1-2/+3
2009-05-26Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STATVolker Lendecke1-14/+14
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-04-29s3:vfs: untangle logic for loading and probing modules in vfs_init_custom()Michael Adam1-11/+23
This is to be able to provide more specific error messages. Michael
2009-02-19s3: Change the vfs_GetWd cache to use the file_id structTim Prouty1-12/+3
2009-02-09Add an optional SMB_STRUCT_SMB parameter to VFS_OP_READDIRSteven Danneman1-2/+2
* this allows VFS implementations that prefetch stat information on readdir to return it through one VFS call * backwards compatibility is maintained by passing in NULL * if the system readdir doesn't return stat info, the stat struct is set to invalid
2009-02-09s3 oplocks: Make the level2 oplock contention API more granularTim Prouty1-8/+25
This replaces release_level2_oplocks_on_change with contend_level2_oplock_begin/end in order to contend level2 oplocks throughout an operation rather than just at the begining. This is necessary for some kernel oplock implementations, and also lays the groundwork for better correctness in Samba's standard level2 oplock handling. The next step for non-kernel oplocks is to add additional state to the share mode lock struct that prevents any new opens from granting oplocks while a contending operation is in progress. All operations that contend level 2 oplocks are now correctly spanned except for aio and synchronous writes. The two write paths both have non-trivial error paths that need extra care to get right. RAW-OPLOCK and the rest of 'make test' are still passing with this change.
2009-02-09s3 vfs: Add a destructor to the fsp extension data APITim Prouty1-1/+7
I'm not certain if the dummy pointer is needed in struct vfs_fsp_data, but I added it to be consistent with the comment below.
2009-01-08s3:smbd: move all globals and static variables in globals.[ch]Stefan Metzmacher1-4/+1
The goal is to move all this variables into a big context structure. metze
2008-10-14Use {u,}int64_t instead of SMB_BIG_{U,}INT.Jelmer Vernooij1-6/+6
2008-05-05Remove connection_struct->mem_ctx, connection_struct is its own parentVolker Lendecke1-3/+3
(This used to be commit 559180f7d30606d1999399d954ceedc798c669a4)
2008-01-11Combine fsp and tofd to tofsp in SMB_VFS_RECVFILE().Michael Adam1-2/+0
Michael (This used to be commit 3958abffaf2866c69ad9e13ec345364fde5c78bb)
2008-01-10Remove redundant parameter fd from SMB_VFS_WRITE().Michael Adam1-2/+2
Michael (This used to be commit c8ae7d095a2a6a7eac920a68ca7244e3a423e1b1)
2008-01-10Remove redundant parameter fd from SMB_VFS_READ().Michael Adam1-3/+3
Michael (This used to be commit a8fc2ddad8d5f7c6c00cb36c74a32a02d69d1d04)
2008-01-10Make casts to (void *) explicit to remove compiler warnings.Michael Adam1-1/+2
Michael (This used to be commit cbbfbd7a63fe0fc479a1b63b4552c713633dd6be)
2008-01-10Correctly abstract the transfer_file mechanism with callbacks and void ptrs.Michael Adam1-11/+9
This removes the in_fsp and out_fsp global variables hack from smbd/vfs.c. Michael (This used to be commit b2e7cdc6e899ca3c16edbb6c8786ff9aa999fa6e)
2008-01-09Make use of talloc_pool in the main codepaths. Remove the sub-contexts.Jeremy Allison1-9/+4
Jeremy. (This used to be commit bc932b8ad4396f76b71c43efe9a6346f89c3632c)
2008-01-07Remove redundant parameter fd from SMB_VFS_FTRUNCATE().Michael Adam1-2/+2
Michael (This used to be commit 2ad66050a0452b8e7e08b1e7a01efa00c72fd451)
2008-01-07Remove redundant parameter fd from SMB_VFS_FSTAT().Michael Adam1-2/+2
Michael (This used to be commit 0b86c420be94d295f6917a220b5d699f65b46711)
2008-01-07Remove redundant parameter fd from SMB_VFS_PWRITE().Michael Adam1-3/+3
Michael (This used to be commit 8c4901a19ae2fd3ee085f9499f33aa7db016d182)
2008-01-07Remove unneeded parameter fd from SMB_VFS_PREAD().Michael Adam1-1/+1
Michael (This used to be commit 73e28806ce87d829ea7c38ed3440020845bb13bf)
2007-12-29Apply some constVolker Lendecke1-4/+4
(This used to be commit 241b72141e3d9e31e30977517f871a97d74bbf7d)
2007-12-21Fix a C++ warningVolker Lendecke1-1/+1
(This used to be commit 7e1d9b561f6df233b8c7eaec83d1e4207b5a2fb0)
2007-12-19Expose per-fsp extension talloc context.James Peach1-2/+14
This patch supplements the fsp extension API with an operation to retrieve the malloc zone pointer for that fsp. (This used to be commit d5d9e4084cfb3db3bebff0334b93f376022ef5d3)
2007-12-18Add a in-memory cacheVolker Lendecke1-111/+57
This is a more general API that caches data with a LRU scheme. See include/cache.h. No comments yet, I'm still working on it. But Jeremy has given me a hint in one of his checkins that he would like to make use of this now. The idea is that we get rid of all our silly little caches and merge them all into one cache that we can then very easily trim, for example even with a smbcontrol message if someone decides memory is tight. The main user is the stat cache, this patch also converts the getwd cache. More caches to come. (This used to be commit 7a911b35713538d82001a3c9f34152e293fe1943)
2007-11-10Always define PATH_MAX. Makes code simpler (removesJeremy Allison1-12/+0
a bunch of #defines). Remove pstring from msdfs.c. Jeremy. (This used to be commit e203ba22275320808bc11b17361ad1f2d5b0b897)
2007-10-31Make explicit draining the socket on RECVFILE. AddJeremy Allison1-10/+8
capability for large UNIX write if not signing and recvfile set. Cope with large UNIX write length on incoming processing. Stevef - we can now test 1-16Mb writes from CIFFS. Jeremy. (This used to be commit 8cf78776b0a44bd026cef3d74eb11cfb415f8303)