|
|
b2d430 |
From 2e9ea4e5c12c0d50509904415beda6b841b91f65 Mon Sep 17 00:00:00 2001
|
|
|
b2d430 |
From: Sumit Bose <sbose@redhat.com>
|
|
|
b2d430 |
Date: Mon, 20 Jun 2016 12:57:43 +0200
|
|
|
b2d430 |
Subject: [PATCH 52/62] sysdb: include email in UPN searches
|
|
|
b2d430 |
|
|
|
b2d430 |
Email addresses and Kerberos user principals names (UPNs) do not only
|
|
|
b2d430 |
look similar they also can be used to identify a user uniquely.
|
|
|
b2d430 |
|
|
|
b2d430 |
In future this approach should be replace by a more generic one where
|
|
|
b2d430 |
the attributes which can uniquely identifies a user can be configured to
|
|
|
b2d430 |
support even a wider range of login names.
|
|
|
b2d430 |
|
|
|
b2d430 |
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
|
|
|
b2d430 |
(cherry picked from commit 78677495a7762469002b0976809fa20ac2196f42)
|
|
|
b2d430 |
---
|
|
|
b2d430 |
src/db/sysdb.h | 2 +-
|
|
|
b2d430 |
src/db/sysdb_ops.c | 4 ++--
|
|
|
b2d430 |
2 files changed, 3 insertions(+), 3 deletions(-)
|
|
|
b2d430 |
|
|
|
b2d430 |
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
|
|
|
b2d430 |
index f3952f8a56f1c9f26f2167b64abdf3e9794af17e..c2f58ccb97c37d93391e72ee2d77835283a6c12f 100644
|
|
|
b2d430 |
--- a/src/db/sysdb.h
|
|
|
b2d430 |
+++ b/src/db/sysdb.h
|
|
|
b2d430 |
@@ -185,7 +185,7 @@
|
|
|
b2d430 |
#define SYSDB_PWNAM_FILTER "(&("SYSDB_UC")(|("SYSDB_NAME_ALIAS"=%s)("SYSDB_NAME_ALIAS"=%s)("SYSDB_NAME"=%s)))"
|
|
|
b2d430 |
#define SYSDB_PWUID_FILTER "(&("SYSDB_UC")("SYSDB_UIDNUM"=%lu))"
|
|
|
b2d430 |
#define SYSDB_PWSID_FILTER "(&("SYSDB_UC")("SYSDB_SID_STR"=%s))"
|
|
|
b2d430 |
-#define SYSDB_PWUPN_FILTER "(&("SYSDB_UC")(|("SYSDB_UPN"=%s)("SYSDB_CANONICAL_UPN"=%s)))"
|
|
|
b2d430 |
+#define SYSDB_PWUPN_FILTER "(&("SYSDB_UC")(|("SYSDB_UPN"=%s)("SYSDB_CANONICAL_UPN"=%s)("SYSDB_USER_EMAIL"=%s)))"
|
|
|
b2d430 |
#define SYSDB_PWENT_FILTER "("SYSDB_UC")"
|
|
|
b2d430 |
|
|
|
b2d430 |
#define SYSDB_GRNAM_FILTER "(&("SYSDB_GC")(|("SYSDB_NAME_ALIAS"=%s)("SYSDB_NAME_ALIAS"=%s)("SYSDB_NAME"=%s)))"
|
|
|
b2d430 |
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
|
|
|
b2d430 |
index 9a8a55ed8aa69e1638d0ab6f636e43baa3d0bfea..ed177d1730723a61e01167a75a0baca6d81252f8 100644
|
|
|
b2d430 |
--- a/src/db/sysdb_ops.c
|
|
|
b2d430 |
+++ b/src/db/sysdb_ops.c
|
|
|
b2d430 |
@@ -537,7 +537,7 @@ int sysdb_search_user_by_upn_res(TALLOC_CTX *mem_ctx,
|
|
|
b2d430 |
struct ldb_dn *base_dn;
|
|
|
b2d430 |
int ret;
|
|
|
b2d430 |
const char *def_attrs[] = { SYSDB_NAME, SYSDB_UPN, SYSDB_CANONICAL_UPN,
|
|
|
b2d430 |
- NULL };
|
|
|
b2d430 |
+ SYSDB_USER_EMAIL, NULL };
|
|
|
b2d430 |
|
|
|
b2d430 |
tmp_ctx = talloc_new(NULL);
|
|
|
b2d430 |
if (tmp_ctx == NULL) {
|
|
|
b2d430 |
@@ -553,7 +553,7 @@ int sysdb_search_user_by_upn_res(TALLOC_CTX *mem_ctx,
|
|
|
b2d430 |
|
|
|
b2d430 |
ret = ldb_search(domain->sysdb->ldb, tmp_ctx, &res,
|
|
|
b2d430 |
base_dn, LDB_SCOPE_SUBTREE, attrs ? attrs : def_attrs,
|
|
|
b2d430 |
- SYSDB_PWUPN_FILTER, upn, upn);
|
|
|
b2d430 |
+ SYSDB_PWUPN_FILTER, upn, upn, upn);
|
|
|
b2d430 |
if (ret != EOK) {
|
|
|
b2d430 |
ret = sysdb_error_to_errno(ret);
|
|
|
b2d430 |
goto done;
|
|
|
b2d430 |
--
|
|
|
b2d430 |
2.4.11
|
|
|
b2d430 |
|