summaryrefslogtreecommitdiffstats
path: root/source/smbd/dosmode.c
Commit message (Collapse)AuthorAgeFilesLines
* Write times code update.Jeremy Allison2008-09-051-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.
* smbd: implement the strange write time update logicStefan Metzmacher2008-04-071-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
* Make operator precedence very clear.Jeremy Allison2008-02-061-1/+1
| | | | Jeremy.
* Allow actual call to set file offlineAlexander Bokovoy2008-02-061-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.
* Rework of VFS is_offline() function to only return boolean offline/online ↵Alexander Bokovoy2008-01-171-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.
* Add support for offline files support, remote storage, and Async I/O force ↵Alexander Bokovoy2008-01-161-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>
* Remove redundant parameter fd from SMB_VFS_FCHMOD().Michael Adam2008-01-071-1/+1
| | | | Michael
* Fix setting the initial permission bitsVolker Lendecke2007-12-281-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...
* Note when we're setting change time, not write time, and sendJeremy Allison2007-10-311-5/+6
| | | | | | message accordingly. Apart from not supporting create time we now pass the S4 RAW-NOTIFY torture. Jeremy.
* Fix some cases where file_set_dosmode was being passedJeremy Allison2007-10-311-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.
* RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison2007-10-181-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.
* r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell2007-10-101-2/+1
|
* r23779: Change from v2 or later to v3 or later.Jeremy Allison2007-10-101-1/+1
| | | | Jeremy.
* r21714: Change the VFS interface to use struct timespecJeremy Allison2007-10-101-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.
* r21087: Make the param list of notify_fname match notify_triggerVolker Lendecke2007-10-101-6/+6
|
* r20854: Ok, now I think we're at a point where looking at notify starts to ↵Volker Lendecke2007-10-101-1/+9
| | | | | | | | make sense again :-) Volker
* r20718: Sync up the filename path parsing changes from SAMBA_3_0_24.Jeremy Allison2007-10-101-8/+0
| | | | | | | The only difference between the two trees now w.r.t file serving are the changes to smbd/open.c in this branch I need to review. Jeremy.
* r20634: A *LOT* more work is necessary before touching notify remotely ↵Volker Lendecke2007-10-101-9/+1
| | | | | | | | | starts to make sense. Until then, remove it from the tree to keep the diff between 3_0_24 and 3_0 small. Volker
* r20597: Survive some of the notify mask tests.Volker Lendecke2007-10-101-1/+9
|
* r20356: Consolidate the calls to parent_dirname() per open to one.Volker Lendecke2007-10-101-11/+16
| | | | | | | This involved passing the dirname as argument to a few routines instead of calling parent_dirname() deep down. Volker
* r16945: Sync trunk -> 3.0 for 3.0.24 code. Still needJeremy Allison2007-10-101-4/+3
| | | | | | | to do the upper layer directories but this is what everyone is waiting for.... Jeremy.
* r16789: Fix bug #3909, when using ea's getting a directory tries toJeremy Allison2007-10-101-0/+51
| | | | | | read ea's from an msdfs link. Stop it from doing that. Jerry please merge to 3.0.23. Jeremy.
* r14989: Fix from Mathias Dietz <MDIETZ@de.ibm.com>. EPERM can beJeremy Allison2007-10-101-1/+1
| | | | | | a valid return from getting an xattr. Don't disable if we get it. Jeremy.
* r14668: Set the FILE_STATUS_OFFLINE bit by observing the events a DMAPI-basedJames Peach2007-10-101-0/+30
| | | | HSM is interested in. Tested on both IRIX and SLES9.
* r11943: Don't reset attrs to zero in EA get - we are addingJeremy Allison2007-10-101-1/+2
| | | | | to the attr list not resetting it. Jeremy.
* r11767: Doesn't need to be exported.Jeremy Allison2007-10-101-1/+1
| | | | Jeremy.
* r11718: Filter stored DOS attributes by SAMBA_ATTRIBUTES_MASK (0x7f).Jeremy Allison2007-10-101-0/+4
| | | | Jeremy.
* r10979: After discussions on IRC about profile shares,Jeremy Allison2007-10-101-4/+9
| | | | | | | | | | | added new parameter : map readonly = [yes|no|permissions] If yes: map inverse of user "w" bit to mean readonly. If no: never set DOS readonly bit. If permissions: check file permissions for user and set readonly bit if the current user cannot write. If store dos attributes is set to yes then this parameter is ignored. Jeremy.
* r10888: We've already checked 'CAN_WRITE' so we don't need to do it again.Jeremy Allison2007-10-101-1/+1
| | | | Jeremy.
* r10885: Fix bug where read-only share files are always seen asJeremy Allison2007-10-101-1/+1
| | | | | read-only. Noticed by Andrew Bartlett. Jeremy
* r10359: Ensure that smb.conf requests for hidden files are honored, evenJeremy Allison2007-10-101-12/+13
| | | | | when DOS attributes are stored in EA's. Jeremy.
* r10276: Fix for bug #3104 from Leo Weppelman <leo@wau.mis.ah.nl>.Jeremy Allison2007-10-101-0/+11
| | | | | | | | Don't update the time on read-only shares. We need this as set_filetime (which can be called on close and other paths) can end up calling this function without the NEED_WRITE protection. Jeremy.
* r8219: Merge the new open code from HEAD to 3.0. Haven't yet run the tortureJeremy Allison2007-10-101-1/+1
| | | | | | | | | tests on this as it's very late NY time (just wanted to get this work into the tree). I'll test this over the weekend.... Jerry - in looking at the difference between the two trees there seem to be some printing/ntprinting.c and registry changes we might want to examine to try keep in sync. Jeremy.
* r7452: Set sparse flag if needed. Based on code from jpeach@sgi.com.Jeremy Allison2007-10-101-5/+12
| | | | | Fixes bug #2774. Jeremy.
* r6895: Add "acl check permissions" to turn on/off the new behaviour ofJeremy Allison2007-10-101-5/+12
| | | | | | | | checking for write access in a directory before delete. Also controls checking for write access before labeling a file read-only if DOS attributes are not being stored in EA's. Docuementation to follow. Jeremy.
* r6049: Ensure "dos filetime" checks file ACLs correctly. May fix Excel ↵Jeremy Allison2007-10-101-18/+7
| | | | | | | "read-only" issue. Jeremy.
* r4007: Fix bug #2088 - ensure inherit permissions is only applied on a new file,Jeremy Allison2007-10-101-6/+6
| | | | | not an existing one. Jeremy.
* r3673: Do not fail on setting file attributes with acl support enabled.Günther Deschner2007-10-101-3/+1
| | | | | | Rolling back r3496 (close #2015). Guenther
* r3496: Fix calling of get_acl_group_bits().Günther Deschner2007-10-101-1/+3
| | | | Guenther
* r2700: Fix bug where we could incorrectly set sparse attribute. Don't useJeremy Allison2007-10-101-2/+2
| | | | | | | | st_blksize, it isn't what you think.... Jeremy. --his line, and those below, will be ignored-- M source/smbd/dosmode.c
* r971: Auto remove store dos attributes if underlying filesystemJeremy Allison2007-10-101-0/+13
| | | | | doesn't support EA's. Jeremy.
* Added per-share parameter "store dos attributes". When set, will storeJeremy Allison2004-04-021-7/+122
| | | | | | dos attributes in an EA. Based on an original patch from tridge, but modified somewhat to cover all cases. Jeremy.
* Reformat in preparation for EA dosmode attributes.Jeremy Allison2004-03-311-123/+125
| | | | Jeremy
* Fix for #1064 - ensure truncate attribute checking is done correctly on ↵Jeremy Allison2004-03-191-4/+26
| | | | | | "hidden" dot files. Jeremy.
* Patch from Jim McDonough for bug #802. Retrieve the correct ACL group bitsJeremy Allison2003-11-251-0/+3
| | | | | if the file has an ACL. Jeremy.
* Enclose usage of st_blksize and st_blocks struct stat members inTim Potter2003-10-141-0/+2
| | | | | | | #ifdef HAVE_STAT_ST_BLKSIZE and #ifdef HAVE_STAT_ST_BLOCKS, respectively. Fixes bug 550 reported by Joachim Schmitz <schmitz@hp.com>.
* Prefix VFS API macros with SMB_ for consistency and to avoid problems with ↵Alexander Bokovoy2003-05-141-7/+7
| | | | VFS_ macros at system side. We currently have one clash with AIX and its VFS_LOCK. Compiled and tested -- no new functionality or code, just plain rename of macros for yet-unreleased VFS API version. Needs to be done before a24 is out
* Fix VFS layer:Alexander Bokovoy2003-05-111-7/+7
| | | | | | | | | 1. Finally work with cascaded modules with private data storage per module 2. Convert VFS API to macro calls to simplify cascading 3. Add quota support to VFS layer (prepare to NT quota support) Patch by Stefan (metze) Metzemacher, with review of Jelmer and me Tested in past few weeks. Documentation to new VFS API for third-party developers to follow
* Merge doxygen, signed/unsigned, const and other small fixes from HEAD to 3.0.Andrew Bartlett2003-02-241-1/+1
| | | | Andrew Bartlett
* Sync 3.0 branch with headJelmer Vernooij2002-08-171-45/+47
|