server's command line options
if started without the debugging command line option.
.TP
+.B
+locale { <locale-name> | on | off }
+Obey <locale-name>'s character classification and case conversion; i.e. the
+.BR locale (5)
+LC_CTYPE category. See
+.BR locale (5)
+for details about locales. "on" takes the locale from the environment,
+typically $LANG or $LC_CTYPE, and will only work properly if slapd will
+run with the same environment variables as when the database was
+generated. "off" (the default setting) resets to the initial "C" locale.
+.TP
.B loglevel <integer>
Specify the level at which debugging statements and operation
statistics should be syslogged (currently logged to the
.SH SEE ALSO
.BR ldap (3),
.BR slapd.replog (5),
+.BR locale (5),
.BR passwd (5),
.BR slapd (8),
.BR slurpd (8),
/* Define if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
+/* Define if you have the <locale.h> header file. */
+#define HAVE_LOCALE_H 1
+
/* Define if you have the <lwp/lwp.h> header file. */
/* #undef HAVE_LWP_LWP_H */
#include "portable.h"
#include <stdio.h>
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
#include <ac/string.h>
#include <ac/ctype.h>
strcpy( default_referral, "Referral:\n" );
strcat( default_referral, cargv[1] );
+ /* specify locale */
+ } else if ( strcasecmp( cargv[0], "locale" ) == 0 ) {
+#ifdef HAVE_LOCALE_H
+ char *locale;
+ if ( cargc < 2 ) {
+ Debug( LDAP_DEBUG_ANY,
+ "%s: line %d: missing locale in \"locale <name | on | off>\" line\n",
+ fname, lineno, 0 );
+ return( 1 );
+ }
+
+ locale = (strcasecmp( cargv[1], "on" ) == 0 ? ""
+ : strcasecmp( cargv[1], "off" ) == 0 ? "C"
+ : ch_strdup( cargv[1] ) );
+
+ if ( setlocale( LC_CTYPE, locale ) == 0 ) {
+ Debug( LDAP_DEBUG_ANY,
+ (*locale
+ ? "%s: line %d: bad locale \"%s\"\n"
+ : "%s: line %d: bad locale\n"),
+ fname, lineno, locale );
+ return( 1 );
+ }
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "%s: line %d: \"locale\" unsupported\n",
+ fname, lineno, 0 );
+ return( 1 );
+#endif
/* specify an objectclass */
} else if ( strcasecmp( cargv[0], "objectclass" ) == 0 ) {
parse_oc( be, fname, lineno, cargc, cargv );
/* normalize the value */
for ( s = val[j]; *s; s++ ) {
- if ( isascii( *s ) ) {
- *s = TOLOWER( *s );
- }
+ *s = TOLOWER( (unsigned char) *s );
last = *s;
}
if ( isascii( last ) && isdigit( last ) ) {