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

673 Commits

Author SHA1 Message Date
Tim Prouty
1b8ffb36b1 s3 audit: Remove the usesless static function declarations from the audit modules 2009-07-06 15:38:35 -07:00
Tim Prouty
e4a85da570 s3 onefs: Fix failure in POSIX smbtorture test
The return value of readlink was a bool instead of an int,
which caused the length of the returned value to never be
>1.
2009-07-06 15:38:35 -07:00
Tim Prouty
5a09ba460c s3: Plumb smb_filename through SMB_VFS_RENAME 2009-07-06 15:38:29 -07:00
Christian Ambach
5e7da42f6e do not merge ACEs with different SMB_ACE4_INHERIT_ONLY_ACE flag, this leads to wrong inheritance flags in the ACL e.g. (on GPFS) user:10000036:rwxc:allow (X)READ/LIST (X)WRITE/CREATE (X)MKDIR (X)SYNCHRONIZE (X)READ_ACL (X)READ_ATTR (X)READ_NAMED (X)DELETE (X)DELETE_CHILD (X)CHOWN (X)EXEC/SEARCH (X)WRITE_ACL (X)WRITE_ATTR (X)WRITE_NAMED
user:10000036:rwxc:allow:FileInherit:DirInherit:InheritOnly
 (X)READ/LIST (X)WRITE/CREATE (X)MKDIR (X)SYNCHRONIZE (X)READ_ACL  (X)READ_ATTR  (X)READ_NAMED
 (X)DELETE    (X)DELETE_CHILD (X)CHOWN (X)EXEC/SEARCH (X)WRITE_ACL (X)WRITE_ATTR (X)WRITE_NAMED

group:10000005:rwxc:allow
 (X)READ/LIST (X)WRITE/CREATE (X)MKDIR (X)SYNCHRONIZE (X)READ_ACL  (X)READ_ATTR  (X)READ_NAMED
 (X)DELETE    (X)DELETE_CHILD (X)CHOWN (X)EXEC/SEARCH (X)WRITE_ACL (X)WRITE_ATTR (X)WRITE_NAMED

group:10000005:rwxc:allow:FileInherit:DirInherit:InheritOnly
 (X)READ/LIST (X)WRITE/CREATE (X)MKDIR (X)SYNCHRONIZE (X)READ_ACL  (X)READ_ATTR  (X)READ_NAMED
 (X)DELETE    (X)DELETE_CHILD (X)CHOWN (X)EXEC/SEARCH (X)WRITE_ACL (X)WRITE_ATTR (X)WRITE_NAMED

would be merged to

user:10000036:rwxc:allow:FileInherit:DirInherit:InheritOnly
 (X)READ/LIST (X)WRITE/CREATE (X)MKDIR (X)SYNCHRONIZE (X)READ_ACL  (X)READ_ATTR  (X)READ_NAMED
 (X)DELETE    (X)DELETE_CHILD (X)CHOWN (X)EXEC/SEARCH (X)WRITE_ACL (X)WRITE_ATTR (X)WRITE_NAMED

group:10000005:rwxc:allow:FileInherit:DirInherit:InheritOnly
 (X)READ/LIST (X)WRITE/CREATE (X)MKDIR (X)SYNCHRONIZE (X)READ_ACL  (X)READ_ATTR  (X)READ_NAMED
 (X)DELETE    (X)DELETE_CHILD (X)CHOWN (X)EXEC/SEARCH (X)WRITE_ACL (X)WRITE_ATTR (X)WRITE_NAMED

so the explicit right for the user on the parent directory will be gone (the InheritOnly flag only accounts to subdirectories)
thus leaving the user without access to the directory itself

Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
2009-07-06 12:28:52 +02: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
Volker Lendecke
6a66114f25 Add a \n to a debug message in smbacl4_nfs42win 2009-06-25 14:47:27 +02: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
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
4e3656b8d1 s3: Change SMB_VFS_OPEN to take an smb_filename struct
This was a little messy because of all of the vfs modules I had to
touch.  Most of them were pretty straight forward, but the streams
modules required a little attention to handle smb_filename.  Since the
use of smb_filename enables the vfs modules to access the raw,
over-the-wire stream, a little bit of the handling that was being done
by split_ntfs_stream_name has now been shifted into the individual
stream modules.  It may be a little more code, but overall it gives
more flexibility to the streams modules, while also allowing correct
stream handling.
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
537aa4cf51 s3 onefs: Fix reading over the end of the array, because the incorrect array was being read. 2009-06-15 14:11:39 -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
04afa4b6b5 s3: Plumb smb_filename through SMB_VFS_CREATE_FILE 2009-06-12 16:14:50 -07:00
Tim Prouty
2481d8dcd0 s3: Remove unix_convert handling from createfile implementations 2009-06-10 13:13:27 -07:00
Volker Lendecke
e0a6a344be Support getting gpfs birthtime 2009-06-02 18:15:20 +02:00
Mathias Dietz
15e10c6a84 Store winattrs in GPFS
1. Store win attributes in gpfs instead of posix bits.
    2. use of path based winattr calls of gpfs.

    Signed-off-by: Mathias Dietz <mdietz@de.ibm.com>
2009-06-02 17:03:59 +02:00
Volker Lendecke
84090c95a5 Add a "connectpath" operation to the shadow_copy2 module 2009-06-02 11:58:22 +02:00
Volker Lendecke
56efcb7b72 Add SMB_VFS_CONNECTPATH operation
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-02 11:58:22 +02:00
Tim Prouty
5c623e6c2e s3 onefs: update the onefs module to be compliant with stat_ex 2009-05-28 15:13:53 -07:00
Volker Lendecke
4df33ec4a7 Fix the build of nfs4_acls.c 2009-05-27 11:54:15 +02:00
Volker Lendecke
a8ffc286a4 Fix a size_t/int warning 2009-05-27 11:54:14 +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
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
Volker Lendecke
f024ca961e Use SMB_VFS_NEXT_CLOSE. This VFS stuff is really opaque to me...
Thanks Michael to provide some transparency :-)
2009-05-20 15:44:27 +02:00
Volker Lendecke
54973d0422 Fix bug disclosed by lock8 torture test
We have to drop the gpfs level share modes, regardless of whether we put
the file into the pending close queue.
2009-05-20 15:15:57 +02: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
Volker Lendecke
5fb3b8e377 Move down the become_root()/unbecome_root() calls into the VFS modules
The aio_fork module does not need this, as it does not communicate via signals
but with pipes. Watching a strace log with those become_root() calls in aio.c
is absolutely awful, and it does affect performance.
2009-05-18 13:38:56 +02:00
Volker Lendecke
67a2e62991 In aio_fork, we have to close all fd's, we might hold a gpfs share mode
Keeping such an fd open prohibits another open of that same file.
2009-05-18 10:42:22 +02:00
Volker Lendecke
8b9c5f0483 Fix a race condition in vfs_aio_fork with gpfs share modes 2009-05-18 10:42:22 +02:00
Zack Kirsch
3627ceb5e2 s3 onefs: Self-contend level2 oplocks on BRL 2009-05-12 17:53:16 -07:00
Tim Prouty
c2482d6b23 s3 onefs: Fix ignore sacl parameter 2009-05-12 17:52:00 -07:00
Jeremy Allison
ad9d64ee1b Clean up assignments to iov_base, ensure it's always cast to void *. This should quieten some warnings with picky compilers on the buildfarm.
Jeremy.
2009-05-12 11:45:37 -07:00
Jeremy Allison
b4c9cfb2af Fix a bunch of compiler warnings about wrong format types.
Should make Solaris 10 builds look cleaner.
Jeremy.
2009-05-11 21:56:57 -07:00
tprouty
3242c6caf7 s3 onefs: Turn up the debug level for non-error cases 2009-05-05 16:43:53 -07:00
tprouty
69d61453df s3: Fix trans2 path to use case-insensitive stat optimization
Often times before creating a file, a client will first query to see
if it already exists.  Since some systems have a case-insensitive stat
that is called from unix_convert, we can definitively return
STATUS_NO_SUCH_FILE to the client without scanning the whole
directory.

This code path is taken from trans2querypathinfo, but trans2findfirst
still does a full directory scan even though the get_real_filename
(the case-insensitive stat vfs call) can prevent this.

This patch adds the get_real_filename call to the trans2find* path,
and also changes the vfs_default behavior for
SMB_VFS_GET_REAL_FILENAME.  Previously, in the absence of a
get_real_filename implementation, we would fallback to the full
directory scan.  The default behavior now returns -1 and sets errno to
EOPNOTSUPP.  This allows SMB_VFS_GET_REALFILENAME to be called from
trans2* and unix_convert.
2009-05-05 16:43:53 -07:00
Steven Danneman
798389c49a s3:onefs.so Change system function names
Addendum to c49730e1.  Use newer cookie conversion names.
2009-05-05 14:42:19 -07:00
Steven Danneman
c49730e15b s3:onefs.so fix issue with missing entries when enumerating directories
This bug prompted several, fairly large changes to the of OneFS's
readdirplus() within Samba.

One fundamental problem is that we kept our cache cursor pointed at the
next entry to be returned from onefs_readdir(), while the resume cookie
needed to refill the cache such that our cursor would be on this entry,
was located in the previous cache entry.  This meant that to correctly handle
seekdir() cases which could be found within the existing cache, and cases
where a cache reload was needed, required that the cache always hold
at least two entries: the entry we wished to return, and the previous entry
which held the resume cookie.  Since the readdirplus() syscall gives us no
guarantee that it will always return these two direntries, there was a
fundamental problem with this design.

To fix this problem, I have rearchitected the onefs_readdir() path to keep
its pointer on the entry which contains the resume_cookie, not the entry
which will be returned next.  Essentially, I changed onefs_readdir() from a
"return an entry then increment the cursor" model to "increment the cursor
then return an entry".  By doing this, we only require that a single entry
be within the cache: the entry containing the resume cookie.

Second, there have been numerous off-by-one bugs in my implementation of
onefs_seekdir() which did a mapping between the 64-bit resume cookie
returned by readdirplus() and its own monotonically increasing "location"
offset.  Furthermore, this design caused a somewhat frequent waste of
cycles, as in some cases we'd need to re-enumerate the entire directory to
recover the current "location" from an old resume cookie.  As this code was
somewhat difficult to understand, prone to bugs, and innefficient in some
cases I decided it was better to wholesale replace it now, rather than later.

It is possible to algorithmically map the 64-bit resume cookies from
readdirplus() into 32-bit offset values which SMB requires.  The onefs.so
module now calls into a system library to do this conversion.  This greatly
simplifies both the seekdir() and telldir() paths and is more efficient.
2009-05-04 15:02:17 -07:00
Volker Lendecke
c33291d49f Fix annoying debug messages when no snapshots are used
Not being able to open the shadow copy directory is the same as having no
shadow copy support at all. The VFS module should in this case not log with
debug level 0 and set ENOSYS to indicate "no shadow copies used" to the higher
levels.
2009-04-28 11:21:49 +02:00
Tim Prouty
161bd7f78f s3 onefs: Fix case-insensitivity for mangled names
onefs_get_real_filename needs to demangle the filename before doing
the case-insensitive estat
2009-04-07 10:44:50 -07:00
Volker Lendecke
a2d5fe4a05 Make some functions static to vfs_gpfs.c 2009-04-06 13:29:59 +02:00
Volker Lendecke
f2e17a4b24 Add prototype for smbd_gpfs_get_realfilename_path 2009-04-06 13:29:59 +02:00
Volker Lendecke
54c2fe6583 Fix two c++ warnings in vfs_gpfs.c 2009-04-06 13:29:59 +02: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
Zack Kirsch
bfc7bb49ff s3 onefs: Async failures are resulting in SMB_ASSERT->smb_panic while running many of the LOCK torture tests.
Return true from the onefs cancel function if we've errored, which can happen
when the CBRL domain is configured to only give out 1 lock. :)
2009-03-31 17:29:07 -07:00
Scott Urban
ee22c417f3 s3: added per-client statistics to onefs perfcount module
* we now track, uid, remote ip, and local ip per CIFS operation
* removed perfcount_set_client() from perfcount interface as it's
  unecessary
2009-03-27 17:33:26 -07:00
Volker Lendecke
9e70a960b7 Fix the build of nfsv4_acls.c
.. after adding smb_iconv_convenience to ndr_size_security_descriptor()
2009-03-27 11:10:50 +01:00
Jeremy Allison
1f83aafac8 Try and fix the build farm RAW-STREAMS errors. Ordering of
modules shouldn't matter, so as vfs_streams_depot doesn't
implement get/setxattrs then call into the full VFS stack
at the top.
Jeremy
2009-03-26 15:30:42 -07:00
Steven Danneman
365b5cfcbe Add missing newlines to debug statements 2009-03-25 12:53:06 -07:00
David Kwan
ad98eae02e s3 onefs: Change error status to NT_ACCESS_DENIED for errors in SET_SECURITY_DESC 2009-03-24 17:27:37 -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
Volker Lendecke
14df86e9e3 Use StrCaseCmp in the dirsort module 2009-03-22 11:44:13 +01:00
Andy Kelk
2835d0d463 Add dirsort module 2009-03-22 11:44:13 +01:00
Tim Prouty
710948c788 s3 onefs: Correctly error out when the read returns EOF
Also add some more debugging.
2009-03-18 16:51:41 -07:00
Tim Prouty
c3227b6233 s3: Don't return in a void funtion 2009-03-13 22:02:53 -07:00
Dave Richards
5df46fa35b s3 OneFS: Add kernel strict locking support 2009-03-13 14:21:40 -07:00
Dave Richards
1fcc11ff25 s3: Add strict lock/unlock calls to the vfs layer to replace is_locked 2009-03-13 14:16:55 -07:00
Volker Lendecke
3d280639c4 Add a vfs_preopen module to hide fs latencies 2009-03-10 18:11:56 +01:00
Tim Prouty
04f5f73905 s3 OneFS: Use the public open_streams_for_delete 2009-03-04 18:32:13 -08:00
Jeremy Allison
f85aa66ca2 Fix crashes when running RAW-ACLs against system with tdb ACL modules
(caused by the POSIX pathname fixes).
Jeremy.
2009-03-04 14:48:33 -08:00
Volker Lendecke
e8484e01ed Make use of gpfs_get_real_filename optional 2009-03-04 11:23:12 +01: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
Jeremy Allison
a6d0a93fc2 Use fsp->posix_open in preference if we have it.
Jeremy.
2009-02-25 14:50:19 -08:00
Jeremy Allison
9b8bb1ad95 Ensure ACL modules work with POSIX paths.
Jeremy.
2009-02-25 14:12:51 -08:00
Tim Prouty
01493737c8 s3 OneFS: Add .snapshot directory configuration handling 2009-02-25 13:57:11 -08:00
Jeremy Allison
76ca297ecf Fix use of streams modules with CIFSFS client.
Jeremy.
2009-02-25 13:46:21 -08:00
Tim Prouty
afc7e45a4c s3 OneFS: Fix uninitialized variable 2009-02-24 21:55:44 -08:00
Dan Sledz
4e024b3f87 s3: onefs_acl.c cleanup
Remove some duplicate code.
Add a \n to a debugging statement
2009-02-24 15:53:02 -08:00
todd stecher
95bf60b39d S3: Add in profile counters for new vfs and syscall entries. 2009-02-24 15:53:01 -08:00
Tim Prouty
7bcaaf14fb s3 OneFS: Add a parameter that unconditionally allows execute access 2009-02-23 23:21:48 -08:00
Jeremy Allison
faa1100d22 More warning fixes for Solaris.
Jeremy.
2009-02-23 16:22:43 -08:00
Jeremy Allison
2033b44c3f More warning fixes for Solaris.
Jeremy.
2009-02-23 15:44:34 -08:00
Jeremy Allison
0b62cdbed0 Quieten down a boatload of shadowed variable warnings on Solaris.
Makes real problems easier to spot.
Jeremy.
2009-02-23 15:03:29 -08:00
Tim Prouty
8ec9903426 s3 OneFS: Add an atomic sendfile implementation 2009-02-21 17:10:42 -08:00
Zack Kirsch
5300dc6288 s3 OneFS: Add debugging for createfile_flags 2009-02-20 16:42:50 -08:00
Steven Danneman
5bd7f9c61b s3: OneFS implementation of change notify
The OneFS Samba implementation of change notify is modeled after the
usage of Linux's inotify kernel subsystem.  A single call is made
into the onefs.so VFS module to initialize kernel tracking of certain
file change events.  When these events occur a kernel notification is
sent to smbd and the notification event is translated and given to the
general Samba Change Notify layer through a callback function.

The most difficult aspect is converting an SMB CompletionFilter to
a matching ifs_event mask, and then back to an appropriate change
notify action.  Currently, not all possible cases are handled by the
this module, but the most prevalent ones, which are tested by
smbtorture, are implemented.
2009-02-20 14:10:31 -08:00
Jeremy Allison
e6a5f11865 Fix bug #6133 - Cannot delete non-ACL files on Solaris/ZFS/NFSv4 ACL filesystem.
As the NFSv4 ACL mapping code doesn't map write directory into the DELETE_CHILD
permission bit (which we require before allowing a delete) no one can delete
files without an explicit DELETE_CHILD bit set on the directory. Add this mapping.
Jeremy.
2009-02-20 08:23:52 -08:00
Tim Prouty
73d5f14c04 s3 OneFS: Add shadow copy module 2009-02-19 21:09:31 -08:00
Tim Prouty
53bcd162ee s3 OneFS: Add file_id_create implementation to take advantage of snapshots 2009-02-19 21:09:30 -08:00
Tim Prouty
e4675ce8db s3: Add extid to the dev/inode pair
This extends the file_id struct to add an additional generic uint64_t
field: extid.  For backwards compatibility with dev/inodes stored in
xattr_tdbs and acl_tdbs, the ext id is ignored for these databases.
This patch should cause no functional change on systems that don't use
SMB_VFS_FILE_ID_CREATE to set the extid.

Existing code that uses the smb_share_mode library will need to be
updated to be compatibile with the new extid.
2009-02-19 20:58:26 -08:00
Tim Prouty
6fbebb5369 s3: Modify SMB_VFS_FILE_ID_CREATE to take a stat struct
Since file_id_create_dev is incompatible with the concept of file_ids,
it is now static and in the one file that needs it.
2009-02-19 20:58:01 -08:00
Zack Kirsch
96b3242f12 s3 OneFS: Fixes "inherit permissions" and "nt acl support" for Onefs. 2009-02-19 00:15:44 -08:00
todd stecher
fdcd5a3a20 S3: Make changes to perfcount API set for when a single request leads to multiple replies
(e.g. reply_echo). Change test and onefs modules to match new api set (thanks Volker!).
2009-02-19 00:01:00 -08:00
Zack Kirsch
053e1873c5 s3: OneFS: Pass in the client's fnum to the ifs_cbrl syscall. 2009-02-18 20:50:05 -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
Aravind Srinivasan
8e8aa27e1b s3: Fix streams enumeration bug in OneFS implementation
Previously, we didn’t call SMB_VFS_OPEN_DIR from the streams module,
instead we called fdopendir(). As a result we failed to populate the
dir_state list in the readdirplus module. So when we tried to view the
stream data, we will always returned NULL.

To solve this I separated onefs_opendir() and the initialization of
the dir_state list. This is done by introducing a new utility function
“onefs_rdp_add_dir_state()”, which initializes the dir_state structure
and adds it to the dir_state list.  This function is called from the
streams module before calling readdir().
2009-02-18 20:49:31 -08:00
Tim Prouty
57a31ef203 s3 perfcount: Fix segfault with smbclient 'echo 3 foo' 2009-02-16 00:29:20 -08:00
Tim Prouty
6bd7e2b097 s3 OneFS: Add defaults to the fake timestamp parameters 2009-02-16 00:29:20 -08:00
Volker Lendecke
b08e24a44c Replace a // style comment with a /* */ one 2009-02-14 22:01:02 +01:00
Volker Lendecke
ef3672a655 Fix some C++ warnings 2009-02-14 22:01:02 +01:00
Tim Prouty
85eccea0b4 s3 OneFS: Add recvfile implementation 2009-02-13 21:36:42 -08:00
Holger Hetterich
4261cae2eb Enable total anonymization in vfs_smb_traffic_analyzer, by mapping any user names to the one given by anonymize_prefix, without generating a hash number. This setting is optional and is compatible with the module configuration format of Samba 3.3. 2009-02-13 17:22:25 -08:00
Aravind Srinivasan
6085ba3dec s3 OneFS: Add vfs implementation for SMB_VFS_GET_REAL_FILE_NAME 2009-02-13 12:59:30 -08:00
todd stecher
dbe2588e46 s3: Test module for perfcount system
Add 'perfcount module = pc_test' to exercise this module. Results are
logged into smb.log every 50 operations (configurable via smb.conf).
2009-02-13 12:59:30 -08:00
Zack Kirsch
a3531314dd OneFS implementation of BRL VFS ops:
* Much of the beginning should look familiar, as I re-used the OneFS oplock
  callback record concept. This was necessary to keep our own state around - it
  really only consists of a lock state, per asynchronous lock that is currently
  unsatisfied.  The onefs_cbrl_callback_records map to BLRs by the id.
* There are 4 states an async lock can be in. NONE means there is no async
  currently out for the lock, as opposed to ASYNC. DONE means we've locked
  *every* lock (keep in mind a request can ask for multiple locks at a time.)
  ERROR is an error.
* onefs_cbrl_async_success: The lock_num is incremented, and the state changed,
  so that when process_blocking_lock_queue is run, we will try the *next* lock,
  rather than the same one again.
* onefs_brl_lock_windows() has some complicated logic:
    * We do a no-op if we're passed a BLR and the matching state is ASYNC --
      this means Samba is trying to get the same lock twice, and we just need
      to wait longer, so we return an error.
    * PENDING lock calls happen when the lock is being queued on the BLQ -- we
      do async in this case.
    * We also do async in the case that we're passed a BLR, but the lock is not
      pending. This is an async lock being probed by process_blocking_lock_queue.
    * We do a sync lock for any normal first request of a lock.
    * Failure is returned, but it doesn't go to the client unless the lock has
      actually timed out.
2009-02-13 10:08:55 -08:00
Zack Kirsch
813273c87e Add VFS ops for Windows BRL: Lock, Unlock and Cancel:
This patch adds 3 new VFS OPs for Windows byte range locking: BRL_LOCK_WINDOWS,
BRL_UNLOCK_WINDOWS and BRL_CANCEL_WINDOWS. Specifically:

* I renamed brl_lock_windows, brl_unlock_windows and brl_lock_cancel to
  *_default as the default implementations of the VFS ops.
* The blocking_lock_record (BLR) is now passed into the brl_lock_windows and
  brl_cancel_windows paths. The Onefs implementation uses it - future
  implementations may find it useful too.
* Created brl_lock_cancel to do what brl_lock/brl_unlock do: set up a
  lock_struct and call either the Posix or Windows lock function. These happen
  to be the same for the default implementation.
* Added helper functions: increment_current_lock_count() and
  decrement_current_lock_count().
* Minor spelling correction in brl_timeout_fn: brl -> blr.
* Changed blocking_lock_cancel() to return the BLR that it has cancelled. This
  allows us to assert its the lock that we wanted to cancel. If this assert ever
  fires, this path will need to take in the BLR to cancel, rather than choosing
  on its own.
* Adds a small helper function: find_blocking_lock_record_by_id(). Used by the
  OneFS implementation, but could be useful for others.
2009-02-13 10:08:40 -08:00
Steven Danneman
dc19a60e50 s3 onefs: rename custom parameter to plural to match previous usage 2009-02-12 14:08:56 -08:00