summaryrefslogtreecommitdiff
path: root/source3/smbd/dosmode.c
AgeCommit message (Collapse)AuthorFilesLines
2009-11-23Revert "s3: Make the implicit reference to Protocol in is_in_path() explicit"Volker Lendecke1-4/+2
This reverts commit f7b4151a64d8c6851e62255a7139fd00a5fc63a3.
2009-11-23Revert "s3: Move the global variable Protocol to struct smbd_server_connection"Volker Lendecke1-6/+4
This reverts commit c85a4c9ba4a7de65a7850f6f9708df66bd24deea.
2009-11-21s3: Move the global variable Protocol to struct smbd_server_connectionVolker Lendecke1-4/+6
2009-11-21s3: Make the implicit reference to Protocol in is_in_path() explicitVolker Lendecke1-2/+4
2009-11-17Remove "store create time" code, cause create time to be storedJeremy Allison1-99/+145
in the "user.DOSATTRIB" EA. From the docs: In Samba 3.5.0 and above the "user.DOSATTRIB" extended attribute has been extended to store the create time for a file as well as the DOS attributes. This is done in a backwards compatible way so files created by Samba 3.5.0 and above can still have the DOS attribute read from this extended attribute by earlier versions of Samba, but they will not be able to read the create time stored there. Storing the create time separately from the normal filesystem meta-data allows Samba to faithfully reproduce NTFS semantics on top of a POSIX filesystem. Passes make test but will need more testing. Jeremy.
2009-11-05Get closer to an accurate model of Windows timestamp changes.Jeremy Allison1-16/+0
"Normal" non truncate writes always cause the timestamp to be set on close. Once a close is done on a handle this can reset the sticky write time to current time also. Updated smbtorture4 confirms this. Jeremy.
2009-11-04Fix debug comment (brain wasn't working...).Jeremy Allison1-2/+2
Jeremy.
2009-11-04Filter the returned DOS attributes by 0xFF for clientsJeremy Allison1-0/+12
using older protocols (LANMAN2 or below). Jeremy.
2009-08-24Second attempt at fix for bug 6529 - Offline files conflict with Vista and ↵Jeremy Allison1-1/+1
Office 2003. Confirmation from reporter that this fixes the issue in master on ext3/ext4. Back-ports to follow. Jeremy.
2009-08-12Fix BASE-DELAYWRITE test by removing const from struct smb_filenameJeremy Allison1-0/+2
in smbd_do_qfilepathinfo(). update_stat_ex_mtime() modifies the stat struct inside the smb_fname so don't make a copy of that stat struct, use it directly - it's meant to be updated and represent the state of the file we're returning. Jeremy.
2009-08-12Add "store create time" parameter (docs to follow)Jeremy Allison1-4/+87
that stores the create time in the user.DosTimestamps EA. Jeremy.
2009-08-10Refactor the use of create_time and change time to goJeremy Allison1-0/+20
through functions. Will aid in making us pass RAW-SETFILEINFO. Jeremy.
2009-07-30Tidy up treatment of ctime.Jeremy Allison1-0/+2
Jeremy.
2009-07-20s3: Change fsp->fsp_name to be an smb_filename struct!Tim Prouty1-1/+1
2009-07-09s3: Fix two arguments that broke when plumbing smb_filneame through dos_mode()Tim Prouty1-2/+2
2009-07-08s3: Plumb smb_filename through dos_mode() and related funtionsTim Prouty1-84/+93
2009-07-08s3: convert unix_mode to take an smb_filenameTim Prouty1-11/+29
2009-07-07s3: Remove unnecessary const qualifiersTim Prouty1-3/+2
2009-07-06s3: Plumb smb_filename through SMB_VFS_NTIMESTim Prouty1-14/+4
2009-07-06s3 sticky write time: Removed unused args and tighten up a function by ↵Tim Prouty1-4/+3
making an arg const
2009-07-06s3: Plumb smb_filename around SMB_VFS_CHFLAGSTim Prouty1-44/+49
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-06-25s3: pass a valid stat into file_ntimes()Tim Prouty1-2/+2
file_ntimes() calls can_write_to_file() which expects a valid stat struct
2009-06-25s3 file_access: Convert some more functions over to use smb_filneameTim Prouty1-6/+22
2009-06-24s3: Plumb smb_filename through SMB_VFS_STAT and SMB_VFS_LSTATTim Prouty1-2/+2
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-13/+15
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-05-28s3: Fix a few more users of stat to use stat_exTim Prouty1-10/+10
2009-05-27Fix some nonempty blank linesVolker Lendecke1-14/+13
2009-05-26Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STATVolker Lendecke1-21/+21
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-03-30Ensure files starting with multiple dots are hiddenJeremy Allison1-4/+8
if "hide dot files" is set. Thanks to Barry Kelly <bkelly.ie@gmail.com> for pointing this one out. Jeremy.
2009-01-23Extend NTIMES to allow setting create_timetodd stecher1-5/+8
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.
2009-01-07Fix bug #6016 - Alternate Data Streams / Extended Attributes seem to conflict.Jeremy Allison1-3/+8
Jeremy.
2008-12-09s3: Make a few open utility functions non-staticTim Prouty1-1/+1
This allows vfs modules that implement SMB_VFS_CREATE_FILE to access some of the useful utility functions.
2008-11-12s3: Add support for storing dos attributes as st_flags in the stat struct.Tim Prouty1-13/+147
Some filesystems have support for storing dos attributes directly in the inode's st_flags and accessing them through the stat struct. This patch: - Adds a configure check to see if the special flags are available. - Implements getting and setting dos attributes in the stat struct and inode, respectively. This will not change the existing functionality of any system that doesn't have the special flags available.
2008-10-13Pass struct smb_request to file_freeVolker Lendecke1-2/+2
on the way to get rid of chain_fsp
2008-10-13Pass struct smb_request to file_newVolker Lendecke1-2/+4
Goal is to remove the chain_fsp global variable
2008-09-05Write times code update.Jeremy Allison1-20/+32
Ok, here's the fix for the write times breakage with the new tests in S4 smbtorture. The key is keeping in the share mode struct the "old_file_time" as the real write time, set by all the write and allocation calls, and the "changed_write_time" as the "sticky" write time - set by the SET_FILE_TIME calls. We can set them independently (although I kept the optimization of not setting the "old_file_time" is a "changed_write_time" was already set, as we'll never see it. This allows us to update the write time immediately on the SMBwrite truncate case, SET_END_OF_FILE and SET_ALLOCATION_SIZE calls, whilst still have the 2 second delay on the "normal" SMBwrite, SMBwriteX calls. I think in a subsequent patch I'd like to change the name of these from "old_file_time" to "write_time" and "changed_write_time" to "sticky_write_time" to make this clearer. I think I also fixed a bug in Metze's original code in that once a write timestamp had been set from a "normal" SMBwriteX call the fsp->update_write_time_triggered variable was set and then never reset - thus meaning the write timestamp would never get updated again on subsequent SMBwriteX's. The new code checks the update_write_time_event event instead, and doesn't update is there's an event already scheduled. Metze especially, please check this over for your understanding. Jeremy. (This used to be commit 6f20585419046c4aca1f7d6c863cf79eb6ae53b0)
2008-04-07smbd: implement the strange write time update logicStefan Metzmacher1-14/+28
We now never call file_ntimes() directly, every update is done via smb_set_file_time(). This let samba3 pass the BASE-DELAYWRITE test. The write time is only updated 2 seconds after the first write() on any open handle to the current time (not the time of the first write). Each handle which had write requests updates the write time to the current time on close(). If the write time is set explicit via setfileinfo or setpathinfo the write time is visible directly and a following close on the same handle doesn't update the write time. metze (This used to be commit 2eab212ea2e1bfd8fa716c2c89b2c042f7ba12ea)
2008-02-06Make operator precedence very clear.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 4f125110cfe25b499eb628b5b08fdb610a5d972c)
2008-02-06Allow actual call to set file offlineAlexander Bokovoy1-12/+20
Dos mode calculation was masking out FILE_ATTRIBUTE_OFFLINE so that code to set file offline was never called before. Merge from Tridge's v3-0-ctdb git tree. (This used to be commit 9827d5ff416479408b19a8964c2321ea2517aa74)
2008-01-17Rework of VFS is_offline() function to only return boolean offline/online ↵Alexander Bokovoy1-3/+2
result for a file. This makes sense as upper levels are only taking returned result of 0 (no error) into consideration when deciding whether to mark file offline/online as returned from is_offline. That means that we simply can move the decision down to VFS module and clean up upper levels so that they always see only file status. If there is an error when trying to identify file status, then VFS module could decide what to return (offline or online) by itself -- after all, it ought to have system-specific knowledge anyway. (This used to be commit 75cc08661473cce62756fa062071bb2bc1fb39ec)
2008-01-16Add support for offline files support, remote storage, and Async I/O force ↵Alexander Bokovoy1-23/+21
operations to VFS Offline files support and remote storage are for allowing communication with backup and archiving tools that mark files moved to a tape library as offline. We translate this info into corresponding CIFS offline file attribute and mark an exported volume as remote storage. Async I/O force is to allow selective redirection of I/O operations to asynchronous processing in case it is viable at VFS module discretion. It is needed for proper handling of offline files as performing regular I/O on offline file will block smbd. Signed-off-by: Alexander Bokovoy <ab@samba.org>(This used to be commit 875208724e39564fe81385dfe36e6c963e79e101)
2008-01-07Remove redundant parameter fd from SMB_VFS_FCHMOD().Michael Adam1-1/+1
Michael (This used to be commit a54d5604da556d1250ca9948d4acc4a187a9fede)
2007-12-28Fix setting the initial permission bitsVolker Lendecke1-2/+16
This fixes a make test failure on Solaris. When creating a new file, file_set_dosmode() called from open_file_ntcreate calculates a new permission mask, very likely different from what had been calculated in open_file_ntcreate. Further down we overwrote the newly calculated value with SMB_FCHMOD_ACL, ignoring what file_set_dosmode had calculated. Why did Linux not see this? fchmod_acl on a newly created file without acls would not retrieve an acl at all, whereas under Solaris acl(2) returns something even for files with just posix permissions returns something. Jeremy, given that we have very similar code in 3.0.28 this might also explain some of the bug reports that people have concerning ACLs on new files. Volker P.S: This one took a while to find... (This used to be commit 2135dfe91bf1ae114a18c15286b535662200677d)
2007-10-31Note when we're setting change time, not write time, and sendJeremy Allison1-5/+6
message accordingly. Apart from not supporting create time we now pass the S4 RAW-NOTIFY torture. Jeremy. (This used to be commit 8a77f520fa03afa60eac2aaeab4babe7dd8db4f0)
2007-10-31Fix some cases where file_set_dosmode was being passedJeremy Allison1-5/+14
False instead of NULL. Fix more of the notifications to be correct for Samba4 RAW-NOTIFY torture (we had missed one when calling set_ea_dos_attribute(). Jeremy. (This used to be commit 39d265375cf55eedddef2c4faa65398df73d5ed2)
2007-10-18RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison1-4/+4
bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
2007-10-10r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell1-2/+1
(This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07)
2007-10-10r23779: Change from v2 or later to v3 or later.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
2007-10-10r21714: Change the VFS interface to use struct timespecJeremy Allison1-15/+21
for utimes - change the call to ntimes. This preserves nsec timestamps we get from stat (if the system supports it) and only maps back down to usec or sec resolution on time set. Looks bigger than it is as I had to move lots of internal code from using time_t and struct utimebuf to struct timespec. Jeremy. (This used to be commit 8f3d530c5a748ea90f42ed8fbe68ae92178d4875)
2007-10-10r21087: Make the param list of notify_fname match notify_triggerVolker Lendecke1-6/+6
(This used to be commit defa28f9c3eda85a072b972fffd2d5de8bcf01f7)