[SSSD] [PATCHES] views: allow view name change at startup

Jakub Hrozek jhrozek at redhat.com
Sat Nov 22 14:39:45 UTC 2014


On Wed, Nov 19, 2014 at 01:36:02PM +0100, Sumit Bose wrote:
> Hi,
> 
> with this patch SSSD can switch to a new view at startup. There is a
> todo in the third patch. Currently the user and group entries are only
> invalidated so that the new view/override data is checked at the next
> request for the given object. Additionally we might want to start a
> background task with refreshes the existing entries in the cache
> unconditionally. But this might result in unwanted network peaks during
> startup. So I left the implementation for a later patch, if this is
> needed.
> 
> bye,
> Sumit

Do these patches depend on some other patchset? I'm getting:

/home/remote/jhrozek/devel/sssd/src/tests/cmocka/test_sysdb_views.c:237:59: error: use of undeclared identifier 'TEST_VIEW_NAME'
    ret = sysdb_update_view_name(test_ctx->domain->sysdb, TEST_VIEW_NAME);
                                                          ^
/home/remote/jhrozek/devel/sssd/src/tests/cmocka/test_sysdb_views.c:240:46: error: use of undeclared identifier 'TEST_USER_NAME'
    ret = sysdb_store_user(test_ctx->domain, TEST_USER_NAME, NULL,
                                             ^
/home/remote/jhrozek/devel/sssd/src/tests/cmocka/test_sysdb_views.c:246:65: error: use of undeclared identifier 'TEST_USER_NAME'
    ret = sysdb_search_user_by_name(test_ctx, test_ctx->domain, TEST_USER_NAME,
                                                                ^
/home/remote/jhrozek/devel/sssd/src/tests/cmocka/test_sysdb_views.c:255:34: error: use of undeclared identifier 'TEST_ANCHOR_PREFIX'
                                 TEST_ANCHOR_PREFIX TEST_USER_SID);
                                 ^
/home/remote/jhrozek/devel/sssd/src/tests/cmocka/test_sysdb_views.c:258:50: error: use of undeclared identifier 'TEST_VIEW_NAME'
    ret = sysdb_store_override(test_ctx->domain, TEST_VIEW_NAME,
                                                 ^
/home/remote/jhrozek/devel/sssd/src/tests/cmocka/test_sysdb_views.c:272:59: error: use of undeclared identifier 'TEST_VIEW_NAME'
    ret = sysdb_delete_view_tree(test_ctx->domain->sysdb, TEST_VIEW_NAME);
                                                          ^
  CC       src/responder/ifp/ifp_tests-ifpsrv_util.o
/home/remote/jhrozek/devel/sssd/src/tests/cmocka/test_sysdb_views.c:299:59: error: use of undeclared identifier 'TEST_VIEW_NAME'
    ret = sysdb_update_view_name(test_ctx->domain->sysdb, TEST_VIEW_NAME);
                                                          ^
/home/remote/jhrozek/devel/sssd/src/tests/cmocka/test_sysdb_views.c:302:46: error: use of undeclared identifier 'TEST_USER_NAME'
    ret = sysdb_store_user(test_ctx->domain, TEST_USER_NAME, NULL,
                                             ^
/home/remote/jhrozek/devel/sssd/src/tests/cmocka/test_sysdb_views.c:308:65: error: use of undeclared identifier 'TEST_USER_NAME'
    ret = sysdb_search_user_by_name(test_ctx, test_ctx->domain, TEST_USER_NAME,
                                                                ^
/home/remote/jhrozek/devel/sssd/src/tests/cmocka/test_sysdb_views.c:317:34: error: use of undeclared identifier 'TEST_ANCHOR_PREFIX'
                                 TEST_ANCHOR_PREFIX TEST_USER_SID);
                                 ^
  CC       src/responder/common/ifp_tests-responder_utils.o
/home/remote/jhrozek/devel/sssd/src/tests/cmocka/test_sysdb_views.c:320:50: error: use of undeclared identifier 'TEST_VIEW_NAME'
    ret = sysdb_store_override(test_ctx->domain, TEST_VIEW_NAME,
                                                 ^
/home/remote/jhrozek/devel/sssd/src/tests/cmocka/test_sysdb_views.c:328:59: error: use of undeclared identifier 'TEST_VIEW_NAME'
    ret = sysdb_delete_view_tree(test_ctx->domain->sysdb, TEST_VIEW_NAME);
                                                          ^
/home/remote/jhrozek/devel/sssd/src/tests/cmocka/test_sysdb_views.c:331:65: error: use of undeclared identifier 'TEST_USER_NAME'
    ret = sysdb_search_user_by_name(test_ctx, test_ctx->domain, TEST_USER_NAME,
                                                                ^
/home/remote/jhrozek/devel/sssd/src/tests/cmocka/test_sysdb_views.c:341:65: error: use of undeclared identifier 'TEST_USER_NAME'
    ret = sysdb_search_user_by_name(test_ctx, test_ctx->domain, TEST_USER_NAME,
                                                                ^
14 errors generated.


> From 1b7c7b26edb55f238b1649c730cb277b57c60f46 Mon Sep 17 00:00:00 2001
> From: Sumit Bose <sbose at redhat.com>
> Date: Wed, 12 Nov 2014 12:43:23 +0100
> Subject: [PATCH 1/3] sysdb: add sysdb_delete_view_tree()
> 
> ---
>  src/db/sysdb.h                      |  2 ++
>  src/db/sysdb_views.c                | 34 ++++++++++++++++++++
>  src/tests/cmocka/test_sysdb_views.c | 63 +++++++++++++++++++++++++++++++++++++
>  3 files changed, 99 insertions(+)
> 
> diff --git a/src/db/sysdb.h b/src/db/sysdb.h
> index 7a51117..a3ffa7b 100644
> --- a/src/db/sysdb.h
> +++ b/src/db/sysdb.h
> @@ -444,6 +444,8 @@ errno_t sysdb_update_view_name(struct sysdb_ctx *sysdb, const char *view_name);
>  errno_t sysdb_get_view_name(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb,
>                              char **view_name);
>  
> +errno_t sysdb_delete_view_tree(struct sysdb_ctx *sysdb, const char *view_name);
> +

Looks like some of the functions accept sysdb_ctx and some accept
sss_domain_info. I generally prefer sss_domain_info as sysdb_ctx seems like a
bit low-level property that should ideally be used in the sysdb module only.

If you agree, can you file a ticket to unify the API?


> From 383584a035b9442eb4d50d0ff08f06b6d0cf348a Mon Sep 17 00:00:00 2001
> From: Sumit Bose <sbose at redhat.com>
> Date: Wed, 12 Nov 2014 16:26:55 +0100
> Subject: [PATCH 2/3] sysdb: add sysdb_invalidate_overrides()

Looks good to me.

> From 1cecb49aac804396c1b61812f6d2b6ea076cccc3 Mon Sep 17 00:00:00 2001
> From: Sumit Bose <sbose at redhat.com>
> Date: Wed, 12 Nov 2014 16:30:57 +0100
> Subject: [PATCH 3/3] views: allow view name change at startup
> 
> Currently some manual steps are needed on a FreeIPA to switch from one
> view to another. With this patch the IPA provider checks at startup if
> the view name changed and does the needed steps automatically. Besides
> saving the new view name this includes removing the old view data and
> marking the user and group entries as invalid.

The code looks good, but I always get:
(Sat Nov 22 15:37:28 2014) [sssd[be[ipa.example.com]]]
[ipa_get_view_name_done] (0x0020): View name changed, this is currently
not supported!

When switching from one view to another...I tested using idview-unapply
and then idview-apply to another view, is there some other way?



More information about the sssd-devel mailing list