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

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