Blame SOURCES/0069-SYSDB-Only-generate-new-UID-in-local-domain.patch

bb7cd1
From ee344275c041f68e943360c975e3356ba251cef8 Mon Sep 17 00:00:00 2001
bb7cd1
From: Jakub Hrozek <jhrozek@redhat.com>
bb7cd1
Date: Tue, 28 Mar 2017 14:49:31 +0200
bb7cd1
Subject: [PATCH 69/72] SYSDB: Only generate new UID in local domain
bb7cd1
bb7cd1
To avoid issues where a user with no UID but without the posix=false
bb7cd1
flag was passed to sysdb, we only allow generating the new ID in the
bb7cd1
local domain. This might prevent bugs where non-POSIX users would get a
bb7cd1
UID created by sysdb which might allow accessing resources owned by that
bb7cd1
UID.
bb7cd1
bb7cd1
Reviewed-by: Sumit Bose <sbose@redhat.com>
bb7cd1
---
bb7cd1
 src/db/sysdb_ops.c | 6 ++++++
bb7cd1
 1 file changed, 6 insertions(+)
bb7cd1
bb7cd1
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
bb7cd1
index 3cf9d903f25b9ccd506d7957c94040bdc7d658a3..4d7b2abd8026c90aaf4e7be687102e459cf3690e 100644
bb7cd1
--- a/src/db/sysdb_ops.c
bb7cd1
+++ b/src/db/sysdb_ops.c
bb7cd1
@@ -1422,6 +1422,12 @@ int sysdb_get_new_id(struct sss_domain_info *domain,
bb7cd1
         return ENOMEM;
bb7cd1
     }
bb7cd1
 
bb7cd1
+    if (strcasecmp(domain->provider, "local") != 0) {
bb7cd1
+        DEBUG(SSSDBG_CRIT_FAILURE,
bb7cd1
+              "Generating new ID is only supported in the local domain!\n");
bb7cd1
+        return ENOTSUP;
bb7cd1
+    }
bb7cd1
+
bb7cd1
     base_dn = sysdb_domain_dn(tmp_ctx, domain);
bb7cd1
     if (!base_dn) {
bb7cd1
         talloc_zfree(tmp_ctx);
bb7cd1
-- 
bb7cd1
2.9.3
bb7cd1