-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #249 from grawity/ldap-namespace
Namespace generically named LDAP attributes
- Loading branch information
Showing
12 changed files
with
242 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env perl | ||
# Converts OpenLDAP schema from traditional slapd.conf format to LDIF format | ||
# usable for importing into cn=config. | ||
# | ||
# Copyright (c) 2012-2016 Mantas Mikulėnas <grawity@gmail.com> | ||
# Released under the MIT license <https://spdx.org/licenses/MIT> | ||
|
||
use warnings; | ||
use strict; | ||
|
||
my $name = shift(@ARGV) // "UNNAMED-SCHEMA"; | ||
my $unwrap = 0; | ||
|
||
print "dn: cn=$name,cn=schema,cn=config\n"; | ||
print "objectClass: olcSchemaConfig\n"; | ||
|
||
my $key; | ||
my $value; | ||
|
||
while (<STDIN>) { | ||
if (/^(attributeType(?:s)?|objectClass(?:es)?) (.+)$/i) { | ||
if ($key && $value) { | ||
print "$key: $value\n"; | ||
} | ||
($key, $value) = ($1, $2); | ||
if ($key =~ /^attributeType(s)?$/i) { | ||
$key = "olcAttributeTypes"; | ||
} elsif ($key =~ /^objectClass(es)?$/i) { | ||
$key = "olcObjectClasses"; | ||
} else { | ||
$key = "olc$key"; | ||
} | ||
} | ||
elsif (/^\s+(.+)$/) { | ||
if ($unwrap) { | ||
$value .= " $1"; | ||
} else { | ||
$value .= "\n $&"; | ||
} | ||
} | ||
elsif (/^#.*/) { | ||
print "$&\n"; | ||
} | ||
elsif (/.+/) { | ||
warn "$.:unrecognized input line: $&\n"; | ||
} | ||
} | ||
if ($key && $value) { | ||
print "$key: $value\n"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,74 @@ | ||
dn: cn=usbguard,cn=schema,cn=config | ||
objectClass: olcSchemaConfig | ||
cn: usbguard | ||
olcAttributeTypes: {0}( 1.3.6.1.4.1.15955.9.1.1 NAME 'RuleType' DESC 'Hostna | ||
me for USBGuard host' EQUALITY caseExactIA5Match SUBSTR caseExactIA5Substri | ||
ngsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) | ||
olcAttributeTypes: {1}( 1.3.6.1.4.1.15955.9.1.2 NAME 'USBGuardHost' DESC 'Ho | ||
stname for USBGuard host' EQUALITY caseExactIA5Match SUBSTR caseExactIA5Sub | ||
stringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) | ||
olcAttributeTypes: {2}( 1.3.6.1.4.1.15955.9.1.3 NAME 'USBGuardOrder' DESC 'a | ||
n integer to order the USBGuard Policy entries' EQUALITY integerMatch ORDER | ||
ING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 ) | ||
olcAttributeTypes: {3}( 1.3.6.1.4.1.15955.9.1.4 NAME 'DeviceID' DESC 'USB de | ||
vice ID' EQUALITY caseExactIA5Match SUBSTR caseExactIA5SubstringsMatch SYNT | ||
AX 1.3.6.1.4.1.1466.115.121.1.26 ) | ||
olcAttributeTypes: {4}( 1.3.6.1.4.1.15955.9.1.5 NAME 'DeviceSerial' DESC 'US | ||
B device Serial' EQUALITY caseExactIA5Match SUBSTR caseExactIA5SubstringsMa | ||
tch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) | ||
olcAttributeTypes: {5}( 1.3.6.1.4.1.15955.9.1.6 NAME 'DeviceName' DESC 'USB | ||
device Name' EQUALITY caseExactIA5Match SUBSTR caseExactIA5SubstringsMatch | ||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) | ||
olcAttributeTypes: {6}( 1.3.6.1.4.1.15955.9.1.7 NAME 'DeviceHash' DESC 'USB | ||
device hash' EQUALITY caseExactIA5Match SUBSTR caseExactIA5SubstringsMatch | ||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) | ||
olcAttributeTypes: {7}( 1.3.6.1.4.1.15955.9.1.8 NAME 'DeviceParentHash' DESC | ||
'USB device ParentHash' EQUALITY caseExactIA5Match SUBSTR caseExactIA5Subs | ||
tringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) | ||
olcAttributeTypes: {8}( 1.3.6.1.4.1.15955.9.1.9 NAME 'DeviceViaPort' DESC 'U | ||
SB device ViaPort' EQUALITY caseExactIA5Match SUBSTR caseExactIA5Substrings | ||
Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) | ||
olcAttributeTypes: {9}( 1.3.6.1.4.1.15955.9.1.10 NAME 'DeviceWithInterface' | ||
DESC 'USB device With-Interface' EQUALITY caseExactIA5Match SUBSTR caseExac | ||
tIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) | ||
olcAttributeTypes: {10}( 1.3.6.1.4.1.15955.9.1.11 NAME 'RuleCondition' DESC | ||
'Condition' EQUALITY caseExactIA5Match SUBSTR caseExactIA5SubstringsMatch S | ||
YNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) | ||
olcObjectClasses: {0}( 1.3.6.1.4.1.15955.9.1.1 NAME 'USBGuardPolicy' DESC 'U | ||
SBGuard Policy' SUP top STRUCTURAL MUST ( cn $ RuleType $ USBGuardHost $ US | ||
BGuardOrder ) MAY ( DeviceID $ DeviceSerial $ DeviceName $ DeviceHash $ Dev | ||
iceParentHash $ DeviceViaPort $ DeviceWithInterface $ RuleCondition $ descr | ||
iption ) ) | ||
olcAttributeTypes: ( 1.3.6.1.4.1.15955.9.1.1 | ||
NAME 'USBGuardRuleTarget' | ||
DESC 'Hostname for USBGuard host' | ||
EQUALITY caseExactIA5Match | ||
SUBSTR caseExactIA5SubstringsMatch | ||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) | ||
olcAttributeTypes: ( 1.3.6.1.4.1.15955.9.1.2 | ||
NAME 'USBGuardHost' | ||
DESC 'Hostname for USBGuard host' | ||
EQUALITY caseExactIA5Match | ||
SUBSTR caseExactIA5SubstringsMatch | ||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) | ||
olcAttributeTypes: ( 1.3.6.1.4.1.15955.9.1.3 | ||
NAME 'USBGuardRuleOrder' | ||
DESC 'an integer to order the USBGuard Policy entries' | ||
EQUALITY integerMatch | ||
ORDERING integerOrderingMatch | ||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 ) | ||
olcAttributeTypes: ( 1.3.6.1.4.1.15955.9.1.4 | ||
NAME 'USBID' | ||
DESC 'USB device ID' | ||
EQUALITY caseExactIA5Match | ||
SUBSTR caseExactIA5SubstringsMatch | ||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) | ||
olcAttributeTypes: ( 1.3.6.1.4.1.15955.9.1.5 | ||
NAME 'USBSerial' | ||
DESC 'USB device Serial' | ||
EQUALITY caseExactIA5Match | ||
SUBSTR caseExactIA5SubstringsMatch | ||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) | ||
olcAttributeTypes: ( 1.3.6.1.4.1.15955.9.1.6 | ||
NAME 'USBName' | ||
DESC 'USB device Name' | ||
EQUALITY caseExactIA5Match | ||
SUBSTR caseExactIA5SubstringsMatch | ||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) | ||
olcAttributeTypes: ( 1.3.6.1.4.1.15955.9.1.7 | ||
NAME 'USBHash' | ||
DESC 'USB device hash' | ||
EQUALITY caseExactIA5Match | ||
SUBSTR caseExactIA5SubstringsMatch | ||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) | ||
olcAttributeTypes: ( 1.3.6.1.4.1.15955.9.1.8 | ||
NAME 'USBParentHash' | ||
DESC 'USB device ParentHash' | ||
EQUALITY caseExactIA5Match | ||
SUBSTR caseExactIA5SubstringsMatch | ||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) | ||
olcAttributeTypes: ( 1.3.6.1.4.1.15955.9.1.9 | ||
NAME 'USBViaPort' | ||
DESC 'USB device ViaPort' | ||
EQUALITY caseExactIA5Match | ||
SUBSTR caseExactIA5SubstringsMatch | ||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) | ||
olcAttributeTypes: ( 1.3.6.1.4.1.15955.9.1.10 | ||
NAME 'USBWithInterface' | ||
DESC 'USB device With-Interface' | ||
EQUALITY caseExactIA5Match | ||
SUBSTR caseExactIA5SubstringsMatch | ||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) | ||
olcAttributeTypes: ( 1.3.6.1.4.1.15955.9.1.11 | ||
NAME 'USBGuardRuleCondition' | ||
DESC 'Condition' | ||
EQUALITY caseExactIA5Match | ||
SUBSTR caseExactIA5SubstringsMatch | ||
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) | ||
olcObjectClasses: ( 1.3.6.1.4.1.15955.9.1.1 NAME 'USBGuardPolicy' SUP top STRUCTURAL | ||
DESC 'USBGuard Policy' | ||
MUST ( cn $ USBGuardRuleTarget $ USBGuardHost $ USBGuardRuleOrder ) | ||
MAY ( USBID $ USBSerial $ USBName $ USBHash $ USBParentHash $ USBViaPort $ USBWithInterface $ USBGuardRuleCondition $ description ) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.