s3-libnetapi Load case tables earlier
authorAndrew Bartlett <abartlet@samba.org>
Wed, 24 Nov 2010 07:04:02 +0000 (18:04 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 24 Nov 2010 08:21:05 +0000 (09:21 +0100)
If we don't load the case tables as the 'first' thing we do, we will
segfault on the first case insensitive string comparison.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Nov 24 09:21:05 CET 2010 on sn-devel-104

source3/lib/netapi/netapi.c

index 4bb8004e1a41a31e3b98fd0295dc13b5d85ef12b..9d76017a01aed13c417495e05b3ae3db865a1bc5 100644 (file)
@@ -67,14 +67,15 @@ NET_API_STATUS libnetapi_init(struct libnetapi_ctx **context)
 #endif
        frame = talloc_stackframe();
 
+       /* Case tables must be loaded before any string comparisons occour */
+       load_case_tables();
+
        /* When libnetapi is invoked from an application, it does not
         * want to be swamped with level 10 debug messages, even if
         * this has been set for the server in smb.conf */
        lp_set_cmdline("log level", "0");
        setup_logging("libnetapi", DEBUG_STDERR);
 
-       load_case_tables();
-
        if (!lp_load(get_dyn_CONFIGFILE(), true, false, false, false)) {
                TALLOC_FREE(frame);
                fprintf(stderr, "error loading %s\n", get_dyn_CONFIGFILE() );