[PATCH] Some small cleanups
Jeremy Allison
jra at samba.org
Wed Mar 1 18:02:46 UTC 2017
On Wed, Mar 01, 2017 at 01:14:50PM +0100, Volker Lendecke wrote:
> Hi!
>
> Review appreciated!
LGTM. Pushed !
> From e8f0993ff58874baf020170085ccf692f87fe554 Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Thu, 9 Feb 2017 18:45:40 +0100
> Subject: [PATCH 1/4] posix_acls: Do a *bit* of reformatting
>
> Makes the next commit a bit more obvious to me
>
> Signed-off-by: Volker Lendecke <vl at samba.org>
> ---
> source3/smbd/posix_acls.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
> index 8187a8b..ae667ef 100644
> --- a/source3/smbd/posix_acls.c
> +++ b/source3/smbd/posix_acls.c
> @@ -3359,8 +3359,11 @@ static NTSTATUS posix_get_nt_acl_common(struct connection_struct *conn,
> num_acls = count_canon_ace_list(file_ace);
> num_def_acls = count_canon_ace_list(dir_ace);
>
> - /* Allocate the ace list. */
> - if ((nt_ace_list = talloc_array(talloc_tos(), struct security_ace,num_acls + num_profile_acls + num_def_acls)) == NULL) {
> + nt_ace_list = talloc_array(
> + talloc_tos(), struct security_ace,
> + num_acls + num_profile_acls + num_def_acls);
> +
> + if (nt_ace_list == NULL) {
> DEBUG(0,("get_nt_acl: Unable to malloc space for nt_ace_list.\n"));
> goto done;
> }
> --
> 2.1.4
>
>
> From 191a697606c0cb849d6be7ea9629291b4143e417 Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Thu, 9 Feb 2017 18:46:06 +0100
> Subject: [PATCH 2/4] posix_acls: Use talloc_zero_array
>
> This is a slight change in behaviour: We now also zero out
> the space for num_profile_acls.
>
> Signed-off-by: Volker Lendecke <vl at samba.org>
> ---
> source3/smbd/posix_acls.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
> index ae667ef..72bb9fe 100644
> --- a/source3/smbd/posix_acls.c
> +++ b/source3/smbd/posix_acls.c
> @@ -3359,7 +3359,7 @@ static NTSTATUS posix_get_nt_acl_common(struct connection_struct *conn,
> num_acls = count_canon_ace_list(file_ace);
> num_def_acls = count_canon_ace_list(dir_ace);
>
> - nt_ace_list = talloc_array(
> + nt_ace_list = talloc_zero_array(
> talloc_tos(), struct security_ace,
> num_acls + num_profile_acls + num_def_acls);
>
> @@ -3368,8 +3368,6 @@ static NTSTATUS posix_get_nt_acl_common(struct connection_struct *conn,
> goto done;
> }
>
> - memset(nt_ace_list, '\0', (num_acls + num_def_acls) * sizeof(struct security_ace) );
> -
> /*
> * Create the NT ACE list from the canonical ace lists.
> */
> --
> 2.1.4
>
>
> From 6b1dec531ab83e5d61270b80f4e02104a13962c0 Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Mon, 20 Feb 2017 18:30:48 +0100
> Subject: [PATCH 3/4] waf: Fix a typo
>
> Signed-off-by: Volker Lendecke <vl at samba.org>
> ---
> buildtools/wafsamba/samba_conftests.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/buildtools/wafsamba/samba_conftests.py b/buildtools/wafsamba/samba_conftests.py
> index 72e4321..511176d 100644
> --- a/buildtools/wafsamba/samba_conftests.py
> +++ b/buildtools/wafsamba/samba_conftests.py
> @@ -24,7 +24,7 @@ def check(self, *k, **kw):
> if not 'env' in kw:
> kw['env'] = self.env.copy()
>
> - # match the configuration test with speficic options, for example:
> + # match the configuration test with specific options, for example:
> # --with-libiconv -> Options.options.iconv_open -> "Checking for library iconv"
> additional_dirs = []
> if 'msg' in kw:
> --
> 2.1.4
>
>
> From dc6d0d0639d7f9d6233ae30d701ba70f8def141a Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Mon, 20 Feb 2017 19:06:14 +0100
> Subject: [PATCH 4/4] winbind: Fix a cut&paste debug typo
>
> We're in cm_connect_netlogon_transport, not in cm_connect_sam
>
> Signed-off-by: Volker Lendecke <vl at samba.org>
> ---
> source3/winbindd/winbindd_cm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
> index c9890ac..3df4af3 100644
> --- a/source3/winbindd/winbindd_cm.c
> +++ b/source3/winbindd/winbindd_cm.c
> @@ -3224,8 +3224,8 @@ static NTSTATUS cm_connect_netlogon_transport(struct winbindd_domain *domain,
>
> result = get_trust_credentials(domain, talloc_tos(), true, &creds);
> if (!NT_STATUS_IS_OK(result)) {
> - DEBUG(10, ("cm_connect_sam: No user available for "
> - "domain %s when trying schannel\n", domain->name));
> + DBG_DEBUG("No user available for domain %s when trying "
> + "schannel\n", domain->name);
> return NT_STATUS_CANT_ACCESS_DOMAIN_INFO;
> }
>
> --
> 2.1.4
>
More information about the samba-technical
mailing list