URL: https://github.com/SSSD/sssd/pull/1016
Author: pbrezina
 Title: #1016: proxy: set pwfield to x for files library
Action: synchronized

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/1016/head:pr1016
git checkout pr1016
From 4ee426716080fe3b76b6ec91cd7fa917c913bfde Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrez...@redhat.com>
Date: Tue, 31 Mar 2020 13:42:11 +0200
Subject: [PATCH] proxy: set pwfield to x for files library

Resolves:
https://pagure.io/SSSD/sssd/issue/4174
---
 src/confdb/confdb.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/confdb/confdb.c b/src/confdb/confdb.c
index 54cc604a02..65ad18dcf2 100644
--- a/src/confdb/confdb.c
+++ b/src/confdb/confdb.c
@@ -1029,6 +1029,18 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
         domain->pwfield = "x";
     }
 
+    if (domain->provider != NULL && strcasecmp(domain->provider, "proxy") == 0) {
+        /* The password field must be  reported as 'x' for proxy provider
+         * using files library, else pam_unix won't
+         * authenticate this entry. */
+        tmp = ldb_msg_find_attr_as_string(res->msgs[0],
+                                          CONFDB_PROXY_LIBNAME,
+                                          NULL);
+        if (tmp != NULL && strcasecmp(tmp, "files") == 0) {
+            domain->pwfield = "x";
+        }
+    }
+
     if (!domain->enumerate) {
         DEBUG(SSSDBG_TRACE_FUNC, "No enumeration for [%s]!\n", domain->name);
         DEBUG(SSSDBG_TRACE_FUNC,
_______________________________________________
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/sssd-devel@lists.fedorahosted.org

Reply via email to