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

103 Commits

Author SHA1 Message Date
Jeremy Allison
17adbbcad7 s3: modules: streaminfo: As we have no VFS function SMB_VFS_LLISTXATTR we can't cope with a symlink when lp_posix_pathnames() is true.
Fix bug : Bug 10429 - samba returns STATUS_OBJECT_NAME_NOT_FOUND when attempting to remove dangling symlink

https://bugzilla.samba.org/show_bug.cgi?id=10429

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Jeff Layton <jlayton@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Feb  8 00:01:16 CET 2014 on sn-devel-104
2014-02-08 00:01:16 +01:00
Andreas Schneider
654b784e9c s3-vfs: Fix stream_depot vfs module on btrfs.
Checking if the directory is empty using 'nlink == 2' only checks if
there are no subdirectories. It doesn't indicate if there are files in
the directory. However checking link count for no subdirectories is
wrong and applications shouldn't rely on it, see:

https://lkml.org/lkml/2012/2/1/756

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-11-12 17:33:12 +01:00
David Disseldorp
2405e7906c Revert "s3-vfs: Fix stream_depot vfs module on btrfs."
This reverts commit 29f12e7d59.

The wrong patch was pushed, according to Andreas:
	I sent a second version cause the first was not complete. I've
	discussed with Volker after I sent the patch and then sent a new
	patch which

	a) also does the right thin in the unlink case
	b) only tried to remove the server is the deletion of the file
	   was successful.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-11-12 17:33:12 +01:00
Andreas Schneider
29f12e7d59 s3-vfs: Fix stream_depot vfs module on btrfs.
Checking if the directory is empty using 'nlink == 2' only checks if
there are no subdirectories. It doesn't indicate if there are files in
the directory. However checking link count for no subdirectories is
wrong and applications shouldn't rely on it, see:

https://lkml.org/lkml/2012/2/1/756

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-11-08 09:42:20 -08:00
Volker Lendecke
a61307489c vfs: Convert streams_depot_streaminfo to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:59 -07:00
Volker Lendecke
952d348f87 vfs: Convert collect_one_stream to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:59 -07:00
Volker Lendecke
83e6ff1511 vfs: Convert streams_depot_rmdir to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:59 -07:00
Volker Lendecke
87d92093af vfs: Convert streams_depot_unlink to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:59 -07:00
Volker Lendecke
1729d78692 vfs: Convert streams_depot_open to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:59 -07:00
Volker Lendecke
3794574bc1 vfs: Convert stream_smb_fname to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:59 -07:00
Volker Lendecke
987ebb1591 vfs: Convert stream_dir to synthetic_smb_fname
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:59 -07:00
Björn Baumbach
8da8a2289e s3: vfs_streams_depot: add delete_lost option
With this option lost stream directories will be removed
instead of renamed.

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Oct  1 18:47:30 CEST 2012 on sn-devel-104
2012-10-01 18:47:30 +02:00
Jeremy Allison
f5a2379794 In vfs modules, don't use 'conn->origpath' when we really mean 'conn->cwd'.
This allows VFS modules to work even when we've changed directory
under the connect path in order to do root-safe calls.

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Sep 12 23:45:23 CEST 2012 on sn-devel-104
2012-09-12 23:45:22 +02:00
Jeremy Allison
526e875cec Check error returns from strupper_m() (in all reasonable places). 2012-08-09 12:06:54 -07:00
Andrew Bartlett
6aa12fcb30 build: Remove SMB_OFF_T, replace with off_t
Now that we always require a 64 bit off_t, we no longer need SMB_OFF_T.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri Apr  6 01:47:43 CEST 2012 on sn-devel-104
2012-04-06 01:47:43 +02:00
Andrew Bartlett
f6e0532024 build: Remove SMB_STRUCT_DIR define 2012-04-05 02:39:09 +02:00
Volker Lendecke
03300f233c s3: Simplify streams_depot a bit
b0c0b949 is a bit involved. Passing down booleans is almost never
very clear
2012-02-02 20:35:27 +01:00
Volker Lendecke
1f328d1e6a s3: Add rmdir operation to streams_depot
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Feb  1 01:05:57 CET 2012 on sn-devel-104
2012-02-01 01:05:57 +01:00
Richard Sharpe
422494a8e6 vfs: Make function pointer names consistent. They all end in _fn
Autobuild-User: Richard Sharpe <sharpe@samba.org>
Autobuild-Date: Mon Dec 12 04:58:40 CET 2011 on sn-devel-104
2011-12-12 04:58:40 +01:00
Frank Lahm
7a0b5d6fc5 Add support for VFS op streaminfo chaining in all relevant VFS modules.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Oct 14 03:26:06 CEST 2011 on sn-devel-104
2011-10-14 03:26:06 +02:00
Andrew Bartlett
73b377432c s3-talloc Change TALLOC_REALLOC_ARRAY() to talloc_realloc()
Using the standard macro makes it easier to move code into common, as
TALLOC_REALLOC_ARRAY isn't standard talloc.

Andrew Bartlett
2011-06-09 12:40:08 +02:00
Andrew Bartlett
c615ebed6e s3-lib Replace StrCaseCmp() with strcasecmp_m()
strcasecmp_m() never needs to call to talloc, and via next_codepoint()
still has an ASCII fast-path bypassing iconv() calls.

Andrew Bartlett
2011-05-18 16:12:08 +02:00
Günther Deschner
c7073f8b54 s3-vfs: rename open function to open_fn.
This should finally fix the AIX build and allow to remove AIX specific ifdefs.

Guenther

Signed-off-by: Jeremy Allison <jra@samba.org>

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Apr 21 02:01:20 CEST 2011 on sn-devel-104
2011-04-21 02:01:20 +02:00
Günther Deschner
45364f5e69 s3-vfs: include smbd/smbd.h in vfs modules.
Guenther
2011-03-30 01:13:08 +02:00
Günther Deschner
0e771263ee s3-includes: only include system/filesys.h when needed.
Guenther
2011-03-30 01:13:07 +02:00
Jeremy Allison
bb54f72b94 Make processing of incoming stream rename paths common between reply_mv and ntrename. Ensure we don't depend on "./" in the streams module. 2011-01-20 16:27:56 -08:00
Volker Lendecke
f6650f5d19 s3: Do not talloc in readdir
This is a hot codepath (called from the stat cache)
2009-11-18 23:16:13 +01:00
Jeremy Allison
921aa99b37 Start fixing the RAW-STREAMS test - ensure that the xattr
used to store the stream info in streams_depot.so is not
seen in when enumerating EAs.
Jeremy.
2009-10-29 16:14:12 -07:00
Aravind Srinivasan
e046b382f2 s3: Add a new VFS op called SMB_VFS_TRANSLATE_NAME
This vop is designed to work in tandem with SMB_VFS_READDIR to allow
vfs modules to make modifications to arbitrary filenames before
they're consumed by callers.  Subsequently the core directory
enumeration code in smbd is now changed to free the memory that may be
allocated in a module.  This vop enables the new version of catia in
the following patch.

Signed-off-by: Tim Prouty <tprouty@samba.org>
2009-08-28 16:38:57 -07:00
Stefan Metzmacher
09fe57923a s3:streams: check for :$DATA only in the backend (fix bug #6642)
We need to allow "\\$Extend\\$Quota:$Q:$INDEX_ALLOCATION" to pass
check_path(), so that the Quota Dialog works.

metze
2009-08-27 16:45:40 +02: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
Volker Lendecke
033185e2a1 Make the smbd VFS typesafe 2009-07-24 11:42:05 -04:00
Tim Prouty
431e63cd8b s3: Update streaminfo implementations now that only base names are passed through the vfs 2009-07-06 15:38:47 -07:00
Tim Prouty
258952aa85 s3: Plumb smb_filename through SMB_VFS_UNLINK 2009-07-06 15:38:36 -07:00
Tim Prouty
5a09ba460c s3: Plumb smb_filename through SMB_VFS_RENAME 2009-07-06 15:38:29 -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
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
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
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
Jeremy Allison
76ca297ecf Fix use of streams modules with CIFSFS client.
Jeremy.
2009-02-25 13:46:21 -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
Steven Danneman
af0e199b31 Add an optional SMB_STRUCT_SMB parameter to VFS_OP_READDIR
* this allows VFS implementations that prefetch stat information on
  readdir to return it through one VFS call
* backwards compatibility is maintained by passing in NULL
* if the system readdir doesn't return stat info, the stat struct is
  set to invalid
2009-02-09 23:56:16 -08:00
Tim Prouty
b8f7cdbd79 s3: Add a new SMB_VFS_GET_ALLOC_SIZE vfs operation
This allows module implementors to customize what allocation size is
returned to the client.
2009-01-29 15:29:33 -08:00
Tim Prouty
c0b98297b4 s3: Remove a few unnecessary checks from the streams depot module and fix to work with NTRENAME
Handling of error codes when renaming a file to a stream and a stream
to a file is now done in rename_internals_fsp.

The NTRENAME stream path only passes in the stream name, so the new
base can now be different from the old base.
2009-01-04 19:31:30 -08:00
Stefan Metzmacher
b0c0b949fe s3:streams_depot: add an option to disable the xattr checks
streams_depot:check_valid=no is useful when the filesystem
has no xattr support and files are only published via samba.

metze
2008-12-01 14:20:21 -08:00
Stefan Metzmacher
d53f82a1cf s3:streams_depot: fix valgrind bug lp_parm_const_string() doesn't talloc the default value
metze
2008-12-01 14:11:33 -08:00
Stefan Metzmacher
549c2cb7a8 s3:streams_depot: add support for stream renames
metze
2008-12-01 14:10:04 -08:00
Stefan Metzmacher
ce310f666d s3:streams_depot: map 'file::$DATA' to just 'file'
metze
2008-12-01 13:59:21 -08:00
Jeremy Allison
d205766e60 Fix a C90 error.
Jeremy.
2008-11-21 22:51:20 -08:00
TAKAHASHI Motonobu
e711d76157 Fix bug 5901: Default for streams_depot location 2008-11-16 13:18:56 +01:00
Volker Lendecke
c1636e7383 Change the directory parameter in streams_depot to become consistent
This is not built by default and not documented in 3.2.0, so I doubt this will
break any setups :-)
(cherry picked from commit ca2dfb372c)
(This used to be commit 9393cdda97)
2008-07-18 11:21:57 +02:00
Volker Lendecke
9a22653222 Add SMB_VFS_FS_CAPABILITIES
It turns out that this is a necessary operation, separate from statvfs. statvfs
can fail during tcon, so conn->fs_capabilities would never see that we support
streams on a particular share.

James, can you check that I got the darwin variant right? Thanks!
(This used to be commit 3ad798d803)
2008-01-21 16:14:27 +01:00
Volker Lendecke
dfd05b9b65 vfs_streams_depot
Store streams in a file each. Not 100% finished, and not built by default.
(This used to be commit 5f5fc72b01)
2008-01-19 23:36:34 +01:00