summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-09-21 12:51:49 +0200
committerStephen Gallagher <sgallagh@redhat.com>2011-09-28 09:22:48 -0400
commitc98298029c51fdbc727536fec7a27795184d04e4 (patch)
tree9cf954c5e1743810fd38a8a4b423cd75a0329353 /src
parent033d1e3985288ec827db85882b052104485606ac (diff)
downloadsssd-c98298029c51fdbc727536fec7a27795184d04e4.tar.gz
sssd-c98298029c51fdbc727536fec7a27795184d04e4.tar.xz
sssd-c98298029c51fdbc727536fec7a27795184d04e4.zip
Return users and groups based on alias
https://fedorahosted.org/sssd/ticket/926
Diffstat (limited to 'src')
-rw-r--r--src/db/sysdb.h6
-rw-r--r--src/db/sysdb_search.c7
-rw-r--r--src/responder/pam/pam_LOCAL_domain.c5
3 files changed, 10 insertions, 8 deletions
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
index 138e7df82..2985a1a0c 100644
--- a/src/db/sysdb.h
+++ b/src/db/sysdb.h
@@ -108,15 +108,15 @@
#define SYSDB_NC "objectclass="SYSDB_NETGROUP_CLASS
#define SYSDB_MPGC "|("SYSDB_UC")("SYSDB_GC")"
-#define SYSDB_PWNAM_FILTER "(&("SYSDB_UC")("SYSDB_NAME"=%s))"
+#define SYSDB_PWNAM_FILTER "(&("SYSDB_UC")(|("SYSDB_NAME_ALIAS"=%s)("SYSDB_NAME"=%s)))"
#define SYSDB_PWUID_FILTER "(&("SYSDB_UC")("SYSDB_UIDNUM"=%lu))"
#define SYSDB_PWENT_FILTER "("SYSDB_UC")"
-#define SYSDB_GRNAM_FILTER "(&("SYSDB_GC")("SYSDB_NAME"=%s))"
+#define SYSDB_GRNAM_FILTER "(&("SYSDB_GC")(|("SYSDB_NAME_ALIAS"=%s)("SYSDB_NAME"=%s)))"
#define SYSDB_GRNA2_FILTER "(&("SYSDB_UC")("SYSDB_MEMBEROF"=%s))"
#define SYSDB_GRGID_FILTER "(&("SYSDB_GC")("SYSDB_GIDNUM"=%lu))"
#define SYSDB_GRENT_FILTER "("SYSDB_GC")"
-#define SYSDB_GRNAM_MPG_FILTER "(&("SYSDB_MPGC")("SYSDB_NAME"=%s))"
+#define SYSDB_GRNAM_MPG_FILTER "(&("SYSDB_MPGC")(|("SYSDB_NAME_ALIAS"=%s)("SYSDB_NAME"=%s)))"
#define SYSDB_GRGID_MPG_FILTER "(&("SYSDB_MPGC")("SYSDB_GIDNUM"=%lu))"
#define SYSDB_GRENT_MPG_FILTER "("SYSDB_MPGC")"
diff --git a/src/db/sysdb_search.c b/src/db/sysdb_search.c
index 55fdea8e1..3a310b7e7 100644
--- a/src/db/sysdb_search.c
+++ b/src/db/sysdb_search.c
@@ -58,7 +58,7 @@ int sysdb_getpwnam(TALLOC_CTX *mem_ctx,
ret = ldb_search(sysdb->ldb, tmp_ctx, &res, base_dn,
LDB_SCOPE_SUBTREE, attrs, SYSDB_PWNAM_FILTER,
- sanitized_name);
+ sanitized_name, sanitized_name);
if (ret) {
ret = sysdb_error_to_errno(ret);
goto done;
@@ -228,7 +228,7 @@ int sysdb_getgrnam(TALLOC_CTX *mem_ctx,
ret = ldb_search(sysdb->ldb, tmp_ctx, &res, base_dn,
LDB_SCOPE_SUBTREE, attrs, fmt_filter,
- sanitized_name);
+ sanitized_name, sanitized_name);
if (ret) {
ret = sysdb_error_to_errno(ret);
goto done;
@@ -476,7 +476,8 @@ int sysdb_get_user_attr(TALLOC_CTX *mem_ctx,
ret = ldb_search(sysdb->ldb, tmp_ctx, &res, base_dn,
LDB_SCOPE_SUBTREE, attributes,
- SYSDB_PWNAM_FILTER, sanitized_name);
+ SYSDB_PWNAM_FILTER, sanitized_name,
+ sanitized_name);
if (ret) {
ret = sysdb_error_to_errno(ret);
goto done;
diff --git a/src/responder/pam/pam_LOCAL_domain.c b/src/responder/pam/pam_LOCAL_domain.c
index 66f3a8858..baf8cc663 100644
--- a/src/responder/pam/pam_LOCAL_domain.c
+++ b/src/responder/pam/pam_LOCAL_domain.c
@@ -258,11 +258,12 @@ int LOCAL_pam_handler(struct pam_auth_req *preq)
if (res->count < 1) {
DEBUG(4, ("No user found with filter ["SYSDB_PWNAM_FILTER"]\n",
- pd->user));
+ pd->user, pd->user));
pd->pam_status = PAM_USER_UNKNOWN;
goto done;
} else if (res->count > 1) {
- DEBUG(4, ("More than one object found with filter ["SYSDB_PWNAM_FILTER"]\n"));
+ DEBUG(4, ("More than one object found with filter ["SYSDB_PWNAM_FILTER"]\n",
+ pd->user, pd->user));
lreq->error = EFAULT;
goto done;
}