The branch, master has been updated via f1d4b27 Remove obsolete README.packaging4. via e72d8b7 libcli: Simplify desc_ace_has_generic() via 6218e5c libcli: Simplify desc_expand_generic() via 8bb5107 libcli: Avoid an explicit memset call via af83a15 libcli: Avoid a talloc/free via 80ef004 libcli: Avoid a talloc/free from 9487785 s3-build: Support building with in-tree CTDB
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit f1d4b274eee4e36731c37dc218b3c4aec8842c87 Author: Michael Adam <ob...@samba.org> Date: Tue May 27 14:30:10 2014 +0200 Remove obsolete README.packaging4. Signed-off-by: Michael Adam <ob...@samba.org> Reviewed-by: David Disseldorp <dd...@samba.org> Autobuild-User(master): David Disseldorp <dd...@samba.org> Autobuild-Date(master): Tue May 27 19:55:07 CEST 2014 on sn-devel-104 commit e72d8b7acc8d20fe09dcb24298e0839ee1b257f9 Author: Volker Lendecke <v...@samba.org> Date: Tue May 27 07:04:38 2014 +0000 libcli: Simplify desc_ace_has_generic() Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: David Disseldorp <dd...@samba.org> commit 6218e5cbfe9233935060adb54a6c0e3f47e9dc65 Author: Volker Lendecke <v...@samba.org> Date: Tue May 27 07:03:18 2014 +0000 libcli: Simplify desc_expand_generic() Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: David Disseldorp <dd...@samba.org> commit 8bb5107d41b400ceebd260874f37c661248b3d49 Author: Volker Lendecke <v...@samba.org> Date: Mon May 26 21:01:38 2014 +0000 libcli: Avoid an explicit memset call On x86 with -O3, this saves surprising 160 bytes .text Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: David Disseldorp <dd...@samba.org> commit af83a158878b92c933d06c19d5672592f542097b Author: Volker Lendecke <v...@samba.org> Date: Mon May 26 20:57:31 2014 +0000 libcli: Avoid a talloc/free Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: David Disseldorp <dd...@samba.org> commit 80ef004721e6d88bc87e4d1a1e100cb87e81cc93 Author: Volker Lendecke <v...@samba.org> Date: Mon May 26 20:57:31 2014 +0000 libcli: Avoid a talloc/free Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: David Disseldorp <dd...@samba.org> ----------------------------------------------------------------------- Summary of changes: README.packaging4 | 13 ------------- libcli/security/create_descriptor.c | 34 ++++++++++++---------------------- libcli/security/security_token.c | 20 ++++++++++++-------- libcli/security/util_sid.c | 8 ++++---- 4 files changed, 28 insertions(+), 47 deletions(-) delete mode 100644 README.packaging4 Changeset truncated at 500 lines: diff --git a/README.packaging4 b/README.packaging4 deleted file mode 100644 index 0a9bb58..0000000 --- a/README.packaging4 +++ /dev/null @@ -1,13 +0,0 @@ -Debian -====== - -Packages of Samba 4 are regularly uploaded to the Debian and Ubuntu archives. - -http://packages.debian.org/samba4 - -Please see http://wiki.samba.org/index.php/Samba4/Debian for instructions -on building the Samba 4 Debian packages. - -Fedora -====== -A package of Samba 4 is maintained in Fedora. diff --git a/libcli/security/create_descriptor.c b/libcli/security/create_descriptor.c index 23e7e9b..03c0658 100644 --- a/libcli/security/create_descriptor.c +++ b/libcli/security/create_descriptor.c @@ -107,17 +107,14 @@ static bool object_in_list(struct GUID *object_list, struct GUID *object) /* returns true if the ACE gontains generic information * that needs to be processed additionally */ -static bool desc_ace_has_generic(TALLOC_CTX *mem_ctx, - struct security_ace *ace) +static bool desc_ace_has_generic(struct security_ace *ace) { - struct dom_sid *co, *cg; - co = dom_sid_parse_talloc(mem_ctx, SID_CREATOR_OWNER); - cg = dom_sid_parse_talloc(mem_ctx, SID_CREATOR_GROUP); if (ace->access_mask & SEC_GENERIC_ALL || ace->access_mask & SEC_GENERIC_READ || ace->access_mask & SEC_GENERIC_WRITE || ace->access_mask & SEC_GENERIC_EXECUTE) { return true; } - if (dom_sid_equal(&ace->trustee, co) || dom_sid_equal(&ace->trustee, cg)) { + if (dom_sid_equal(&ace->trustee, &global_sid_Creator_Owner) || + dom_sid_equal(&ace->trustee, &global_sid_Creator_Group)) { return true; } return false; @@ -125,19 +122,15 @@ static bool desc_ace_has_generic(TALLOC_CTX *mem_ctx, /* creates an ace in which the generic information is expanded */ -static void desc_expand_generic(TALLOC_CTX *mem_ctx, - struct security_ace *new_ace, +static void desc_expand_generic(struct security_ace *new_ace, struct dom_sid *owner, struct dom_sid *group) { - struct dom_sid *co, *cg; - co = dom_sid_parse_talloc(mem_ctx, SID_CREATOR_OWNER); - cg = dom_sid_parse_talloc(mem_ctx, SID_CREATOR_GROUP); new_ace->access_mask = map_generic_rights_ds(new_ace->access_mask); - if (dom_sid_equal(&new_ace->trustee, co)) { + if (dom_sid_equal(&new_ace->trustee, &global_sid_Creator_Owner)) { new_ace->trustee = *owner; } - if (dom_sid_equal(&new_ace->trustee, cg)) { + if (dom_sid_equal(&new_ace->trustee, &global_sid_Creator_Group)) { new_ace->trustee = *group; } new_ace->flags = 0x0; @@ -179,7 +172,7 @@ static struct security_acl *calculate_inherited_from_parent(TALLOC_CTX *mem_ctx, tmp_acl->aces[tmp_acl->num_aces].flags |= SEC_ACE_FLAG_INHERITED_ACE; /* remove IO flag from the child's ace */ if (ace->flags & SEC_ACE_FLAG_INHERIT_ONLY && - !desc_ace_has_generic(tmp_ctx, ace)) { + !desc_ace_has_generic(ace)) { tmp_acl->aces[tmp_acl->num_aces].flags &= ~SEC_ACE_FLAG_INHERIT_ONLY; } @@ -212,7 +205,7 @@ static struct security_acl *calculate_inherited_from_parent(TALLOC_CTX *mem_ctx, tmp_acl->num_aces++; if (is_container) { if (!(ace->flags & SEC_ACE_FLAG_NO_PROPAGATE_INHERIT) && - (desc_ace_has_generic(tmp_ctx, ace))) { + (desc_ace_has_generic(ace))) { tmp_acl->aces = talloc_realloc(tmp_acl, tmp_acl->aces, struct security_ace, @@ -222,8 +215,7 @@ static struct security_acl *calculate_inherited_from_parent(TALLOC_CTX *mem_ctx, return NULL; } tmp_acl->aces[tmp_acl->num_aces] = *ace; - desc_expand_generic(tmp_ctx, - &tmp_acl->aces[tmp_acl->num_aces], + desc_expand_generic(&tmp_acl->aces[tmp_acl->num_aces], owner, group); tmp_acl->aces[tmp_acl->num_aces].flags = SEC_ACE_FLAG_INHERITED_ACE; @@ -292,10 +284,9 @@ static struct security_acl *process_user_acl(TALLOC_CTX *mem_ctx, /* if the ACE contains CO, CG, GA, GE, GR or GW, and is inheritable * it has to be expanded to two aces, the original as IO, * and another one where these are translated */ - if (desc_ace_has_generic(tmp_ctx, ace)) { + if (desc_ace_has_generic(ace)) { if (!(ace->flags & SEC_ACE_FLAG_CONTAINER_INHERIT)) { - desc_expand_generic(tmp_ctx, - &tmp_acl->aces[tmp_acl->num_aces-1], + desc_expand_generic(&tmp_acl->aces[tmp_acl->num_aces-1], owner, group); } else { @@ -306,8 +297,7 @@ static struct security_acl *process_user_acl(TALLOC_CTX *mem_ctx, tmp_acl->num_aces+1); /* add a new ACE with expanded generic info */ tmp_acl->aces[tmp_acl->num_aces] = *ace; - desc_expand_generic(tmp_ctx, - &tmp_acl->aces[tmp_acl->num_aces], + desc_expand_generic(&tmp_acl->aces[tmp_acl->num_aces], owner, group); tmp_acl->num_aces++; diff --git a/libcli/security/security_token.c b/libcli/security/security_token.c index 40f1382..6812d42 100644 --- a/libcli/security/security_token.c +++ b/libcli/security/security_token.c @@ -84,12 +84,14 @@ bool security_token_is_sid(const struct security_token *token, const struct dom_ bool security_token_is_sid_string(const struct security_token *token, const char *sid_string) { bool ret; - struct dom_sid *sid = dom_sid_parse_talloc(NULL, sid_string); - if (!sid) return false; + struct dom_sid sid; - ret = security_token_is_sid(token, sid); + ret = dom_sid_parse(sid_string, &sid); + if (!ret) { + return false; + } - talloc_free(sid); + ret = security_token_is_sid(token, &sid); return ret; } @@ -117,12 +119,14 @@ bool security_token_has_sid(const struct security_token *token, const struct dom bool security_token_has_sid_string(const struct security_token *token, const char *sid_string) { bool ret; - struct dom_sid *sid = dom_sid_parse_talloc(NULL, sid_string); - if (!sid) return false; + struct dom_sid sid; - ret = security_token_has_sid(token, sid); + ret = dom_sid_parse(sid_string, &sid); + if (!ret) { + return false; + } - talloc_free(sid); + ret = security_token_has_sid(token, &sid); return ret; } diff --git a/libcli/security/util_sid.c b/libcli/security/util_sid.c index 9a24a4a..8e42826 100644 --- a/libcli/security/util_sid.c +++ b/libcli/security/util_sid.c @@ -225,10 +225,10 @@ void sid_copy(struct dom_sid *dst, const struct dom_sid *src) { int i; - ZERO_STRUCTP(dst); - - dst->sid_rev_num = src->sid_rev_num; - dst->num_auths = src->num_auths; + *dst = (struct dom_sid) { + .sid_rev_num = src->sid_rev_num, + .num_auths = src->num_auths, + }; memcpy(&dst->id_auth[0], &src->id_auth[0], sizeof(src->id_auth)); -- Samba Shared Repository