Hi!
I wonder: Is the output of slapcat expected to be stable (assuming the database did not change)? I know that LDAP attributes are considered to be sets that have no implicit ordering, but diff-wise it would be rather nice to have a stable output ordering. Here is an example of non-stable output ordering (sdiff output, only first 18 columns for confidentiality):
# sdiff b0 b1
dn: olcDatabase={1 dn: olcDatabase={1 objectClass: olcDa objectClass: olcDa objectClass: olcHd objectClass: olcHd olcDatabase: {1}hd olcDatabase: {1}hd olcDbDirectory: /v olcDbDirectory: /v olcSuffix: dc=sap, olcSuffix: dc=sap, olcAccess: {0}to * < olcAccess: {1}to d < olcAccess: {2}to a < olcAccess: {3}to a < olcAccess: {4}to a < olcAccess: {5}to * < olcLimits: {0}dn.e olcLimits: {0}dn.e olcRootDN: cn=Admi olcRootDN: cn=Admi olcRootPW: {SSHA}y olcRootPW: {SSHA}y olcSecurity: ssf=1 olcSecurity: ssf=1 olcSyncrepl: {0}ri olcSyncrepl: {0}ri olcSyncrepl: {1}ri olcSyncrepl: {1}ri olcSyncrepl: {2}ri olcSyncrepl: {2}ri olcUpdateRef: ldap olcUpdateRef: ldap olcUpdateRef: ldap olcUpdateRef: ldap olcUpdateRef: ldap olcUpdateRef: ldap olcMirrorMode: TRU olcMirrorMode: TRU olcDbCacheSize: 10 olcDbCacheSize: 10 olcDbCheckpoint: 1 olcDbCheckpoint: 1 olcDbConfig: {0}se olcDbConfig: {0}se olcDbConfig: {1}se olcDbConfig: {1}se olcDbConfig: {2}se olcDbConfig: {2}se olcDbConfig: {3}se olcDbConfig: {3}se olcDbConfig: {4}se olcDbConfig: {4}se olcDbConfig: {5}se olcDbConfig: {5}se olcDbIDLcacheSize: olcDbIDLcacheSize: olcDbIndex: object olcDbIndex: object olcDbIndex: uidNum olcDbIndex: uidNum olcDbIndex: gidNum olcDbIndex: gidNum olcDbIndex: member olcDbIndex: member olcDbIndex: member olcDbIndex: member olcDbIndex: cn eq, olcDbIndex: cn eq, olcDbIndex: uid eq olcDbIndex: uid eq olcDbIndex: sn eq, olcDbIndex: sn eq, olcDbIndex: givenN olcDbIndex: givenN olcDbIndex: entryU olcDbIndex: entryU olcDbIndex: entryC olcDbIndex: entryC olcDbIndex: ipServ olcDbIndex: ipServ olcDbIndex: ipServ olcDbIndex: ipServ olcDbIndex: roleOc olcDbIndex: roleOc olcDbIndex: mail e olcDbIndex: mail e olcDbIndex: displa olcDbIndex: displa olcDbIndex: modify olcDbIndex: modify structuralObjectCl structuralObjectCl entryUUID: db3ffe4 entryUUID: db3ffe4 creatorsName: cn=c creatorsName: cn=c createTimestamp: 2 createTimestamp: 2 entryCSN: 20170706 | olcAccess: {0}to * > olcAccess: {1}to d > olcAccess: {2}to a > olcAccess: {3}to a > olcAccess: {4}to a > olcAccess: {5}to * > entryCSN: 20200114 modifiersName: cn= modifiersName: cn= modifyTimestamp: 2 modifyTimestamp: 2
So is the order of output given by some hash functions in slapcat, or is it the order in which the database returns the attributes? What would I have to do to sort the attribute types in the same order as they are listed in the schema (one possible stable output)?
Regards, Ulrich
--On Tuesday, July 14, 2020 12:16 PM +0200 Ulrich Windl Ulrich.Windl@rz.uni-regensburg.de wrote:
Hi!
I wonder: Is the output of slapcat expected to be stable (assuming the database did not change)?
Your statement that the database did not change is demonstrably false.
entryCSN for b0 is from 2017, entryCSN for b1 is from 2020.
Regards, Quanah
--
Quanah Gibson-Mount Product Architect Symas Corporation Packaged, certified, and supported LDAP solutions powered by OpenLDAP: http://www.symas.com
Quanah Gibson-Mount quanah@symas.com schrieb am 14.07.2020 um 17:37 in
Nachricht <CE1F87DD86912E1205BA0899@[192.168.0.156]>:
‑‑On Tuesday, July 14, 2020 12:16 PM +0200 Ulrich Windl <Ulrich.Windl@rz.uni‑regensburg.de> wrote:
Hi!
I wonder: Is the output of slapcat expected to be stable (assuming the database did not change)?
Your statement that the database did not change is demonstrably false.
entryCSN for b0 is from 2017, entryCSN for b1 is from 2020.
I meant: I was modifying some attribute, not delete/add it, but still it seems to change position in slapcat output.
While you did cut away the other question, I found that Net::LDAP:LLDIF can sort attribute names. I'll try that to sort the slapcat output. Still it may be an interesting option for slapcat itself...
Regards, Ulrich
Regards, Quanah
‑‑
Quanah Gibson‑Mount Product Architect Symas Corporation Packaged, certified, and supported LDAP solutions powered by OpenLDAP: http://www.symas.com
--On Wednesday, July 15, 2020 10:22 AM +0200 Ulrich Windl Ulrich.Windl@rz.uni-regensburg.de wrote:
I meant: I was modifying some attribute, not delete/add it, but still it seems to change position in slapcat output.
slapd may internally reorder items at any time.
While you did cut away the other question, I found that Net::LDAP:LLDIF can sort attribute names. I'll try that to sort the slapcat output. Still it may be an interesting option for slapcat itself...
Not really, LDIF has no specific ordering.
Regards, Quanah
--
Quanah Gibson-Mount Product Architect Symas Corporation Packaged, certified, and supported LDAP solutions powered by OpenLDAP: http://www.symas.com
On 2020/7/15 3:22 AM, Ulrich Windl wrote:
... While you did cut away the other question, I found that Net::LDAP:LLDIF can sort attribute names. I'll try that to sort the slapcat output. Still it may be an interesting option for slapcat itself...
perl-ldap includes ldifsort.pl (and ldifuniq.pl, ldifdiff.pl)
https://metacpan.org/pod/distribution/perl-ldap/contrib/ldifsort.pl
-Phil
"Pishioneri, Phil" pgp@psu.edu schrieb am 16.07.2020 um 16:56 in Nachricht
939d22b6-b9d2-8bd0-ef4d-7bc2c8944d90@pSu.edu:
On 2020/7/15 3:22 AM, Ulrich Windl wrote:
... While you did cut away the other question, I found that Net::LDAP:LLDIF can sort attribute names. I'll try that to sort the slapcat output. Still it may be an interesting option for slapcat itself...
perl-ldap includes ldifsort.pl (and ldifuniq.pl, ldifdiff.pl)
Hi!
Thanks for the hint. Actually my distribution (SLES12 SP5) does not include those. It only has .pm, .pod, and manual pages.
https://metacpan.org/pod/distribution/perl-ldap/contrib/ldifsort.pl
-Phil
openldap-technical@openldap.org