git-svn: trunk@4836
Török Edvin authored on 2009/02/19 17:50:04... | ... |
@@ -1,3 +1,7 @@ |
1 |
+Thu Feb 19 11:20:58 EET 2009 (edwin) |
|
2 |
+------------------------------------ |
|
3 |
+ * clamd/, etc/, libclamav/, unit_tests/: fix distcheck. |
|
4 |
+ |
|
1 | 5 |
Wed Feb 18 23:12:36 CET 2009 (tk) |
2 | 6 |
--------------------------------- |
3 | 7 |
* libclamav/textdet.c: improve UTF-16 detection (bb#1209) |
... | ... |
@@ -162,7 +162,8 @@ void sighandler_th(int sig) |
162 | 162 |
} |
163 | 163 |
/* a signal doesn't always wake poll(), for example on FreeBSD */ |
164 | 164 |
if (action && syncpipe_wake_recv_w != -1) |
165 |
- write(syncpipe_wake_recv_w, "", 1); |
|
165 |
+ if (write(syncpipe_wake_recv_w, "", 1) != 1) |
|
166 |
+ logg("$Failed to write to syncpipe\n"); |
|
166 | 167 |
} |
167 | 168 |
|
168 | 169 |
static struct cl_engine *reload_db(struct cl_engine *engine, unsigned int dboptions, const struct optstruct *opts, int do_check, int *ret) |
... | ... |
@@ -221,7 +221,7 @@ target_os = @target_os@ |
221 | 221 |
target_vendor = @target_vendor@ |
222 | 222 |
top_builddir = @top_builddir@ |
223 | 223 |
top_srcdir = @top_srcdir@ |
224 |
-EXTRA_DIST = clamd.conf freshclam.conf |
|
224 |
+EXTRA_DIST = clamd.conf freshclam.conf clamav-milter.conf |
|
225 | 225 |
CFGINST = @CFGDIR@ |
226 | 226 |
all: all-am |
227 | 227 |
|
... | ... |
@@ -444,7 +444,7 @@ int hashset_init(struct hashset* hs, size_t initial_capacity, uint8_t load_facto |
444 | 444 |
|
445 | 445 |
void hashset_destroy(struct hashset* hs) |
446 | 446 |
{ |
447 |
- cli_dbgmsg(MODULE_NAME "Freeing hashset, elements: %lu, capacity: %lu\n", hs->count, hs->capacity); |
|
447 |
+ cli_dbgmsg(MODULE_NAME "Freeing hashset, elements: %u, capacity: %u\n", hs->count, hs->capacity); |
|
448 | 448 |
free(hs->keys); |
449 | 449 |
free(hs->bitmap); |
450 | 450 |
hs->keys = hs->bitmap = NULL; |
... | ... |
@@ -497,7 +497,7 @@ static int hashset_grow(struct hashset *hs) |
497 | 497 |
|
498 | 498 |
/* in-place growing is not possible, since the new keys |
499 | 499 |
* will hash to different locations. */ |
500 |
- cli_dbgmsg(MODULE_NAME "Growing hashset, used: %lu, capacity: %lu\n", hs->count, hs->capacity); |
|
500 |
+ cli_dbgmsg(MODULE_NAME "Growing hashset, used: %u, capacity: %u\n", hs->count, hs->capacity); |
|
501 | 501 |
/* create a bigger hashset */ |
502 | 502 |
if((rc = hashset_init(&new_hs, hs->capacity << 1, hs->limit*100/hs->capacity)) < 0) { |
503 | 503 |
return rc; |
... | ... |
@@ -1206,7 +1206,7 @@ static int hash_match(const struct regex_matcher *rlist, const char *host, size_ |
1206 | 1206 |
|
1207 | 1207 |
#define URL_MAX_LEN 1024 |
1208 | 1208 |
#define COMPONENTS 4 |
1209 |
-int cli_url_canon(const char *inurl, size_t len, char *urlbuff, size_t dest_len, char **host, size_t *hostlen, char **path, size_t *pathlen) |
|
1209 |
+int cli_url_canon(const char *inurl, size_t len, char *urlbuff, size_t dest_len, char **host, size_t *hostlen, const char **path, size_t *pathlen) |
|
1210 | 1210 |
{ |
1211 | 1211 |
char *url, *p, *last; |
1212 | 1212 |
char *host_begin, *path_begin; |
... | ... |
@@ -1285,13 +1285,13 @@ int cli_url_canon(const char *inurl, size_t len, char *urlbuff, size_t dest_len, |
1285 | 1285 |
*p = '\0'; |
1286 | 1286 |
path_len = p - path_begin; |
1287 | 1287 |
} |
1288 |
+ *path = path_begin; |
|
1288 | 1289 |
} else { |
1289 | 1290 |
path_len = 0; |
1290 |
- path_begin = ""; |
|
1291 |
+ *path = ""; |
|
1291 | 1292 |
} |
1292 | 1293 |
str_make_lowercase(host_begin, host_len); |
1293 | 1294 |
*host = host_begin; |
1294 |
- *path = path_begin; |
|
1295 | 1295 |
*hostlen = host_len; |
1296 | 1296 |
*pathlen = path_len; |
1297 | 1297 |
return CL_PHISH_NODECISION; |
... | ... |
@@ -1300,7 +1300,8 @@ int cli_url_canon(const char *inurl, size_t len, char *urlbuff, size_t dest_len, |
1300 | 1300 |
static int url_hash_match(const struct regex_matcher *rlist, const char *inurl, size_t len) |
1301 | 1301 |
{ |
1302 | 1302 |
size_t j, k, ji, ki; |
1303 |
- char *host_begin, *path_begin; |
|
1303 |
+ char *host_begin; |
|
1304 |
+ const char *path_begin; |
|
1304 | 1305 |
const char *component; |
1305 | 1306 |
size_t path_len; |
1306 | 1307 |
size_t host_len; |
... | ... |
@@ -72,7 +72,7 @@ void phish_disable(struct cl_engine* engine,const char* reason); |
72 | 72 |
/* Global, non-thread-safe functions, call only once! */ |
73 | 73 |
int phishing_init(struct cl_engine* engine); |
74 | 74 |
void phishing_done(struct cl_engine* engine); |
75 |
-int cli_url_canon(const char *inurl, size_t len, char *urlbuff, size_t dest_len, char **host, size_t *hostlen, char **path, size_t *pathlen); |
|
75 |
+int cli_url_canon(const char *inurl, size_t len, char *urlbuff, size_t dest_len, char **host, size_t *hostlen, const char **path, size_t *pathlen); |
|
76 | 76 |
/* end of non-thread-safe functions */ |
77 | 77 |
|
78 | 78 |
|
... | ... |
@@ -1992,7 +1992,7 @@ static void cli_md5db_build(struct cli_matcher* root) |
1992 | 1992 |
{ |
1993 | 1993 |
if(root && root->md5_sizes_hs.capacity) { |
1994 | 1994 |
/* TODO: use hashset directly, instead of the array when matching*/ |
1995 |
- cli_dbgmsg("Converting hashset to array: %lu entries\n", root->md5_sizes_hs.count); |
|
1995 |
+ cli_dbgmsg("Converting hashset to array: %u entries\n", root->md5_sizes_hs.count); |
|
1996 | 1996 |
|
1997 | 1997 |
#ifdef USE_MPOOL |
1998 | 1998 |
{ |
... | ... |
@@ -226,7 +226,7 @@ static const struct rtest { |
226 | 226 |
"http://pages.ebay.de@fake.example.com","pages.ebay.de",0}, |
227 | 227 |
{NULL,"http://key.com","https://key.com",0}, |
228 | 228 |
{NULL,"http://key.com%00fake.example.com","https://key.com",0}, |
229 |
- {NULL,"http://key.com.example.com","key.com.invalid"} |
|
229 |
+ {NULL,"http://key.com.example.com","key.com.invalid",0} |
|
230 | 230 |
}; |
231 | 231 |
|
232 | 232 |
#ifdef CHECK_HAVE_LOOPS |
... | ... |
@@ -440,7 +440,8 @@ static struct uc { |
440 | 440 |
START_TEST (test_url_canon) |
441 | 441 |
{ |
442 | 442 |
char urlbuff[1024+3]; |
443 |
- char *host = NULL, *path = NULL; |
|
443 |
+ char *host = NULL; |
|
444 |
+ const char *path = NULL; |
|
444 | 445 |
size_t host_len, path_len; |
445 | 446 |
struct uc *u = &uc[_i]; |
446 | 447 |
|