diff options
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 0c5fd4cc..2fbe3970 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) |