The Samba-Bugzilla – Attachment 13594 Details for
Bug 13027
shadow_copy2 calls smb_panic on unreadable parent directory
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am fix for master
0001-s3-modules-shadow_copy2-Cope-with-GETWD-failing-insi.patch (text/plain), 1.96 KB, created by
Jeremy Allison
on 2017-09-13 18:39:16 UTC
(
hide
)
Description:
git-am fix for master
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2017-09-13 18:39:16 UTC
Size:
1.96 KB
patch
obsolete
>From f0189678cee71d468f78033d826ea894b048d78d Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Wed, 13 Sep 2017 11:37:29 -0700 >Subject: [PATCH] s3: modules: shadow_copy2: Cope with GETWD() failing inside > CHDIR(). > >Fail the CHDIR(). > >Signed-off-by: Jeremy Allison <jra@samba.org> >--- > source3/modules/vfs_shadow_copy2.c | 20 +++++++++++++++----- > 1 file changed, 15 insertions(+), 5 deletions(-) > >diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c >index 6a123092a5e..3266c9d9c58 100644 >--- a/source3/modules/vfs_shadow_copy2.c >+++ b/source3/modules/vfs_shadow_copy2.c >@@ -1519,21 +1519,27 @@ static int shadow_copy2_chown(vfs_handle_struct *handle, > return ret; > } > >-static void store_cwd_data(vfs_handle_struct *handle, >+static int store_cwd_data(vfs_handle_struct *handle, > const char *connectpath) > { > struct shadow_copy2_private *priv = NULL; > struct smb_filename *cwd_fname = NULL; > > SMB_VFS_HANDLE_GET_DATA(handle, priv, struct shadow_copy2_private, >- return); >+ return -1); > >- TALLOC_FREE(priv->shadow_cwd); > cwd_fname = SMB_VFS_NEXT_GETWD(handle, talloc_tos()); > if (cwd_fname == NULL) { >- smb_panic("getwd failed\n"); >+ return -1; > } > DBG_DEBUG("shadow cwd = %s\n", cwd_fname->base_name); >+ >+ /* >+ * Now we're modifying the priv data. Any >+ * failures here are terminal. >+ */ >+ >+ TALLOC_FREE(priv->shadow_cwd); > priv->shadow_cwd = talloc_strdup(priv, cwd_fname->base_name); > TALLOC_FREE(cwd_fname); > if (priv->shadow_cwd == NULL) { >@@ -1547,6 +1553,7 @@ static void store_cwd_data(vfs_handle_struct *handle, > smb_panic("talloc failed\n"); > } > } >+ return 0; > } > > static int shadow_copy2_chdir(vfs_handle_struct *handle, >@@ -1606,7 +1613,10 @@ static int shadow_copy2_chdir(vfs_handle_struct *handle, > TALLOC_FREE(conv); > conv = snappath; > } >- store_cwd_data(handle, conv); >+ ret = store_cwd_data(handle, conv); >+ if (ret == -1) { >+ saved_errno = errno; >+ } > } > > TALLOC_FREE(stripped); >-- >2.11.0 >
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 13027
:
13594
|
13601
|
13646
|
13651
|
13676