Bug 1184938

Summary: Provide LDIF version of LPK schema
Product: Red Hat Enterprise Linux 7 Reporter: Matt Dainty <matt>
Component: opensshAssignee: Jakub Jelen <jjelen>
Status: CLOSED ERRATA QA Contact: Stanislav Zidek <szidek>
Severity: low Docs Contact: Robert Krátký <rkratky>
Priority: low    
Version: 7.2CC: jjelen, jsynacek, ksrot, matt, plautrba, tmraz
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openssh-6.6.1p1-13.el7 Doc Type: Enhancement
Doc Text:
LPK schema for OpenLDAP now available in the LDIF format LDIF is the new default format for the OpenLDAP import schema, and the _openssh-ldap_ package now provides the LDAP Public Key (LPK) schema in the LDIF format as well. Therefore, administrators can directly import the LDIF schema when setting up public-key authentication based on LDAP.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 08:02:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
openssh-lpk-openldap.ldif none

Description Matt Dainty 2015-01-22 14:14:21 UTC
Description of problem:
Given the version of OpenLDAP bundled with EL7 prefers the "cn=config" configuration method, it would be handy to provide the schema converted to LDIF form to ease importing. As well as the OpenLDAP packages, the FreeRadius and Samba packages already do this for their schemas. Granted this isn't the most complicated schema out there...

Version-Release number of selected component (if applicable):
openssh-6.4p1-8.el7
openssh-ldap-6.4p1-8.el7

How reproducible:
Always

Steps to Reproduce:
1. Install openssh-ldap
2. Check package contents
3.

Actual results:
Only .schema files present

Expected results:
Should contain a .ldif version

Additional info:

Comment 2 Jakub Jelen 2015-01-27 09:16:44 UTC
Created attachment 984557 [details]
openssh-lpk-openldap.ldif

Thank you for suggestion. I tried to create ldif file from schema, but I can't say if it works correctly. Can you have a look at attached file?

Comment 3 Matt Dainty 2015-01-27 10:10:19 UTC
That loaded fine for me in my test OpenLDAP server.

My only suggestion is perhaps the "-openldap" in the dn/cn is unnecessary? So instead of it being "cn=openssh-lpk-openldap" it's just "cn=openssh-lpk"

Comment 4 Jakub Jelen 2015-01-29 09:45:05 UTC
In current version, there are two versions of .schema files, one for openldap, second for Sun/Oracle. I'm not knowledgeable about differences in .ldif files between these systems, but if you can confirm that there is no such difference in .ldif syntax like in .schema syntax, we can drop "-openldap" substring, I guess.

Comment 6 Karel Srot 2015-04-23 07:02:16 UTC
Hi Jan,
please take a look at #c3 and #c4. What do you think would be appropriate cn? I would be rather careful and keep the openldap suffix in place.

Comment 7 Matt Dainty 2015-04-23 09:07:10 UTC
My point was that having the name of the directory server in the schema DN/CN is a bit redundant when none of the other schemas have the name of the directory server in them, at least for OpenLDAP anyway so it just looks a bit odd.

But by all means have 2 (or 4) schema files in the package named openssh-lpk-{openldap,sun}.{schema,ldif} if separate files are needed. I've just checked the schema in the FreeRadius package and for iPlanet/Sun, there's no schema-specific DN at all, it looks to be imported directly on the cn=schema object so I don't think there would be in any harm in doing this.

Comment 8 Karel Srot 2015-04-23 13:10:37 UTC
You are right Matt, thanks for clarifying it.

Comment 9 Jan Synacek 2015-04-24 06:52:44 UTC
(In reply to Karel Srot from comment #6)
> Hi Jan,
> please take a look at #c3 and #c4. What do you think would be appropriate
> cn? I would be rather careful and keep the openldap suffix in place.

From the openldap's point of view, the suffix doesn't really matter. However, if the file's name is "openssh-lpk-openldap.ldif", I would leave it there, unless you want to also rename the file. But that's just a matter of personal preference.

Comment 10 Jakub Jelen 2015-04-24 07:13:41 UTC
The thing is, that *.schema files have different syntax for sun/openldap and the CN was not in schema files.
If I got it right, "Sun ONE Directory Server is compliant with this standard." [1]. So if *.ldif files have the same syntax for both, we can create only one file and remove suffix to make it easy and clear. If not, we should provide two files. Jan, what do you think?

[1] https://docs.oracle.com/cd/E19199-01/816-6699-10/ax_ldif.html#14301

Comment 11 Jan Synacek 2015-04-24 08:03:23 UTC
LDIF is a standard (RFC 2849), so if the Sun DS implements it, it should be ok to have only one ldif for both. The only problem I can see is that the Sun DS doesn't have to necessarily recognize that distinguished names ending with ",cn=schema,cn=config" are schema definitions. I *think* that it depends on the server's implementation and is not specified anywhere. But that can be pretty easily tested.

Comment 12 Matt Dainty 2015-04-24 10:11:03 UTC
Look at what the FreeRadius package does. There are two LDIF files, one each for both OpenLDAP and iPlanet/Sun. The OpenLDAP version installs the schema at cn=radius,cn=schema,cn=config, iPlanet/Sun installs the schema at cn=schema.

So I think there still needs to be two LDIF files. LDIF is a standard but it doesn't standardise what the content is or how it is organised in the DIT, just how it is formatted.

Comment 13 Jakub Jelen 2015-04-27 08:19:07 UTC
When I compare FreeRadius LDIF files, there are again some differences including:
 * above mentioned dn/cn
 * attributeTypes x olcAttributeTypes
 * objectClasses x olcObjectClasses
 * different syntax (sun is missing {n}

I tried to incorporate it into these ldif files and I would if somebody could tell if it works as supposed:

$ cat openssh-6.6p1/openssh-lpk-sun.ldif
dn: cn=schema
attributeTypes: ( 1.3.6.1.4.1.24552.500.1.1.1.13
 NAME 'sshPublicKey' DESC 'MANDATORY: OpenSSH Public key'
 EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 )
objectClasses: ( 1.3.6.1.4.1.24552.500.1.1.2.0
 NAME 'ldapPublicKey' DESC 'MANDATORY: OpenSSH LPK objectclass'
 SUP top AUXILIARY MUST ( sshPublicKey $ uid ) )


$ cat openssh-6.6p1/openssh-lpk-openldap.ldif
dn: cn=openssh-lpk,cn=schema,cn=config
objectClass: olcSchemaConfig
cn: openssh-lpk
olcAttributeTypes: {0}( 1.3.6.1.4.1.24552.500.1.1.1.13
 NAME 'sshPublicKey' DESC 'MANDATORY: OpenSSH Public key'
 EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 )
olcObjectClasses: {0}( 1.3.6.1.4.1.24552.500.1.1.2.0
 NAME 'ldapPublicKey' DESC 'MANDATORY: OpenSSH LPK objectclass'
 SUP top AUXILIARY MUST ( sshPublicKey $ uid ) )

Comment 15 Matt Dainty 2015-05-12 07:55:46 UTC
Watch out for leading spaces in the LDIF file. Any line indented by a single space is joined to the previous line without that space so for example the OID and name are joined on import like so "...1.3.6.1.4.1.24552.500.1.1.1.13NAME 'ssh...".

When I dump the schema from my test instance it looks like this:

# {4}openssh-lpk, schema, config
dn: cn={4}openssh-lpk,cn=schema,cn=config
objectClass: olcSchemaConfig
cn: {3}openssh-lpk
olcAttributeTypes: {0}( 1.3.6.1.4.1.24552.500.1.1.1.13 NAME 'sshPublicKey' DES
 C 'MANDATORY: OpenSSH Public key' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.
 1.1466.115.121.1.40 )
olcObjectClasses: {0}( 1.3.6.1.4.1.24552.500.1.1.2.0 NAME 'ldapPublicKey' DESC
  'MANDATORY: OpenSSH LPK objectclass' SUP top AUXILIARY MUST ( sshPublicKey $
  uid ) )

So if you indent the indented lines with a further space that should preserve the literal spaces.

Unfortunately I can't test the Sun schema.

Comment 16 Matt Dainty 2015-05-12 08:00:54 UTC
Ignore the {3/4} mixup, that was a copy & paste error. My schema isn't that broken ;-)

Your LDIF schema file is correct in that it shouldn't specify a position for the actual schema object, OpenLDAP will add that automatically on import.

Comment 17 Jakub Jelen 2015-05-12 09:39:05 UTC
Thanks for comments. I will fix that. Adding additional space should do it.
I also got similar result from some conversion tool, but I wanted to have it more readable (newlines in the middle of words just does not feel right for me :)).

Comment 20 errata-xmlrpc 2015-11-19 08:02:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-2088.html