The Samba-Bugzilla – Attachment 15682 Details for
Bug 14216
vfs_ceph_snapshots fails to find snapdir for relative paths at share root
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
fix, currently undergoing testing
0001-vfs_ceph_snapshots-fix-root-relative-path-handling.patch (text/plain), 1.71 KB, created by
David Disseldorp
on 2019-12-13 10:08:53 UTC
(
hide
)
Description:
fix, currently undergoing testing
Filename:
MIME Type:
Creator:
David Disseldorp
Created:
2019-12-13 10:08:53 UTC
Size:
1.71 KB
patch
obsolete
>From 1517c7669358a56da9a02e1635b15c93acfea59a Mon Sep 17 00:00:00 2001 >From: David Disseldorp <ddiss@samba.org> >Date: Thu, 12 Dec 2019 22:14:50 +0100 >Subject: [PATCH] vfs_ceph_snapshots: fix root relative path handling > >For file paths relative to root, ceph_snap_get_parent_path() may return >an empty parent dir string, in which case the CephFS snashot path should >be ".snap". > >Bug: https://bugzilla.samba.org/show_bug.cgi?id=14216 > >Signed-off-by: David Disseldorp <ddiss@samba.org> >--- > source3/modules/vfs_ceph_snapshots.c | 14 +++++++++++--- > 1 file changed, 11 insertions(+), 3 deletions(-) > >diff --git a/source3/modules/vfs_ceph_snapshots.c b/source3/modules/vfs_ceph_snapshots.c >index 52439da2604..95a0c8d010d 100644 >--- a/source3/modules/vfs_ceph_snapshots.c >+++ b/source3/modules/vfs_ceph_snapshots.c >@@ -401,8 +401,12 @@ static int ceph_snap_get_shadow_copy_data(struct vfs_handle_struct *handle, > parent_dir = tmp; > } > >- ret = snprintf(snaps_path, sizeof(snaps_path), "%s/%s", >- parent_dir, snapdir); >+ if (strlen(parent_dir) == 0) { >+ ret = strlcpy(snaps_path, snapdir, sizeof(snaps_path)); >+ } else { >+ ret = snprintf(snaps_path, sizeof(snaps_path), "%s/%s", >+ parent_dir, snapdir); >+ } > if (ret >= sizeof(snaps_path)) { > ret = -EINVAL; > goto err_out; >@@ -545,7 +549,11 @@ static int ceph_snap_gmt_convert_dir(struct vfs_handle_struct *handle, > /* > * Temporally use the caller's return buffer for this. > */ >- ret = snprintf(_converted_buf, buflen, "%s/%s", name, snapdir); >+ if (strlen(name) == 0) { >+ ret = strlcpy(_converted_buf, snapdir, buflen); >+ } else { >+ ret = snprintf(_converted_buf, buflen, "%s/%s", name, snapdir); >+ } > if (ret >= buflen) { > ret = -EINVAL; > goto err_out; >-- >2.16.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 14216
:
15682
|
15719