Blame SOURCES/0009-TESTS-Extend-the-schema-with-sshPublicKey-attribute.patch

ca1eb8
From 2b210b10ce54f6f2595f6ab181a51bce367d43a9 Mon Sep 17 00:00:00 2001
96eb28
From: Jakub Hrozek <jhrozek@redhat.com>
96eb28
Date: Sun, 17 Jun 2018 21:48:36 +0200
96eb28
Subject: [PATCH] TESTS: Extend the schema with sshPublicKey attribute
96eb28
MIME-Version: 1.0
96eb28
Content-Type: text/plain; charset=UTF-8
96eb28
Content-Transfer-Encoding: 8bit
96eb28
96eb28
This will allow to store the users with a sshPublicKey attribute
96eb28
provided that they have the right objectclass as well.
96eb28
96eb28
Related to:
96eb28
https://pagure.io/SSSD/sssd/issue/3747
96eb28
96eb28
Reviewed-by: Fabiano FidĂȘncio <fidencio@redhat.com>
96eb28
(cherry picked from commit 1575ec97e080656f69b3f93e641c76e74ffb8182)
96eb28
96eb28
DOWNSTREAM:
ca1eb8
Resolves: rhbz#1583343 - Login with sshkeys stored in ipa not working after update to RHEL-7.5
96eb28
---
96eb28
 src/tests/intg/data/ssh_schema.ldif | 11 +++++++++++
96eb28
 src/tests/intg/ds_openldap.py       |  6 ++++++
96eb28
 2 files changed, 17 insertions(+)
96eb28
 create mode 100644 src/tests/intg/data/ssh_schema.ldif
96eb28
96eb28
diff --git a/src/tests/intg/data/ssh_schema.ldif b/src/tests/intg/data/ssh_schema.ldif
96eb28
new file mode 100644
96eb28
index 0000000000000000000000000000000000000000..efe05706b9ded5614a7f3f5e0bab28a7eb869daa
96eb28
--- /dev/null
96eb28
+++ b/src/tests/intg/data/ssh_schema.ldif
96eb28
@@ -0,0 +1,11 @@
96eb28
+dn: cn=openssh-lpk,cn=schema,cn=config
96eb28
+objectClass: olcSchemaConfig
96eb28
+cn: openssh-lpk
96eb28
+olcAttributeTypes: ( 1.3.6.1.4.1.24552.500.1.1.1.13 NAME 'sshPublicKey'
96eb28
+  DESC 'MANDATORY: OpenSSH Public key'
96eb28
+  EQUALITY octetStringMatch
96eb28
+  SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 )
96eb28
+olcObjectClasses: ( 1.3.6.1.4.1.24552.500.1.1.2.0 NAME 'ldapPublicKey' SUP top AUXILIARY
96eb28
+  DESC 'MANDATORY: OpenSSH LPK objectclass'
96eb28
+  MAY ( sshPublicKey $ uid )
96eb28
+  )
96eb28
diff --git a/src/tests/intg/ds_openldap.py b/src/tests/intg/ds_openldap.py
96eb28
index 842ff910803658834841c8f9181f3c4af29b955a..c9a4b6de8c53c6644b3de9047d657ee35ce06512 100644
96eb28
--- a/src/tests/intg/ds_openldap.py
96eb28
+++ b/src/tests/intg/ds_openldap.py
96eb28
@@ -186,6 +186,12 @@ class DSOpenLDAP(DS):
96eb28
         db_config_file.write(db_config)
96eb28
         db_config_file.close()
96eb28
 
96eb28
+        # Import ad schema
96eb28
+        subprocess.check_call(
96eb28
+            ["slapadd", "-F", self.conf_slapd_d_dir, "-b", "cn=config",
96eb28
+             "-l", "data/ssh_schema.ldif"],
96eb28
+        )
96eb28
+
96eb28
     def _start_daemon(self):
96eb28
         """Start the instance."""
96eb28
         if subprocess.call(["slapd", "-F", self.conf_slapd_d_dir,
96eb28
-- 
ca1eb8
2.17.1
96eb28