Move str2access and access2str outside #ifdef LDAP_DEBUG clause

This commit is contained in:
Howard Chu 1999-11-10 20:28:42 +00:00
parent 951b275ed6
commit 9f7b1160dd

View File

@ -771,6 +771,56 @@ acl_append( AccessControl **l, AccessControl *a )
*l = a;
}
char *
access2str( slap_access_t access )
{
if ( access == ACL_NONE ) {
return "none";
} else if ( access == ACL_AUTH ) {
return "auth";
} else if ( access == ACL_COMPARE ) {
return "compare";
} else if ( access == ACL_SEARCH ) {
return "search";
} else if ( access == ACL_READ ) {
return "read";
} else if ( access == ACL_WRITE ) {
return "write";
}
return "unknown";
}
slap_access_t
str2access( const char *str )
{
if ( strcasecmp( str, "none" ) == 0 ) {
return ACL_NONE;
} else if ( strcasecmp( str, "auth" ) == 0 ) {
return ACL_AUTH;
} else if ( strcasecmp( str, "compare" ) == 0 ) {
return ACL_COMPARE;
} else if ( strcasecmp( str, "search" ) == 0 ) {
return ACL_SEARCH;
} else if ( strcasecmp( str, "read" ) == 0 ) {
return ACL_READ;
} else if ( strcasecmp( str, "write" ) == 0 ) {
return ACL_WRITE;
}
return( ACL_INVALID_ACCESS );
}
#ifdef LDAP_DEBUG
static void
@ -848,56 +898,6 @@ print_access( Access *b )
fprintf( stderr, "\n" );
}
char *
access2str( slap_access_t access )
{
if ( access == ACL_NONE ) {
return "none";
} else if ( access == ACL_AUTH ) {
return "auth";
} else if ( access == ACL_COMPARE ) {
return "compare";
} else if ( access == ACL_SEARCH ) {
return "search";
} else if ( access == ACL_READ ) {
return "read";
} else if ( access == ACL_WRITE ) {
return "write";
}
return "unknown";
}
slap_access_t
str2access( const char *str )
{
if ( strcasecmp( str, "none" ) == 0 ) {
return ACL_NONE;
} else if ( strcasecmp( str, "auth" ) == 0 ) {
return ACL_AUTH;
} else if ( strcasecmp( str, "compare" ) == 0 ) {
return ACL_COMPARE;
} else if ( strcasecmp( str, "search" ) == 0 ) {
return ACL_SEARCH;
} else if ( strcasecmp( str, "read" ) == 0 ) {
return ACL_READ;
} else if ( strcasecmp( str, "write" ) == 0 ) {
return ACL_WRITE;
}
return( ACL_INVALID_ACCESS );
}
static void
print_acl( Backend *be, AccessControl *a )