summaryrefslogtreecommitdiff
path: root/source3/modules
diff options
context:
space:
mode:
authorChristian Ambach <christian.ambach@de.ibm.com>2010-04-14 10:05:56 +0200
committerVolker Lendecke <vl@samba.org>2010-08-04 13:56:11 +0200
commitb77f241b28bcf29a88e28a49623a5e99a356bb34 (patch)
treea4126a86f444608f14cd24c06e601c6d41f02925 /source3/modules
parentcc2aa855a3cc690716233bde57ae74711813db0f (diff)
downloadsamba-b77f241b28bcf29a88e28a49623a5e99a356bb34.tar.gz
samba-b77f241b28bcf29a88e28a49623a5e99a356bb34.tar.bz2
samba-b77f241b28bcf29a88e28a49623a5e99a356bb34.zip
fix snapshot content display with hide unreadable
With the hide unreadable option set, snapshots are be displayed as empty with shadow_copy2 and a NFSv4 ACL module. To prevent multiple conversions of the paths when the acl call does a VFS_STAT (as the nfs4acl code does), a check was added to convert_shadow2_name() so it will not touch paths any more that look like they have already been converted. Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/vfs_shadow_copy2.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c
index 3cf681fde8..34792de97b 100644
--- a/source3/modules/vfs_shadow_copy2.c
+++ b/source3/modules/vfs_shadow_copy2.c
@@ -411,7 +411,7 @@ static char *convert_shadow2_name(vfs_handle_struct *handle, const char *fname,
TALLOC_CTX *tmp_ctx = talloc_new(handle->data);
const char *snapdir, *relpath, *baseoffset, *basedir;
size_t baselen;
- char *ret;
+ char *ret, *prefix;
struct tm timestamp;
time_t timestamp_t;
@@ -435,6 +435,13 @@ static char *convert_shadow2_name(vfs_handle_struct *handle, const char *fname,
return NULL;
}
+ prefix = talloc_asprintf(tmp_ctx, "%s/@GMT-", snapdir);
+ if (strncmp(fname, prefix, strlen(prefix)) == 0) {
+ /* this looks like as we have already normalized it, leave it untouched*/
+ talloc_free(tmp_ctx);
+ return talloc_strdup(handle->data, fname);
+ }
+
if (strncmp(fname, "@GMT-", 5) != 0) {
fname = shadow_copy2_normalise_path(tmp_ctx, fname, gmt_path);
if (fname == NULL) {