]> git.sur5r.net Git - openldap/commitdiff
Fix dnattr unparsing
authorHoward Chu <hyc@openldap.org>
Thu, 21 Apr 2005 07:15:02 +0000 (07:15 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 21 Apr 2005 07:15:02 +0000 (07:15 +0000)
servers/slapd/aclparse.c

index 5a7184a25ee60a748f6f5445f66d59d546f920e7..b0bed6579c37a9b1d8ce67321f21bda835f5bf30 100644 (file)
@@ -2323,16 +2323,6 @@ dnaccess2text( slap_dn_access *bdn, char *ptr, int is_realdn )
                ptr = lutil_strcopy( ptr, bdn->a_pat.bv_val );
                *ptr++ = '"';
        }
-
-       if ( bdn->a_at != NULL ) {
-               *ptr++ = ' ';
-               if ( is_realdn ) {
-                       ptr = lutil_strcopy( ptr, "real" );
-               }
-               ptr = lutil_strcopy( ptr, "dnattr=" );
-               ptr = lutil_strcopy( ptr, bdn->a_at->ad_cname.bv_val );
-       }
-
        return ptr;
 }
 
@@ -2346,10 +2336,18 @@ access2text( Access *b, char *ptr )
        if ( !BER_BVISEMPTY( &b->a_dn_pat ) ) {
                ptr = dnaccess2text( &b->a_dn, ptr, 0 );
        }
+       if ( b->a_dn_at ) {
+               ptr = lutil_strcopy( ptr, " dnattr=" );
+               ptr = lutil_strcopy( ptr, b->a_dn_at->ad_cname.bv_val );
+       }
 
        if ( !BER_BVISEMPTY( &b->a_realdn_pat ) ) {
                ptr = dnaccess2text( &b->a_realdn, ptr, 1 );
        }
+       if ( b->a_realdn_at ) {
+               ptr = lutil_strcopy( ptr, " realdnattr=" );
+               ptr = lutil_strcopy( ptr, b->a_realdn_at->ad_cname.bv_val );
+       }
 
        if ( !BER_BVISEMPTY( &b->a_group_pat ) ) {
                ptr = lutil_strcopy( ptr, " group/" );