1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

128 Commits

Author SHA1 Message Date
Jeremy Allison
9b31f6ab6c Fix bug #7892 - open_file_fchmod() leaves a stale lock.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Dec 29 02:15:23 CET 2010 on sn-devel-104
2010-12-29 02:15:23 +01:00
Jeremy Allison
0a5f4f523f Keep track of the sparse status of an open file handle. Allows bypass of
strict allocation on sparse files. Files opened as POSIX opens are always
sparse.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Dec 21 04:12:22 CET 2010 on sn-devel-104
2010-12-21 04:12:22 +01:00
Jeremy Allison
e7707d5abd From metze's work on sparse attributes. FILE_ATTRIBUTE_SPARSE is valid on get but not on set.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Dec 20 20:11:22 CET 2010 on sn-devel-104
2010-12-20 20:11:22 +01:00
Jeremy Allison
16d6da8a9b Move checks inside file_set_sparse() to allow it to be called from anywhere.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Dec 17 21:56:38 CET 2010 on sn-devel-104
2010-12-17 21:56:38 +01:00
Jeremy Allison
fe50632d54 file_set_sparse needs to be a handle based call. 2010-12-17 21:11:04 +01:00
Björn Jacke
5c27dd67c8 s3:smbd: add file_set_sparse() function
this is based on a patch for 3.3 from metze
2010-12-17 21:11:04 +01:00
Björn Jacke
480042ddf9 s3: remove set_sparse_flag
we need to determine sparseness from the sparse flag we store not from the
allocation size on the POSIX filesystem. This is how Windows works - in the
first place sparseness is a file flag, not the allocation state of the file

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-12-17 21:11:04 +01:00
Björn Jacke
ebe5600615 s3: add FILE_ATTRIBUTE_SPARSE to get_stat_dos_flags 2010-12-17 21:11:04 +01:00
Volker Lendecke
126f87e6a5 s3: Fix some DEBUG msgs
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Oct 26 15:20:01 UTC 2010 on sn-devel-104
2010-10-26 15:20:01 +00:00
Jelmer Vernooij
b8268cf7b0 s3: Remove use of iconv_convenience. 2010-05-18 11:45:31 +02:00
Jeremy Allison
86bf5eac67 Add debug to make it clear when EA dosmode set is invoked.
Jeremy.
2010-02-01 19:21:35 -08:00
Jeremy Allison
f3ee1516e6 Fix bug #7084 - Create time on directories not stored properly in an EA in new create time code.
Remove erroneous optimisation that caused no EA to be set
if calculated btime matched st_ex btime, and calculated DOS
attribute matched existing file attribute.

Jeremy.
2010-02-01 18:50:43 -08:00
Jeremy Allison
1e2e92f54d Correct fix for unused variable return from ndr_decode. Use it :-).
Jeremy.
2010-01-25 17:38:55 -08:00
Jeremy Allison
2fff1e13f1 Revert "s3: remove unused Variable"
This reverts commit 9536d94d54.

Bjorn, your change removed the ndr_decoding of the dos attribute.
Not a good idea :-).

Jeremy.
2010-01-25 17:06:54 -08:00
Björn Jacke
9536d94d54 s3: remove unused Variable
Jeremy, please check!
2010-01-26 00:19:10 +01:00
Jeremy Allison
e831e3ee32 Ensure dos_mode can return FILE_ATTRIBUTE_NORMAL, then filter the returned attributes by protocol level.
This makes us consistant in returning DOS attrs across all replies. Tested on OS/2 by Günter Kukkukk.
Jeremy.
2009-12-15 18:03:47 -08:00
Volker Lendecke
5c4885a26b Revert "s3: Make the implicit reference to Protocol in is_in_path() explicit"
This reverts commit f7b4151a64.
2009-11-23 16:35:00 +01:00
Volker Lendecke
0f8e2a6ebb Revert "s3: Move the global variable Protocol to struct smbd_server_connection"
This reverts commit c85a4c9ba4.
2009-11-23 16:34:59 +01:00
Volker Lendecke
c85a4c9ba4 s3: Move the global variable Protocol to struct smbd_server_connection 2009-11-21 20:49:17 +01:00
Volker Lendecke
f7b4151a64 s3: Make the implicit reference to Protocol in is_in_path() explicit 2009-11-21 20:49:17 +01:00
Jeremy Allison
a770caed0f Remove "store create time" code, cause create time to be stored
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-17 14:55:02 -08:00
Jeremy Allison
7f9fe127ba Get closer to an accurate model of Windows timestamp changes.
"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-05 16:20:11 -08:00
Jeremy Allison
170d6a3084 Fix debug comment (brain wasn't working...).
Jeremy.
2009-11-04 16:04:41 -08:00
Jeremy Allison
f44d3754ee Filter the returned DOS attributes by 0xFF for clients
using older protocols (LANMAN2 or below).
Jeremy.
2009-11-04 15:25:15 -08:00
Jeremy Allison
c69f92d16d Second attempt at fix for bug 6529 - Offline files conflict with Vista and Office 2003.
Confirmation from reporter that this fixes the issue in master on ext3/ext4.
Back-ports to follow.
Jeremy.
2009-08-24 20:57:37 -07:00
Jeremy Allison
6a0c2946be Fix BASE-DELAYWRITE test by removing const from struct smb_filename
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-12 15:08:23 -07:00
Jeremy Allison
d6270df748 Add "store create time" parameter (docs to follow)
that stores the create time in the user.DosTimestamps EA.
Jeremy.
2009-08-12 13:00:54 -07:00
Jeremy Allison
c9dca82ed7 Refactor the use of create_time and change time to go
through functions. Will aid in making us pass RAW-SETFILEINFO.
Jeremy.
2009-08-10 15:07:53 -07:00
Jeremy Allison
fc4e21bdae Tidy up treatment of ctime.
Jeremy.
2009-07-30 14:27:32 -07:00
Tim Prouty
5a8d70d465 s3: Change fsp->fsp_name to be an smb_filename struct! 2009-07-20 17:26:56 -07:00
Tim Prouty
f1fad2efe4 s3: Fix two arguments that broke when plumbing smb_filneame through dos_mode() 2009-07-09 15:56:53 -07:00
Tim Prouty
1a1d10d22f s3: Plumb smb_filename through dos_mode() and related funtions 2009-07-08 21:36:03 -07:00
Tim Prouty
69c8795b67 s3: convert unix_mode to take an smb_filename 2009-07-08 21:36:03 -07:00
Tim Prouty
0d9b204882 s3: Remove unnecessary const qualifiers 2009-07-07 18:02:53 -07:00
Tim Prouty
3cb0e521e1 s3: Plumb smb_filename through SMB_VFS_NTIMES 2009-07-06 15:38:42 -07:00
Tim Prouty
18a27a8df2 s3 sticky write time: Removed unused args and tighten up a function by making an arg const 2009-07-06 15:38:41 -07:00
Tim Prouty
99bd4fda0c s3: Plumb smb_filename around SMB_VFS_CHFLAGS
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-06 15:38:41 -07:00
Tim Prouty
6395bc55db s3: pass a valid stat into file_ntimes()
file_ntimes() calls can_write_to_file() which expects a valid stat struct
2009-06-25 18:40:32 -07:00
Tim Prouty
eb8c658fcd s3 file_access: Convert some more functions over to use smb_filneame 2009-06-25 18:25:48 -07:00
Tim Prouty
e129384d7c s3: Plumb smb_filename through SMB_VFS_STAT and SMB_VFS_LSTAT
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-24 21:15:25 -07:00
Jeremy Allison
d2da9dee68 Add some const to the stat struct in the dosmode calls.
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-18 15:07:14 -07:00
Tim Prouty
0a455c1284 s3: Fix a few more users of stat to use stat_ex 2009-05-28 15:13:53 -07:00
Volker Lendecke
d5e3d9478d Fix some nonempty blank lines 2009-05-27 11:16:45 +02:00
Volker Lendecke
49ca690b4b Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STAT
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-26 17:48:23 +02:00
Jeremy Allison
9be2e2fdce Ensure files starting with multiple dots are hidden
if "hide dot files" is set. Thanks to Barry Kelly <bkelly.ie@gmail.com>
for pointing this one out.
Jeremy.
2009-03-30 15:05:39 -07:00
todd stecher
48b0016cff Extend NTIMES to allow setting create_time
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-23 21:05:38 -08:00
Jeremy Allison
9b44fb1c93 Fix bug #6016 - Alternate Data Streams / Extended Attributes seem to conflict.
Jeremy.
2009-01-07 14:57:20 -08:00
Tim Prouty
d5d9d3dc0e s3: Make a few open utility functions non-static
This allows vfs modules that implement SMB_VFS_CREATE_FILE to access
some of the useful utility functions.
2008-12-09 14:51:47 -08:00
Tim Prouty
d38bffd412 s3: Add support for storing dos attributes as st_flags in the stat struct.
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-11-12 09:48:50 -08:00
Volker Lendecke
c530009401 Pass struct smb_request to file_free
on the way to get rid of chain_fsp
2008-10-13 19:32:38 +02:00