fix log level, set a default, and also copy the value set in smb.conf into parm_struc...
authorSimo Sorce <idra@samba.org>
Sat, 3 Aug 2002 01:11:16 +0000 (01:11 +0000)
committerSimo Sorce <idra@samba.org>
Sat, 3 Aug 2002 01:11:16 +0000 (01:11 +0000)
this one also fixes log level not shown in swat
fix swat help system
(This used to be commit 7532e828966f3baaa418b528a5b7fe450c488401)

source3/param/loadparm.c
source3/web/swat.c

index d649b421c9da67ef23ebad97f81f31ed64e6a9cb..0142d6c32d870f2ef324c9e9d7c2d1616722e5ed 100644 (file)
@@ -166,6 +166,7 @@ typedef struct
        char *szGuestaccount;
        char *szManglingMethod;
        int max_log_size;
+       char *szLogLevel;
        int mangled_stack;
        int max_xmit;
        int max_mux;
@@ -767,8 +768,8 @@ static struct parm_struct parm_table[] = {
        {"Logging Options", P_SEP, P_SEPARATOR},
 
        {"admin log", P_BOOL, P_GLOBAL, &Globals.bAdminLog, NULL, NULL, 0},
-       {"log level", P_STRING, P_GLOBAL, NULL, handle_debug_list, NULL, 0},
-       {"debuglevel", P_STRING, P_GLOBAL, NULL, handle_debug_list, NULL, 0},
+       {"log level", P_STRING, P_GLOBAL, &Globals.szLogLevel, handle_debug_list, NULL, 0},
+       {"debuglevel", P_STRING, P_GLOBAL, &Globals.szLogLevel, handle_debug_list, NULL, 0},
        {"syslog", P_INTEGER, P_GLOBAL, &Globals.syslog, NULL, NULL, 0},
        {"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL, 0},
        {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL, NULL, 0},
@@ -1277,6 +1278,7 @@ static void init_globals(void)
        Globals.bSyslogOnly = False;
        Globals.bAdminLog = False;
        Globals.bTimestampLogs = True;
+       string_set(&Globals.szLogLevel, "0");
        Globals.bDebugHiresTimestamp = False;
        Globals.bDebugPid = False;
        Globals.bDebugUid = False;
@@ -2642,6 +2644,7 @@ static BOOL handle_debug_list( char *pszParmValueIn, char **ptr )
        pstring pszParmValue;
 
        pstrcpy(pszParmValue, pszParmValueIn);
+       string_set(ptr, pszParmValueIn);
        return debug_parse_levels( pszParmValue );
 }
 
index 7be46790dbe98a83aab9194ee7e87a27f3845489..80d3232d2bffedb6912b8f05047b507d790bb708 100644 (file)
@@ -79,15 +79,15 @@ static char *fix_backslash(char *str)
        return newstring;
 }
 
-static char *stripspace(char *str)
+static char *stripspaceupper(char *str)
 {
-static char newstring[1024];
-char *p = newstring;
+       static char newstring[1024];
+       char *p = newstring;
 
-        while (*str) {
-                if (*str != ' ') *p++ = *str;
-                ++str;
-        }
+       while (*str) {
+               if (*str != ' ') *p++ = toupper(*str);
+               ++str;
+       }
        *p = '\0';
        return newstring;
 }
@@ -200,7 +200,7 @@ static void show_parameter(int snum, struct parm_struct *parm)
                ptr = lp_local_ptr(snum, ptr);
        }
 
-       printf("<tr><td>%s</td><td>", get_parm_translated(stripspace(parm->label), _("Help"), parm->label));
+       printf("<tr><td>%s</td><td>", get_parm_translated(stripspaceupper(parm->label), _("Help"), parm->label));
        switch (parm->type) {
        case P_CHAR:
                d_printf("<input type=text size=2 name=\"parm_%s\" value=\"%c\">",