From f3a959970ea52985f74e4d8625662a7b00c3ddc4 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Tue, 7 Dec 2004 10:01:48 +0000 Subject: [PATCH] hardcode "uid" into slapd & improve previous commit --- servers/slapd/sasl.c | 8 ++++---- servers/slapd/schema/core.schema | 12 ++++++------ servers/slapd/schema_prep.c | 9 +++++++++ servers/slapd/slap.h | 1 + 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/servers/slapd/sasl.c b/servers/slapd/sasl.c index 1dcd8bbe95..b5c6b0b990 100644 --- a/servers/slapd/sasl.c +++ b/servers/slapd/sasl.c @@ -1609,7 +1609,7 @@ int slap_sasl_getdn( Connection *conn, Operation *op, struct berval *id, irdn = 0; DN[ irdn ] = RDNs[ irdn ]; RDNs[ irdn ][ 0 ] = &AVAs[ irdn ]; - BER_BVSTR( &AVAs[ irdn ].la_attr, "uid" ); + AVAs[ irdn ].la_attr = slap_schema.si_ad_uid->ad_cname; AVAs[ irdn ].la_value = *dn; AVAs[ irdn ].la_flags = LDAP_AVA_NULL; AVAs[ irdn ].la_private = NULL; @@ -1619,7 +1619,7 @@ int slap_sasl_getdn( Connection *conn, Operation *op, struct berval *id, irdn++; DN[ irdn ] = RDNs[ irdn ]; RDNs[ irdn ][ 0 ] = &AVAs[ irdn ]; - BER_BVSTR( &AVAs[ irdn ].la_attr, "cn" ); + AVAs[ irdn ].la_attr = slap_schema.si_ad_cn->ad_cname; ber_str2bv( user_realm, 0, 0, &AVAs[ irdn ].la_value ); AVAs[ irdn ].la_flags = LDAP_AVA_NULL; AVAs[ irdn ].la_private = NULL; @@ -1630,7 +1630,7 @@ int slap_sasl_getdn( Connection *conn, Operation *op, struct berval *id, irdn++; DN[ irdn ] = RDNs[ irdn ]; RDNs[ irdn ][ 0 ] = &AVAs[ irdn ]; - BER_BVSTR( &AVAs[ irdn ].la_attr, "cn" ); + AVAs[ irdn ].la_attr = slap_schema.si_ad_cn->ad_cname; AVAs[ irdn ].la_value = *mech; AVAs[ irdn ].la_flags = LDAP_AVA_NULL; AVAs[ irdn ].la_private = NULL; @@ -1640,7 +1640,7 @@ int slap_sasl_getdn( Connection *conn, Operation *op, struct berval *id, irdn++; DN[ irdn ] = RDNs[ irdn ]; RDNs[ irdn ][ 0 ] = &AVAs[ irdn ]; - BER_BVSTR( &AVAs[ irdn ].la_attr, "cn" ); + AVAs[ irdn ].la_attr = slap_schema.si_ad_cn->ad_cname; BER_BVSTR( &AVAs[ irdn ].la_value, "auth" ); AVAs[ irdn ].la_flags = LDAP_AVA_NULL; AVAs[ irdn ].la_private = NULL; diff --git a/servers/slapd/schema/core.schema b/servers/slapd/schema/core.schema index 31a9ba64fe..8c6603074e 100644 --- a/servers/slapd/schema/core.schema +++ b/servers/slapd/schema/core.schema @@ -525,12 +525,12 @@ objectclass ( 1.3.6.1.4.1.250.3.15 NAME 'labeledURIObject' # # Derived from RFC 1274, but with new "short names" # -attributetype ( 0.9.2342.19200300.100.1.1 - NAME ( 'uid' 'userid' ) - DESC 'RFC1274: user identifier' - EQUALITY caseIgnoreMatch - SUBSTR caseIgnoreSubstringsMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} ) +#attributetype ( 0.9.2342.19200300.100.1.1 +# NAME ( 'uid' 'userid' ) +# DESC 'RFC1274: user identifier' +# EQUALITY caseIgnoreMatch +# SUBSTR caseIgnoreSubstringsMatch +# SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} ) attributetype ( 0.9.2342.19200300.100.1.3 NAME ( 'mail' 'rfc822Mailbox' ) diff --git a/servers/slapd/schema_prep.c b/servers/slapd/schema_prep.c index 4eca5045cc..ac9805c67b 100644 --- a/servers/slapd/schema_prep.c +++ b/servers/slapd/schema_prep.c @@ -907,6 +907,15 @@ static struct slap_schema_ad_map { NULL, NULL, NULL, NULL, NULL, NULL, NULL, offsetof(struct slap_internal_schema, si_ad_cn) }, + { "uid", "( 0.9.2342.19200300.100.1.1 NAME ( 'uid' 'userid' ) " + "DESC 'RFC1274: user identifier' " + "EQUALITY caseIgnoreMatch " + "SUBSTR caseIgnoreSubstringsMatch " + "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )", + NULL, 0, + NULL, NULL, + NULL, NULL, NULL, NULL, NULL, + offsetof(struct slap_internal_schema, si_ad_uid) }, { "userPassword", "( 2.5.4.35 NAME 'userPassword' " "DESC 'RFC2256/2307: password of user' " "EQUALITY octetStringMatch " diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 4338207932..22dc51eb67 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -848,6 +848,7 @@ struct slap_internal_schema { AttributeDescription *si_ad_distinguishedName; AttributeDescription *si_ad_name; AttributeDescription *si_ad_cn; + AttributeDescription *si_ad_uid; AttributeDescription *si_ad_userPassword; AttributeDescription *si_ad_labeledURI; #ifdef SLAPD_AUTHPASSWD -- 2.39.5