The Samba-Bugzilla – Attachment 14235 Details for
Bug 13474
Incorrect talloc_stackframe handling in python ACL test code (make_simple_acl).
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am fix for 4.8.next, 4.7.next
0001-python-Fix-talloc-frame-use-in-make_simple_acl.patch (text/plain), 3.70 KB, created by
Jeremy Allison
on 2018-06-14 21:15:24 UTC
(
hide
)
Description:
git-am fix for 4.8.next, 4.7.next
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2018-06-14 21:15:24 UTC
Size:
3.70 KB
patch
obsolete
>From 16cfbe3879d368921fb2eac17432264b43b4ba00 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Thu, 14 Jun 2018 14:08:36 -0700 >Subject: [PATCH] python: Fix talloc frame use in make_simple_acl(). > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13474 > >Signed-off-by: Jeremy Allison <jra@samba.org> >--- > source3/smbd/pysmbd.c | 49 +++++++++++++++++++++++-------------------- > 1 file changed, 26 insertions(+), 23 deletions(-) > >diff --git a/source3/smbd/pysmbd.c b/source3/smbd/pysmbd.c >index be30b866e20..41b44ad2d42 100644 >--- a/source3/smbd/pysmbd.c >+++ b/source3/smbd/pysmbd.c >@@ -268,101 +268,101 @@ static int set_acl_entry_perms(SMB_ACL_ENTRY_T entry, mode_t perm_mask) > return 0; > } > >-static SMB_ACL_T make_simple_acl(gid_t gid, mode_t chmod_mode) >+static SMB_ACL_T make_simple_acl(TALLOC_CTX *mem_ctx, >+ gid_t gid, >+ mode_t chmod_mode) > { >- TALLOC_CTX *frame = talloc_stackframe(); >- > mode_t mode = SMB_ACL_READ|SMB_ACL_WRITE|SMB_ACL_EXECUTE; > > mode_t mode_user = (chmod_mode & 0700) >> 6; > mode_t mode_group = (chmod_mode & 070) >> 3; > mode_t mode_other = chmod_mode & 07; > SMB_ACL_ENTRY_T entry; >- SMB_ACL_T acl = sys_acl_init(frame); >+ SMB_ACL_T acl = sys_acl_init(mem_ctx); > > if (!acl) { > return NULL; > } > > if (sys_acl_create_entry(&acl, &entry) != 0) { >- TALLOC_FREE(frame); >+ TALLOC_FREE(acl); > return NULL; > } > > if (sys_acl_set_tag_type(entry, SMB_ACL_USER_OBJ) != 0) { >- TALLOC_FREE(frame); >+ TALLOC_FREE(acl); > return NULL; > } > > if (set_acl_entry_perms(entry, mode_user) != 0) { >- TALLOC_FREE(frame); >+ TALLOC_FREE(acl); > return NULL; > } > > if (sys_acl_create_entry(&acl, &entry) != 0) { >- TALLOC_FREE(frame); >+ TALLOC_FREE(acl); > return NULL; > } > > if (sys_acl_set_tag_type(entry, SMB_ACL_GROUP_OBJ) != 0) { >- TALLOC_FREE(frame); >+ TALLOC_FREE(acl); > return NULL; > } > > if (set_acl_entry_perms(entry, mode_group) != 0) { >- TALLOC_FREE(frame); >+ TALLOC_FREE(acl); > return NULL; > } > > if (sys_acl_create_entry(&acl, &entry) != 0) { >- TALLOC_FREE(frame); >+ TALLOC_FREE(acl); > return NULL; > } > > if (sys_acl_set_tag_type(entry, SMB_ACL_OTHER) != 0) { >- TALLOC_FREE(frame); >+ TALLOC_FREE(acl); > return NULL; > } > > if (set_acl_entry_perms(entry, mode_other) != 0) { >- TALLOC_FREE(frame); >+ TALLOC_FREE(acl); > return NULL; > } > > if (gid != -1) { > if (sys_acl_create_entry(&acl, &entry) != 0) { >- TALLOC_FREE(frame); >+ TALLOC_FREE(acl); > return NULL; > } > > if (sys_acl_set_tag_type(entry, SMB_ACL_GROUP) != 0) { >- TALLOC_FREE(frame); >+ TALLOC_FREE(acl); > return NULL; > } > > if (sys_acl_set_qualifier(entry, &gid) != 0) { >- TALLOC_FREE(frame); >+ TALLOC_FREE(acl); > return NULL; > } > > if (set_acl_entry_perms(entry, mode_group) != 0) { >- TALLOC_FREE(frame); >+ TALLOC_FREE(acl); > return NULL; > } > } > > if (sys_acl_create_entry(&acl, &entry) != 0) { >- TALLOC_FREE(frame); >+ TALLOC_FREE(acl); > return NULL; > } > > if (sys_acl_set_tag_type(entry, SMB_ACL_MASK) != 0) { >- TALLOC_FREE(frame); >+ TALLOC_FREE(acl); > return NULL; > } > > if (set_acl_entry_perms(entry, mode) != 0) { >- TALLOC_FREE(frame); >+ TALLOC_FREE(acl); > return NULL; > } > return acl; >@@ -386,17 +386,20 @@ static PyObject *py_smbd_set_simple_acl(PyObject *self, PyObject *args, PyObject > &fname, &mode, &gid, &service)) > return NULL; > >- acl = make_simple_acl(gid, mode); >- > frame = talloc_stackframe(); > >+ acl = make_simple_acl(frame, gid, mode); >+ if (acl == NULL) { >+ TALLOC_FREE(frame); >+ return NULL; >+ } >+ > conn = get_conn(frame, service); > if (!conn) { > return NULL; > } > > ret = set_sys_acl_conn(fname, SMB_ACL_TYPE_ACCESS, acl, conn); >- TALLOC_FREE(acl); > > if (ret != 0) { > TALLOC_FREE(frame); >-- >2.18.0.rc1.244.gcf134e6275-goog >
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
Flags:
metze
:
review+
slow
:
review+
Actions:
View
Attachments on
bug 13474
: 14235 |
14321