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

44 Commits

Author SHA1 Message Date
Jeremy Allison
c61c9c3a4c Fix for bug #7189 - Open txt files with notepad on samba shares creates problem.
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-03-05 15:13:37 -08:00
Jeremy Allison
3fe7dfd1d9 Remove smb_fname duplicates that just keep the same information as in fsp->fsp_name.
Moving towards making VFS_OPEN/VFS_MKDIR/VFS_RMDIR
handle based...
Jeremy.
2009-12-03 16:45:35 -08:00
Jeremy Allison
dfcc4115dd Remove unneeded argument from can_set_delete_on_close(). Ensure
can_set_delete_on_close() is correctly called before any setting
of the disposition bit (clean up the do_unlink() call).
Jeremy.
2009-12-02 18:06:40 -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
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
Abhidnya P Chirmule
ac774c4969 s3: Add access_mask to the flock VFS call 2009-10-06 18:52:06 +02:00
Steven Danneman
60433b154d s3 onefs: Fix 1 second share mode delay handling
When racing to the open and loosing we may get a share_mode violation.
In this case handle the 1-second delay via a defferred open properly.

This requires us to retrieve the share_mode_lock before deferring
open so we don't dereference a NULL pointer assuming we already had
the lck because we were the first opener.
2009-09-24 11:31:35 -07:00
Steven Danneman
74c0a7a1d3 s3 onefs: Fix a race condition exists in onefs_open.c between multiple opens to the same file.
Two openers can stat a file at the same time, see that it doesn't exist,
and then both race to open it first.  The loser will enter
onefs_open_file_ntcreate believing that the file doesnt exist, and thus
skip any current state lookups for that file.  This includes setting
the file_id, and having a valid stat buffer.

Normally on first create the file_id will be set during the open, but
the second opener in this scenario may fail the open (oplock/share mode)
and file_id will not be set, nor will the stat buffer be valid.

In the error paths of this patch, we now double check that the file_id
and the stat buffer are valid before doing other operations.
2009-09-24 11:31:21 -07:00
Zack Kirsch
5e9aade516 s3 onefs: Add some debugging/asserts to give more info when there is bad deferred open state.
Signed-off-by: Tim Prouty <tprouty@samba.org>
2009-09-24 11:19:00 -07:00
Tim Prouty
c9b8a01714 s3: Finish plumbing the fsp->fsp_name smb_fname conversion through the modules. 2009-07-20 17:26:57 -07:00
Tim Prouty
02aad05e0e s3: Prepare open.c to switch fsp_name to an smb_filename struct 2009-07-08 21:36:04 -07:00
Tim Prouty
3a7d372e2e s3: Change the share_mode_lock struct to store a base_name and stream_name 2009-07-08 21:36:04 -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
Stefan Metzmacher
b292af0c38 s3:onefs_open: remove unused variable passed to parent_dirname()
metze
2009-07-01 12:53:41 +02:00
Tim Prouty
2ccd501220 s3 onefs: Plumb smb_filename through onefs createfile path 2009-06-25 18:25:47 -07:00
Tim Prouty
5eac92697e s3 onefs: Remove dfs resolution from create_file() now that it's being done at a higher level 2009-06-17 20:11:53 -07:00
Tim Prouty
5cfac1a1bd s3: Plumb smb_filename from create_file all of the way down to fd_open
I used the smb_filename struct everywhere that was feasible for the
first pass.  There are still some places in this path that need to be
changed to use smb_filename, but this is a good start.

I also:
- Removed fname/path arguments from a few functions that weren't
  really using them.
- Added a utility function for detecting whether an smb_filename is a
  stream.
2009-06-17 20:11:53 -07:00
Tim Prouty
6f335036fd s3 onefs: Change onefs modules to use the new createfile api 2009-06-15 14:03:40 -07:00
Tim Prouty
2481d8dcd0 s3: Remove unix_convert handling from createfile implementations 2009-06-10 13:13:27 -07:00
Tim Prouty
5c623e6c2e s3 onefs: update the onefs module to be compliant with stat_ex 2009-05-28 15:13:53 -07:00
Tim Prouty
cfc68fc9d9 s3 onefs: Fix invalid argument from the unix_convert smb_filename struct patch 2009-05-21 12:17:33 -07:00
Tim Prouty
c1a21d085d s3: Change unix_convert (and its callers) to use struct smb_filename
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-20 17:40:15 -07:00
Aravind Srinivasan
bb454b5fd9 s3 onefs: Removing an incorrect TALLOC_FREE
Signed-off-by: Tim Prouty <tprouty@samba.org>
2009-05-19 10:01:15 -07:00
Tim Prouty
c2482d6b23 s3 onefs: Fix ignore sacl parameter 2009-05-12 17:52:00 -07:00
Tim Prouty
87fe4d732d s3 onefs: Quiet a log message about oplocks being requested on streams 2009-04-01 20:06:18 -07:00
Tim Prouty
7424665061 s3 onefs: Add missing newlines to debug statements in the onefs module 2009-03-31 17:31:50 -07:00
Steven Danneman
365b5cfcbe Add missing newlines to debug statements 2009-03-25 12:53:06 -07:00
Tim Prouty
130582f170 s3 OneFS: Remove usage of non-existant function
The function was removed in:
c16c90a1cb
2009-03-23 11:57:13 -07:00
Tim Prouty
04f5f73905 s3 OneFS: Use the public open_streams_for_delete 2009-03-04 18:32:13 -08:00
Tim Prouty
243d4e8a08 s3 OneFS: Add parameter to ignore streams 2009-03-03 13:06:16 -08:00
Tim Prouty
664268a287 s3 OneFS: Refactor config code and cleanup includes 2009-03-01 16:39:55 -08:00
Aravind Srinivasan
176e885720 s3: Fix OneFS bug opening streams with truncating disposition
Do not attempt to delete streams on a truncating open, if the name we're
opening is itself a stream
2009-02-18 20:50:05 -08:00
Steven Danneman
dc19a60e50 s3 onefs: rename custom parameter to plural to match previous usage 2009-02-12 14:08:56 -08:00
todd stecher
1884b92872 s3 OneFS: Expand the usage of the ignore sacl parameter 2009-02-11 12:26:47 -08:00
Tim Prouty
16d2c2fa58 s3 OneFS: Add kernel oplocks implementation
A few functions in oplocks_onefs.c need to be accessed from the onefs
vfs module.  It would be ideal if oplocks were implemented at the vfs
layer, but since they aren't yet, a new header is added to
source3/include to make these functions available to the onefs vfs
module.  oplocks_onefs.o doesn't need to be linked into the onefs vfs
module explicitly, since it is already linked into smbd by default.
2009-02-09 23:47:45 -08:00
Tim Prouty
a1e428914b s3: Add OneFS alternate data streams implementation 2009-01-11 22:13:36 -08:00
Tim Prouty
5c48ba6563 s3: General cleanup of the open path in the OneFS vfs module 2009-01-11 22:13:36 -08:00
Tim Prouty
4d82f69f88 s3: Fix caller of print_fsp_open 2008-12-31 21:24:25 -08:00
Volker Lendecke
972295f80a Rename parent_dirname_talloc() to parent_dirname() 2008-12-31 19:33:25 +01:00
Tim Prouty
7b9f6dda13 s3: [3/3]: Fix a delete on close divergence from windows and the associated torture test
This third patch cleans up by removing all of the code that is made
obsolete by the first patch.  It should cause no functional changes.
2008-12-09 18:06:49 -08:00
Tim Prouty
e0711ffa52 s3: Add the OneFS SMB_VFS_CREATE_FILE implementation
This is the first pass at extending the onefs vfs module to support
the CIFS-specific enhancements available on OneFS.  Most of this patch
is massaging the sama open path to work with ifs_createfile.

ifs_createfile is a CIFS-specific syscall for opening/files and
directories.  It adds support for:
- Full in-kernel access checks using a windows access_mask
- Cluster-coherent share mode locks
- Cluster-coherent oplocks
- Streams
- Setting security descriptors at create time
- Setting dos_attributes at create time

This patch does not implement the samba side of the streams support or
oplocks support.  Tests that expect oplocks to be granted or streams
to be supported will fail.  This will be remedied in upcoming patches.
2008-12-09 14:51:48 -08:00
Tim Prouty
51e7f79b3b s3: Add onefs_open.c with code copied verbatim from smbd/open.c
This is an intermediate step that makes it much easier to see how the
OneFS SMB_VFS_CREATE_FILE implementation diverges from stock samba.
The goal is that more common code can be refactored into utility
functions.
2008-12-09 14:51:48 -08:00