[SSSD] [PATCH] AD: Remove unused memory context from ad_user_conn_list

Petr Cech pcech at redhat.com
Wed Nov 11 06:37:41 UTC 2015


On 11/09/2015 07:44 AM, Lukas Slebodnik wrote:
> ehlo,
>
> simple patch is attached.
>
> LS
>
>
> 0001-AD-Remove-unused-memory-context-from-ad_user_conn_li.patch
>
>
>  From cec2a8d6e72324d6a80a1df832230567f8b4c819 Mon Sep 17 00:00:00 2001
> From: Lukas Slebodnik<lslebodn at redhat.com>
> Date: Fri, 23 Oct 2015 23:16:53 +0200
> Subject: [PATCH] AD: Remove unused memory context from ad_user_conn_list
>
> ---
>   src/providers/ad/ad_common.c      | 3 +--
>   src/providers/ad/ad_common.h      | 3 +--
>   src/providers/ad/ad_id.c          | 2 +-
>   src/tests/cmocka/test_ad_common.c | 6 ++----
>   4 files changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/src/providers/ad/ad_common.c b/src/providers/ad/ad_common.c
> index ffc1351241e1874ebd37fb4a865ad5822cdea479..665e6ec4c50c22bca329a42309f7b465bc5ff5de 100644
> --- a/src/providers/ad/ad_common.c
> +++ b/src/providers/ad/ad_common.c
> @@ -1289,8 +1289,7 @@ ad_ldap_conn_list(TALLOC_CTX *mem_ctx,
>   }
>
>   struct sdap_id_conn_ctx **
> -ad_user_conn_list(TALLOC_CTX *mem_ctx,
> -                  struct ad_id_ctx *ad_ctx,
> +ad_user_conn_list(struct ad_id_ctx *ad_ctx,
>                     struct sss_domain_info *dom)
>   {
>       struct sdap_id_conn_ctx **clist;
> diff --git a/src/providers/ad/ad_common.h b/src/providers/ad/ad_common.h
> index 0cefa1859aaa75731267917e66ab9a1905528e91..de6ffbff7d20f582c2689383f3d51e027e58277c 100644
> --- a/src/providers/ad/ad_common.h
> +++ b/src/providers/ad/ad_common.h
> @@ -154,8 +154,7 @@ ad_ldap_conn_list(TALLOC_CTX *mem_ctx,
>                     struct sss_domain_info *dom);
>
>   struct sdap_id_conn_ctx **
> -ad_user_conn_list(TALLOC_CTX *mem_ctx,
> -                  struct ad_id_ctx *ad_ctx,
> +ad_user_conn_list(struct ad_id_ctx *ad_ctx,
>                     struct sss_domain_info *dom);
>
>   struct sdap_id_conn_ctx *
> diff --git a/src/providers/ad/ad_id.c b/src/providers/ad/ad_id.c
> index 45ea15a9abba417aa32a34768228b9f53b9ad71b..14a09c537461d8ef21a9c6f5155ce45e9e6cafcd 100644
> --- a/src/providers/ad/ad_id.c
> +++ b/src/providers/ad/ad_id.c
> @@ -247,7 +247,7 @@ get_conn_list(struct be_req *breq, struct ad_id_ctx *ad_ctx,
>
>       switch (ar->entry_type & BE_REQ_TYPE_MASK) {
>       case BE_REQ_USER: /* user */
> -        clist = ad_user_conn_list(breq, ad_ctx, dom);
> +        clist = ad_user_conn_list(ad_ctx, dom);
>           break;
>       case BE_REQ_BY_SECID:   /* by SID */
>       case BE_REQ_USER_AND_GROUP: /* get SID */
> diff --git a/src/tests/cmocka/test_ad_common.c b/src/tests/cmocka/test_ad_common.c
> index b0cf4b5e6b0559c2896273bfcfb1af99cad195a3..b1929ae35df6ed17c391772009b48dcbf33fa69e 100644
> --- a/src/tests/cmocka/test_ad_common.c
> +++ b/src/tests/cmocka/test_ad_common.c
> @@ -454,8 +454,7 @@ void test_user_conn_list(void **state)
>                                                        struct ad_common_test_ctx);
>       assert_non_null(test_ctx);
>
> -    conn_list = ad_user_conn_list(test_ctx,
> -                                  test_ctx->ad_ctx,
> +    conn_list = ad_user_conn_list(test_ctx->ad_ctx,
>                                     test_ctx->dom);
>       assert_non_null(conn_list);
>
> @@ -464,8 +463,7 @@ void test_user_conn_list(void **state)
>       assert_null(conn_list[1]);
>       talloc_free(conn_list);
>
> -    conn_list = ad_user_conn_list(test_ctx,
> -                                  test_ctx->ad_ctx,
> +    conn_list = ad_user_conn_list(test_ctx->ad_ctx,
>                                     test_ctx->subdom);
>       assert_non_null(conn_list);
>
> -- 2.5.0

Hi Lukáš,

LGTM and CI tests passed:
http://sssd-ci.duckdns.org/logs/job/32/53/summary.html

=> ACK

Regards

Petr


More information about the sssd-devel mailing list