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

1720 Commits

Author SHA1 Message Date
David Disseldorp
9d29f7ea17 vfs: add vfs_shell_snap module
The shell_snap VFS module plumbs into the snapshot (aka shadow-copy)
management paths used by Samba's File Server Remote VSS Protocol (FSRVP)
server.
The following shell callouts may be configured in smb.conf:

shell_snap: check path command
	- Called when an FSRVP client wishes to check whether a given
	  share supports snapshot create/delete requests.
	- The command is called with a single <share path> argument.
	- The command must return 0 if <share path> is capable of being
	  snapshotted.

shell_snap: create command
	- Called when an FSRVP client wishes to create a snapshot.
	- The command is called with a single <share path> argument.
	- The command must return 0 status if the snapshot was
	  successfully taken.
	- The command must output the path of the newly created snapshot
	  to stdout.

shell_snap: delete command
	- Called when an FSRVP client wishes to delete a snapshot.
	- The command is called with <base share path> and
	  <snapshot share path> arguments.
	- The command must return 0 status if the snapshot was
	  successfully removed.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-31 18:40:25 +02:00
David Disseldorp
9f7dd07d26 vfs_snapper: create/delete snapshot support
Extend vfs_snapper to support the new remote snapshot creation and
deletion hooks added for FSRVP.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-31 18:40:25 +02:00
David Disseldorp
9b5b46a092 vfs_btrfs: add snapshot create/delete calls
The "btrfs: manipulate snapshots" smb.conf parameter is disabled by
default, to encourage use of, and pass requests through to, the
vfs_snapper module.
When enabled, issue BTRFS_IOC_SNAP_CREATE_V2 and BTRFS_IOC_SNAP_DESTROY
ioctls accordingly. The ioctls are issued as root, so rely on permission
checks in the calling FSRVP server process.

Base share paths must exist as btrfs subvolumes in order to
be supported for snapshot operations.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-31 18:40:25 +02:00
David Disseldorp
67ee428467 vfs: add snapshot create/delete hooks
This change adds three new VFS hooks covering snapshot manipulation:
- snap_check_path
  Check whether a path supports snapshots.
- snap_create
  Request the creation of a snapshot of the provided path.
- snap_delete
  Request the deletion of a snapshot.

These VFS call-outs will be used in future by Samba's File Server Remote
VSS Protocol (FSRVP) server.

MS-FSVRP states:
  At any given time, Windows servers allow only one shadow copy set to
  be going through the creation process.
Therefore, only provide synchronous hooks for now, which can be
converted to asynchronous _send/_recv functions when the corresponding
DCE/RPC server infrastructure is in place.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-31 18:40:24 +02:00
Christof Schmitt
868f83e5c6 vfs_gpfs: Remove warning after failure of get_gpfs_fset_id
get_gpfs_fset_id already emits more detailed warnings, there is no need
to print an additional warning in the calling function.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2015-03-30 11:04:15 +02:00
Ralph Boehme
4cc51f905c vfs_fruit: enhance handling of malformed AppleDouble files
Trying for fixup a broken AppleDouble file with a resourcefork entry
offset + length > filesystem resulted in a crashing memmove() in
ad_convert().

Add a specific safety check that stats the ._ file and limits the
resource fork length to the filesize.

While we're at it, now that we know the filesize in ad_unpack(), add
additional checks that verify this.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Mar 26 12:39:01 CET 2015 on sn-devel-104
2015-03-26 12:39:01 +01:00
Christof Schmitt
8dcf8cfe66 gpfswrap: Move gpfswrap to lib/util
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-03-23 21:22:12 +01:00
Yan, Zheng
7551a4edb5 vfs_ceph: remove cephwrap_init_stat_ex_from_stat()
cephwrap_init_stat_ex_from_stat() lacks code that makes 'create'
timestamp. Besides that, it's identical to init_stat_ex_from_stat().

Signed-off-by: Yan, Zheng <zyan@redhat.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2015-03-19 18:02:13 +01:00
Yan, Zheng
16956d4eb1 vfs_ceph: fix ntimes_fn callback
add null timespec check for atime/mtime. Also add code that stores
create_time by EA.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2015-03-19 18:02:13 +01:00
Volker Lendecke
f686db87a4 source3: Replace ccan hash calls with tdb_jenkins_hash
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-03-17 11:30:52 +01:00
Volker Lendecke
de811f14af lib: Remove tdb_compat
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-03-17 11:30:52 +01:00
David Disseldorp
12c0b6bf40 s3/vfs: change fallocate mode flags from enum->uint32_t
The Linux fallocate syscall offers a mode parameter which can take the
following flags:
FALLOC_FL_KEEP_SIZE
FALLOC_FL_PUNCH_HOLE (since 2.6.38)
FALLOC_FL_COLLAPSE_RANGE (since 3.15)
FALLOC_FL_ZERO_RANGE (since 3.14)

The flags are not exclusive, e.g. FALLOC_FL_PUNCH_HOLE must be specified
alongside FALLOC_FL_KEEP_SIZE.

Samba currently takes a vfs_fallocate_mode enum parameter for the VFS
fallocate hook, taking either an EXTEND_SIZE or KEEP_SIZE value. This
commit changes the fallocate hook such that it accepts a uint32_t flags
parameter, in preparation for PUNCH_HOLE and ZERO_RANGE support.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-09 21:27:07 +01:00
Volker Lendecke
91ff65b2f6 vfs_fruit: Fix CID 1273290 Uninitialized scalar variable
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Mar  6 23:56:36 CET 2015 on sn-devel-104
2015-03-06 23:56:36 +01:00
Volker Lendecke
bccf5c9a7b perfcount: Fix CID 1035494 Out-of-bounds read
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>

Autobuild-User(master): Ira Cooper <ira@samba.org>
Autobuild-Date(master): Thu Mar  5 18:28:44 CET 2015 on sn-devel-104
2015-03-05 18:28:44 +01:00
Volker Lendecke
819d4b4bcd perfcount: Fix CID 1035493 Out-of-bounds read
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2015-03-05 15:59:12 +01:00
Volker Lendecke
bd3b2c3d9b perfcount: Fix CID 1035492 Out-of-bounds read
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2015-03-05 15:59:11 +01:00
Volker Lendecke
5968310060 perfcount: Fix CID 1274043 Division or modulo by zero
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2015-03-05 15:59:11 +01:00
Volker Lendecke
ddb84ef2d3 aio_fork: Fix CID 1273291 Uninitialized scalar variable
The previous code left msg.msg_flags uninitialized

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-03-03 17:34:38 +01:00
Christof Schmitt
3c2cf5e0d6 gpfs: Add include guard to gpfswrap.h
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>

Autobuild-User(master): Christof Schmitt <cs@samba.org>
Autobuild-Date(master): Tue Mar  3 01:01:25 CET 2015 on sn-devel-104
2015-03-03 01:01:24 +01:00
Christof Schmitt
a11fed1671 gpfs: Rename library wrapper to gpfswrap
The code in gpfs.c and vfs_gpfs.h now only wraps the gpfs library.
Rename the files to gpfswrap to make it clear that this is the only
purpose of that file.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
b765b17fea gpfs: Update file headers
Update file headers to reflect the new code organization and reformat
for consistency.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
5e022bc339 gpfs: Remove unncessary includes from gpfs.c
replace.h provides everything that is required (errno and ENOSYS).

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
d93767fe8f gpfs: Move DBGC_CLASS definition below includes
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
b69957d65d gpfs: Include gpfs_fcntl.h only from vfs_gpfs header file
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
f508f273b2 gpfs: Move definition of GPFS_GETACL_NATIVE to vfs_gpfs.c
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
38a89f23f1 gpfs: Move smbd_gpfs_set_times_path to vfs_gpfs.c
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
a5ca63b266 gpfs: Move get_gpfs_fset_id to vfs_gpfs.c
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
a36c46d9db gpfs: Move get_gpfs_quota to vfs_gpfs.c
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
9948163a64 gpfs: Move set_gpfs_lease to vfs_gpfs.c
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
f9629aee81 gpfs: Move set_gpfs_sharemode to vfs_gpfs.c
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
26991065f2 gpfs: Introduce wrapper for gpfs_getfilesetid
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
e30d501217 gpfs: Introduce wrapper for gpfs_fcntl
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
c4f1f3b253 gpfs: Introduce wrapper for gpfs_quotactl
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
1907a88a6d gpfs: Introduce wrapper for gpfs_set_times_path
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
db01831082 gpfs: Rename wrapper for gpfs_lib_init
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
eefb916192 gpfs: Rename wrapper for gpfs_ftruncate
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
15c2b3a825 gpfs: Rename wrapper for gpfs_prealloc
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
4d57c20ba8 gpfs: Rename wrapper for gpfs_get_winattrs
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
2cecf08298 gpfs: Rename wrapper for gpfs_get_winattrs_path
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
e9e87d456a gpfs: Rename wrapper for gpfs_set_winattrs_path
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
fdd6078ddd gpfs: Rename wrapper for gpfs_get_realfilename_path
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:08 +01:00
Christof Schmitt
5fa1ee8b7b gpfs: Rename wrapper for gpfs_putacl
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:07 +01:00
Christof Schmitt
d266ad1e4b gpfs: Rename wrapper for gpfs_getacl
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:07 +01:00
Christof Schmitt
193b5dd143 gpfs: Introduce wrapper for gpfs_set_lease
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:07 +01:00
Christof Schmitt
5fb2568d5b gpfs: Introduce wrapper for gpfs_set_share
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:07 +01:00
Christof Schmitt
ca69d43dfd gpfs: Simplify initialization for gpfs library wrapper
Merge the code for initializing the function pointers in one function.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:07 +01:00
Christof Schmitt
4a89e8452e gpfs: Remove search for libgpfs_gpl.so
Similar to the header files, libgpfs_gpl.so no longer exists. The
library is now always called libgpfs.so.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:07 +01:00
Christof Schmitt
f826c86bf1 gpfs: Look for gpfs header files also in /usr/lpp/mmfs/include/
That is the default directory for the gpfs header files.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:07 +01:00
Christof Schmitt
1264a4efd9 gpfs: Always use gpfs_fcntl.h headerfile
gpfs_gpl.h no longer exists, everything from that header file has been
merged to gpfs.h. gpfs_fcntl.h implicitly includes gpfs.h. Simplify the
code by only looking for gpfs_fcntl.h and including that file.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
2015-03-02 22:31:07 +01:00
Volker Lendecke
3ec06454e1 vfs_catia: Simplify init_mappings()
No else required after return

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Feb 26 21:22:30 CET 2015 on sn-devel-104
2015-02-26 21:22:30 +01:00