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

90 Commits

Author SHA1 Message Date
Michael Adam
6685e6512e s3:modules:shadow_copy2: remove redundant documentation comment block
and refer to the manual page instead

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-12-07 07:43:50 +13:00
Michael Adam
bffaf17d48 s3:modules:shadow_copy2: improve headline comment
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-12-07 07:43:48 +13:00
Michael Adam
b5b5674287 s3:module:shadow_copy2: add my (C)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-12-07 07:43:45 +13:00
Michael Adam
6ccbc1347d shadow_copy2: use stored mount_point instead of recalculating.
In the case of snapdirseverywhere but NOT crossmountpoints.

This spares stat calls.
And is the only correct thing to do if the mount point was
specified in the configuration.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:33 +13:00
Michael Adam
935120dbc0 shadow_copy2: improve debug in shadow_copy2_convert() in snapdirseverywhere mode
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:31 +13:00
Michael Adam
9ab89371c8 shadow_copy2: fix shadow_copy2_convert() in the classical case.
I.e. the non-snapdirseverywhere case.
This in particular fixes the case of a snapdir hierarchy
that is parallel to the share or mountpoint and not subordinate.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:30 +13:00
Michael Adam
86988db1f0 shadow_copy2: add some blank lines for visual separation to shadow_copy2_convert()
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:29 +13:00
Michael Adam
249e9b4a34 shadow_copy2: initialize "converted" string to null in shadow_copy2_convert()
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:28 +13:00
Michael Adam
4b8d9c65f4 shadow_copy2: fix shadow_copy2_strip_snapshot() in the classical case
I.e., fix detection of already converted names.

This is done by using the shadow_copy2_snapshot_path() function
and comparing if the input string starts with that.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:26 +13:00
Michael Adam
afcb84e69f shadow_copy2: add some debug to shadow_copy2_strip_snapshot()
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:25 +13:00
Michael Adam
3d053b1ab3 shadow_copy2: add comments explaining decisions in shadow_copy2_strip_snapshot()
This should make it more easy to understand what the cases are.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:24 +13:00
Michael Adam
38e108563d shadow_copy2: introduce shadow_copy2_snapshot_path()
This builds the posix snapshot path for the connection
at the provided timestamp. For the non-snapdirseverywhere case.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:22 +13:00
Michael Adam
4cc5140bbe shadow_copy2: factor shadow_copy2_posix_gmt_string() out of shadow_copy2_insert_string()
for re-use..

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:21 +13:00
Michael Adam
304a0f531c shadow_copy2: shadow_copy2_insert_string(): do not prepend a "/" in absolute mode
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:20 +13:00
Michael Adam
e86923eb52 shadow_copy2: make shadow_copy2_find_snapdir() return const char *
instead of char *. This eliminates compiler warnings.
snapdir is a const string in all occasions.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:18 +13:00
Michael Adam
dbdb436a80 shadow_copy2: in the classical case, use configured path in shadow_copy2_find_snapdir()
There is no point in searching for snapdir if not in snapdirseverywhere mode.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:17 +13:00
Michael Adam
ea898ea1ac shadow_copy2: implement disk_free
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:15 +13:00
Michael Adam
c4f9954ebb shadow_copy2: log resulting config at the end of shadow_copy2_connect()
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:14 +13:00
Michael Adam
a7ca55c8da shadow_copy2: add snapshot_basepath to the config.
This is the absolute version of snapdir.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:13 +13:00
Michael Adam
d34dc1b002 shadow_copy2: add rel_connectpath to config.
This is the share root, relative to the basedir.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:11 +13:00
Michael Adam
2d5a3af4bc shadow_copy2: introduce "shadow:mountpoint" option
Possiblity to explicitly set the share's mount point.
This is useful mainly for debugging and testing purposes.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:10 +13:00
Michael Adam
ed751b9ee4 shadow_copy2: re-add the basedir option.
Disable basedir if it is not an absolute path or if
snapdirseverywhere or crossmountpoints is enabled.

Pair-Programmed-With: Björn Baumbach <bb@sernet.de>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Björn Baumbach <bb@sernet.de>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:09 +13:00
Michael Adam
1e887fcda0 shadow_copy2: disable "snapdir:crossmountpoints" if the snapdir is absolute.
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:07 +13:00
Michael Adam
843954989c shadow_copy2: introduce the bool "snapdir_absolute" in the config.
Not exposed but to be used internally.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:05 +13:00
Michael Adam
1ecef57435 shadow_copy2: introduce config struct and function shadow_copy2_connect()
This moves the parsing of the config to a central place.
So users of configuation don't need to call lp_parm_... all the time.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:21:01 +13:00
Michael Adam
5c900fd930 shadow_copy2: add comment block explaining shadow_copy2_convert()
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:20:58 +13:00
Michael Adam
5da5512985 shadow_copy2: add comment block explaining shadow_copy2_insert_string()
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:20:56 +13:00
Michael Adam
b90d1e6ac0 shadow_copy2: add comment block explaining shadow_copy2_find_snapdir()
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:20:55 +13:00
Michael Adam
5b494b3dea shadow_copy2: add header comment explaining have_snapdir()
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:20:53 +13:00
Michael Adam
9361824ddd shadow_copy2: add comment header describing shadow_copy2_strip_snapshot()
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:20:51 +13:00
Michael Adam
01cb88977d shadow_copy2: break overly long lines in shadow_copy2_snapshot_to_gmt()
According to coding guidelines.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05 09:20:49 +13:00
Christof Schmitt
c8c0632c87 s3:smb2_find: Return that timestamps do not exist as directories
When a Windows client receives a large directory listing while
querying snapshots, it sends a find request asking for the
timestamp as a directory. A Windows server returns NO_SUCH_FILE,
so make sure Samba returns the same. Otherwise the client will
get confused and display timestamps in the 'previous versions' dialog.

Signed-off-by: Christof Schmitt <christof.schmitt@us.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Sep 10 22:38:51 CEST 2013 on sn-devel-104
2013-09-10 22:38:50 +02:00
Volker Lendecke
e0e5953494 vfs: Convert shadow_copy2_ntimes to cp_smb_filename
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:55 -07:00
Volker Lendecke
33037d80d5 vfs: Convert shadow_copy2_unlink to cp_smb_filename
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17 14:49:55 -07:00
Andrew Bartlett
c8ade07760 smbd: Add mem_ctx to {f,}get_nt_acl VFS call
This makes it clear which context the returned SD is allocated on, as
a number of callers do not want it on talloc_tos().

As the ACL transformation allocates and then no longer needs a great
deal of memory, a talloc_stackframe() call is used to contain the
memory that is not returned further up the stack.

Andrew Bartlett
2012-10-11 12:25:11 +11:00
Andrew Bartlett
f2ccff7b06 s3-vfs: Try to be consistent about localtime vs GMT handling in vfs_shadow_copy2
With the ability to handle times a abolute time_t values since 1970
this becomes more important to get absolutly correct.

Andrew Bartlett
2012-08-28 15:47:37 +10:00
Andrew Bartlett
de209587f9 s3-vfs_shadow_copy2: Also accept a sscanf result 2012-08-28 15:47:03 +10:00
Björn Jacke
dab8fe5dea vfs_time_audit: Remove unnecessary return; statement 2012-08-08 00:21:26 +02:00
Stefan Metzmacher
7bc328dcb0 s3:modules: we don't need smbd/proto.h in vfs_shadow_copy2.c
metze
2012-06-06 10:18:39 +02:00
Christian Ambach
2ae02efabd s3:vfs/shadow_copy2 fix some compiler warnings
about unused variables

Autobuild-User: Christian Ambach <ambi@samba.org>
Autobuild-Date: Tue May  8 11:15:07 CEST 2012 on sn-devel-104
2012-05-08 11:15:07 +02:00
Christian Ambach
617b63658b s3:vfs/shadow_copy2 make descending sort order the default
otherwise Explorer won't work correctly when trying to restore a folder
2012-05-08 09:26:07 +02:00
Andrew Bartlett
19eee33d82 s3-vfs: Remove unused lremovexattr call from VFS modules, system.c and configure
If this is ever needed again, it would be more appropriate as an options argument
to removexattr.

Andrew Bartlett
2012-04-05 13:39:01 +10:00
Andrew Bartlett
c70ac29c54 s3-vfs: Remove unused lsetxattr call from VFS modules, system.c and configure
If this is ever needed again, it would be more appropriate as an options argument
to listxattr.

Andrew Bartlett
2012-04-05 13:39:00 +10:00
Andrew Bartlett
b2f7cfa848 s3-vfs: Remove unused lgetxattr call from VFS modules, system.c and configure 2012-04-05 13:39:00 +10:00
Andrew Bartlett
f6e0532024 build: Remove SMB_STRUCT_DIR define 2012-04-05 02:39:09 +02:00
Andrew Bartlett
2320b2144f build: Remove SMB_STRUCT_DIRENT define 2012-04-05 02:39:09 +02: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
Rusty Russell
b10ad70f8f tdb2: fix build with --enable-tdb2
tdb2 doesn't expost tdb_jenkins_hash; go straight to the source in
ccan/hash.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-08-31 13:56:40 +09:30
Volker Lendecke
dc461cade5 s3: Fix the build, NAME_MAX not universally available
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Mon Jun 20 13:45:21 CEST 2011 on sn-devel-104
2011-06-20 13:45:21 +02:00
Volker Lendecke
a8c3d38bc8 s3: Replace shadow_copy2 with a new implementation
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Mon Jun 20 11:17:47 CEST 2011 on sn-devel-104
2011-06-20 11:17:47 +02:00