summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-03-06 18:47:15 +0100
committerStephen Gallagher <sgallagh@redhat.com>2012-03-06 15:29:18 -0500
commit9729b24935f9b717234728b2d2cfb4ca49df307b (patch)
tree161795118852bb8d3bc420869077bc20437fe0bb /src
parentee6e61781536a0ef34491cea74e91c36ee439df9 (diff)
downloadsssd-9729b24935f9b717234728b2d2cfb4ca49df307b.tar.gz
sssd-9729b24935f9b717234728b2d2cfb4ca49df307b.tar.bz2
sssd-9729b24935f9b717234728b2d2cfb4ca49df307b.zip
Search netgroups by alias, too
https://fedorahosted.org/sssd/ticket/1228
Diffstat (limited to 'src')
-rw-r--r--src/db/sysdb.h4
-rw-r--r--src/db/sysdb_search.c4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
index 5cec8484..53dbd7c1 100644
--- a/src/db/sysdb.h
+++ b/src/db/sysdb.h
@@ -143,8 +143,8 @@
#define SYSDB_GETCACHED_FILTER "(&"SYSDB_UC")("SYSDB_LAST_LOGIN">=%lu))"
-#define SYSDB_NETGR_FILTER "(&("SYSDB_NC")("SYSDB_NAME"=%s))"
-#define SYSDB_NETGR_TRIPLES_FILTER "(|("SYSDB_NAME"=%s)("SYSDB_MEMBEROF"=%s))"
+#define SYSDB_NETGR_FILTER "(&("SYSDB_NC")(|("SYSDB_NAME_ALIAS"=%s)("SYSDB_NAME"=%s)))"
+#define SYSDB_NETGR_TRIPLES_FILTER "(|("SYSDB_NAME"=%s)("SYSDB_NAME_ALIAS"=%s)("SYSDB_MEMBEROF"=%s))"
#define SYSDB_HAS_ENUMERATED "has_enumerated"
diff --git a/src/db/sysdb_search.c b/src/db/sysdb_search.c
index 2a09c5b4..1ab94770 100644
--- a/src/db/sysdb_search.c
+++ b/src/db/sysdb_search.c
@@ -786,7 +786,8 @@ errno_t sysdb_getnetgr(TALLOC_CTX *mem_ctx,
lret = ldb_search(sysdb->ldb, tmp_ctx, &result, base_dn,
LDB_SCOPE_SUBTREE, attrs,
SYSDB_NETGR_TRIPLES_FILTER,
- sanitized_netgroup, netgroup_dn);
+ sanitized_netgroup, sanitized_netgroup,
+ netgroup_dn);
ret = sysdb_error_to_errno(lret);
if (ret != EOK) {
goto done;
@@ -832,6 +833,7 @@ int sysdb_get_netgroup_attr(TALLOC_CTX *mem_ctx,
ret = ldb_search(sysdb->ldb, tmp_ctx, &result, base_dn,
LDB_SCOPE_SUBTREE, attributes,
SYSDB_NETGR_FILTER,
+ sanitized_netgroup,
sanitized_netgroup);
if (ret) {
ret = sysdb_error_to_errno(ret);