diff options
author | Simo Sorce <ssorce@redhat.com> | 2009-02-25 19:36:43 -0500 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2009-02-26 18:31:52 -0500 |
commit | 60bbc5034e546b7df7a6f782e3353b863f49618b (patch) | |
tree | cb8e8fc899c38ec78e71068c4b59ab8bb643117f /server/responder/nss/nsssrv.c | |
parent | 89579fee5961b1dccfd59b431f0fbe160cacc2b7 (diff) | |
download | sssd-60bbc5034e546b7df7a6f782e3353b863f49618b.tar.gz sssd-60bbc5034e546b7df7a6f782e3353b863f49618b.tar.xz sssd-60bbc5034e546b7df7a6f782e3353b863f49618b.zip |
Serialize access to sysdb and also exposes ldb transactions.
This is necessary because in ldb only 1 transaction per context is possible
and all operations (or new transactions) are nested within it.
Will revisit this later when ldb will addresses the problem.
Diffstat (limited to 'server/responder/nss/nsssrv.c')
-rw-r--r-- | server/responder/nss/nsssrv.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/server/responder/nss/nsssrv.c b/server/responder/nss/nsssrv.c index 0c5fd4ccb..2fbe39706 100644 --- a/server/responder/nss/nsssrv.c +++ b/server/responder/nss/nsssrv.c @@ -397,7 +397,15 @@ failed: * only ASCII names for now */ static int _domain_comparator(const void *key1, const void *key2) { - return strcasecmp((const char *)key1, (const char *)key2); + int ret; + + ret = strcasecmp((const char *)key1, (const char *)key2); + if (ret) { + /* special case LOCAL to be always the first domain */ + if (strcmp(key1, "LOCAL") == 0) return 1; + if (strcmp(key2, "LOCAL") == 0) return -1; + } + return ret; } static int nss_init_domains(struct nss_ctx *nctx) |