Hi,
I have read clamd.conf(5) and I have discovered that arguments can't contain 
blank characters. On my laptop I share the database directory between windows 
and Linux. The path of this directory has some spaces.

I have written a little patch to shared/cfgparser.c to support spaces in the
configuration options.

--- clamav-0.88/shared/cfgparser.c      2005-09-16 01:42:58.000000000 +0200
+++ clamav-0.88.new/shared/cfgparser.c  2006-03-18 18:51:16.000000000 +0100
@@ -138,7 +138,39 @@
 
 
        if((name = cli_strtok(buff, 0, " \r\n"))) {
-           arg = cli_strtok(buff, 1, " \r\n");
+               char *token;
+               unsigned new_len, pos = 1, go_on;
+
+               arg = NULL;
+
+               do {
+                       token = cli_strtok(buff, pos++, " \r\n");
+
+                       if( token != NULL ) {
+                               if( arg == NULL )
+                                       new_len = strlen(token);
+                               else
+                                       new_len = strlen(arg) + 1 + 
strlen(token);
+
+                               arg = (char *) cli_realloc(arg, new_len + 1);
+
+                               if(new_len != strlen(token))
+                                       strncat(arg, " ", 1);
+                               else
+                                       arg[0] = '\0';
+                                  
+                               strncat(arg, token, strlen(token));
+
+                               free(token);
+
+                               go_on = 1;
+                       }
+                       else {
+                               go_on = 0;
+                       }
+               }
+               while( go_on );
+
            found = 0;
            for(i = 0; ; i++) {
                pt = &cfg_options[i];
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html

Reply via email to