clamav-0.88.1-native.patch
上传用户:lswyart
上传日期:2008-06-12
资源大小:3441k
文件大小:465k
源码类别:
杀毒
开发平台:
Visual C++
- diff -auprbN clamav-0.88.1/clamd/clamd.c clamav-0.88.1-native/clamd/clamd.c --- clamav-0.88.1/clamd/clamd.c 2006-01-10 04:52:15.000000000 +1100 +++ clamav-0.88.1-native/clamd/clamd.c 2006-04-06 17:10:41.000000000 +1000 @@ -282,6 +282,8 @@ void clamd(struct optstruct *opt) exit(1); } + root->callback = NULL;
- +
- /* fork into background */ if(!cfgopt(copt, "Foreground")) daemonize(); diff -auprbN clamav-0.88.1/clamd/others.c clamav-0.88.1-native/clamd/others.c --- clamav-0.88.1/clamd/others.c 2005-10-31 07:22:01.000000000 +1100 +++ clamav-0.88.1-native/clamd/others.c 2006-04-06 17:10:41.000000000 +1000 @@ -322,3 +322,25 @@ int readsock(int sockfd, char *buf, size return n; } #endif +
- +/* Moved away from shared/output.c since it uses send and needs to be linked always on winsock lib on win32,
- + anyway it's only used by clamd */
- +int mdprintf(int desc, const char *str, ...)
- +{
- + va_list args;
- + char buff[512];
- + int bytes;
- +
- + va_start(args, str);
- + bytes = vsnprintf(buff, sizeof(buff), str, args);
- + va_end(args);
- +
- + if(bytes == -1)
- + return bytes;
- +
- + if(bytes >= sizeof(buff))
- + bytes = sizeof(buff) - 1;
- +
- + return send(desc, buff, bytes, 0);
- +}
- +
- diff -auprbN clamav-0.88.1/clamd/others.h clamav-0.88.1-native/clamd/others.h --- clamav-0.88.1/clamd/others.h 2005-12-23 12:25:22.000000000 +1100 +++ clamav-0.88.1-native/clamd/others.h 2006-04-06 17:10:41.000000000 +1000 @@ -30,6 +30,7 @@ int poll_fd(int fd, int timeout_sec); int is_fd_connected(int fd); void virusaction(const char *filename, const char *virname, const struct cfgstruct *copt); int writen(int fd, void *buff, unsigned int count); +int mdprintf(int desc, const char *str, ...);
- #if defined(HAVE_RECVMSG) && (defined(HAVE_ACCRIGHTS_IN_MSGHDR) || defined(HAVE_CONTROL_IN_MSGHDR)) && !defined(C_CYGWIN) && !defined(C_OS2) && !defined(INCOMPLETE_CMSG) int readsock(int sockfd, char *buf, size_t size); diff -auprbN clamav-0.88.1/clamd/server-th.c clamav-0.88.1-native/clamd/server-th.c --- clamav-0.88.1/clamd/server-th.c 2006-03-27 07:32:57.000000000 +1100 +++ clamav-0.88.1-native/clamd/server-th.c 2006-04-06 17:10:41.000000000 +1000 @@ -219,6 +219,7 @@ static struct cl_node *reload_db(struct } logg("Database correctly reloaded (%d viruses)n", virnum); + root->callback = NULL;
- return root; } diff -auprbN clamav-0.88.1/clamdscan/client.c clamav-0.88.1-native/clamdscan/client.c --- clamav-0.88.1/clamdscan/client.c 2006-03-26 07:36:09.000000000 +1100 +++ clamav-0.88.1-native/clamdscan/client.c 2006-04-06 17:10:41.000000000 +1000 @@ -571,7 +571,7 @@ void move_infected(const char *filename, } if(rename(filename, movefilename) == -1) { - if(filecopy(filename, movefilename) == -1) { + if(cli_filecopy(filename, movefilename) == -1) {
- mprintf("@cannot move '%s' to '%s': %sn", filename, movefilename, strerror(errno)); notmoved++; free(movefilename); diff -auprbN clamav-0.88.1/clamscan/clamscan.c clamav-0.88.1-native/clamscan/clamscan.c --- clamav-0.88.1/clamscan/clamscan.c 2006-01-10 04:46:05.000000000 +1100 +++ clamav-0.88.1-native/clamscan/clamscan.c 2006-04-06 17:10:41.000000000 +1000 @@ -222,6 +222,7 @@ void help(void) mprintf(" --no-summary Disable summary at end of scanningn"); mprintf(" --infected -i Only print infected filesn"); mprintf(" --bell Sound bell on virus detectionn"); + mprintf(" --show-progress Print progress indicator for each filen");
- mprintf("n"); mprintf(" --tempdir=DIRECTORY Create temporary files in DIRECTORYn"); @@ -276,3 +277,25 @@ void help(void) exit(0); } +
- +#ifdef _WIN32
- +/* Display summary on Ctrl+C, --no-summary is not honored here :( */
- +void console_ctrl_handler(DWORD ctrl_type)
- +{
- + double mb;
- + mprintf("nScanning aborted...n");
- + mprintf("n----------- SCAN SUMMARY -----------n");
- + mprintf("Known viruses: %dn", claminfo.sigs);
- + mprintf("Engine version: %sn", cl_retver());
- + mprintf("Scanned directories: %dn", claminfo.dirs);
- + mprintf("Scanned files: %dn", claminfo.files);
- + mprintf("Infected files: %dn", claminfo.ifiles);
- + if(claminfo.notremoved)
- + mprintf("Not removed: %dn", claminfo.notremoved);
- + if(claminfo.notmoved)
- + mprintf("Not moved: %dn", claminfo.notmoved);
- + mb = claminfo.blocks * (CL_COUNT_PRECISION / 1024) / 1024.0;
- + mprintf("Data scanned: %2.2lf MBn", mb);
- + exit(1);
- +}
- +#endif
- diff -auprbN clamav-0.88.1/clamscan/manager.c clamav-0.88.1-native/clamscan/manager.c --- clamav-0.88.1/clamscan/manager.c 2006-01-10 04:46:23.000000000 +1100 +++ clamav-0.88.1-native/clamscan/manager.c 2006-04-06 17:10:41.000000000 +1000 @@ -29,9 +29,14 @@ #include <ctype.h> #include <sys/stat.h> #include <sys/types.h> +#ifdef HAVE_SYS_WAIT_H
- #include <sys/wait.h> +#endif
- #include <utime.h> +#include <time.h>
- +#ifdef HAVE_USER_GROUP_DB
- #include <grp.h> +#endif
- #include <fcntl.h> #include <unistd.h> #include <sys/types.h> @@ -56,6 +61,45 @@ dev_t procdev; #endif +#ifdef _WIN32
- +#define WIFSIGNALED(x) (x)
- +#define WIFEXITED(x) (1)
- +#define WTERMSIG(x) (x)
- +#endif
- +
- +#ifndef min
- +#define min(a,b) ((a < b) ? a : b)
- +#endif
- +
- +/* Callback */
- +typedef struct _cb_data_t
- +{
- + const char *filename;
- + size_t size, count;
- + int fd;
- + int condition;
- +} cb_data_t;
- +
- +cb_data_t cbdata;
- +
- +static const char *rotation = "|/-\";
- +
- +/* Callback function for scanning */
- +int scancallback(int desc, int bytes)
- +{
- + int percent;
- +
- + if (desc == cbdata.fd)
- + {
- + cbdata.count += bytes;
- + percent = min(100, (int) (((double) cbdata.count) * 100.0f / ((double) cbdata.size)));
- + mprintf("%s: [%3i%%]r", cbdata.filename, percent);
- + }
- + else /* archives or stdin */
- + mprintf("%s: [%c]r", cbdata.filename, rotation[time(NULL) % sizeof(rotation)]);
- +
- + return cbdata.condition;
- +}
- int scanmanager(const struct optstruct *opt) { @@ -69,7 +113,7 @@ int scanmanager(const struct optstruct * /* njh@bandsman.co.uk: BeOS */ -#if !defined(C_CYGWIN) && !defined(C_OS2) && !defined(C_BEOS) +#if !defined(C_CYGWIN) && !defined(C_OS2) && !defined(C_BEOS) && !defined(_WIN32)
- if(!geteuid()) { if((user = getpwnam(UNPUSER)) == NULL) { mprintf("@Can't get information about user "UNPUSER"n"); @@ -127,6 +171,14 @@ int scanmanager(const struct optstruct * return 50; } + /* setup callback */
- + if(optl(opt, "show-progress")) {
- + trie->callback = scancallback;
- + memset(&cbdata, 0, sizeof(cbdata));
- + cbdata.condition = 1;
- + } else
- + trie->callback = NULL;
- +
- /* set (default) limits */ limits = (struct cl_limits *) calloc(1, sizeof(struct cl_limits)); @@ -349,7 +401,9 @@ int scanfile(const char *filename, struc return 0; } +#ifndef _WIN32
- if(geteuid()) +#endif
- if(checkaccess(filename, NULL, R_OK) != 1) { if(!printinfected) mprintf("%s: Access deniedn", filename); @@ -405,6 +459,7 @@ int scanfile(const char *filename, struc && (optl(opt, "tgz") || optl(opt, "deb"))) ) { /* check permissions */ +#ifndef _WIN32
- switch(checkaccess(filename, UNPUSER, R_OK)) { case -1: mprintf("@Can't get information about user "UNPUSER"n"); @@ -431,6 +486,15 @@ int scanfile(const char *filename, struc case 1: return(scancompressed(filename, root, user, opt, limits, options)); } +#else
- + if(limits && limits->maxfilesize)
- + if(fileinfo(filename, 1) / 1024 > limits->maxfilesize) {
- + if(!printinfected)
- + mprintf("%s: Archive too big.n", filename);
- + return 0;
- + }
- + return(scancompressed(filename, root, user, opt, limits, options));
- +#endif /* _WIN32 */
- } if((ret = checkfile(filename, root, limits, options, printclean)) == CL_VIRUS) { @@ -465,15 +529,7 @@ int scancompressed(const char *filename, } /* check write access */ - - tmpdir = getenv("TMPDIR"); - - if(tmpdir == NULL) -#ifdef P_tmpdir - tmpdir = P_tmpdir; -#else - tmpdir = "/tmp"; -#endif + tmpdir = cli_gettempdir();
- if(checkaccess(tmpdir, UNPUSER, W_OK) != 1) { mprintf("@Can't write to the temporary directoryn"); @@ -488,7 +544,7 @@ int scancompressed(const char *filename, exit(63); /* critical */ } -#ifndef C_OS2 +#if !defined(C_OS2) && !defined(_WIN32)
- if(user) chown(gendir, user->pw_uid, user->pw_gid); #endif @@ -670,16 +726,7 @@ int scandenied(const char *filename, str } /* check write access */ - - tmpdir = getenv("TMPDIR"); - - if(tmpdir == NULL) -#ifdef P_tmpdir - tmpdir = P_tmpdir; -#else - tmpdir = "/tmp"; -#endif - + tmpdir = cli_gettempdir();
- if(checkaccess(tmpdir, UNPUSER, W_OK) != 1) { mprintf("@Can't write to the temporary directory %sn", tmpdir); @@ -702,7 +749,7 @@ int scandenied(const char *filename, str sprintf(tmpfile, "%s/%s", gendir, pt); - if(filecopy(filename, tmpfile) == -1) { + if(cli_filecopy(filename, tmpfile) == -1) {
- mprintf("!I/O errorn"); perror("copyfile()"); exit(58); @@ -710,7 +757,7 @@ int scandenied(const char *filename, str fixperms(gendir); -#ifndef C_OS2 +#if !defined(C_OS2) && !defined(_WIN32)
- if(user) { chown(gendir, user->pw_uid, user->pw_gid); chown(tmpfile, user->pw_uid, user->pw_gid); @@ -756,11 +803,17 @@ int checkfile(const char *filename, cons mprintf("*Scanning %sn", filename); - if((fd = open(filename, O_RDONLY)) == -1) { + if((fd = open(filename, O_RDONLY|O_BINARY)) == -1) {
- mprintf("@Can't open file %sn", filename); return 54; } + cbdata.count = 0;
- + cbdata.fd = fd;
- + cbdata.filename = filename;
- + cbdata.size = lseek(fd, 0, SEEK_END);
- + lseek(fd, 0, SEEK_SET);
- +
- if((ret = cl_scandesc(fd, &virname, &claminfo.blocks, root, limits, options)) == CL_VIRUS) { mprintf("%s: %s FOUNDn", filename, virname); logg("%s: %s FOUNDn", filename, virname); @@ -771,7 +824,7 @@ int checkfile(const char *filename, cons } else if(ret == CL_CLEAN) { if(!printinfected && printclean) - mprintf("%s: OKn", filename); + mprintf("%s: OK n", filename);
- } else if(!printinfected) mprintf("%s: %sn", filename, cl_strerror(ret)); @@ -787,16 +840,13 @@ int checkstdin(const struct cl_node *roo char *file, buff[FILEBUFF]; FILE *fs; + cbdata.count = 0;
- + cbdata.fd = fileno(stdin);
- + cbdata.filename = "stdin";
- + cbdata.size = -1;
- /* check write access */ - tmpdir = getenv("TMPDIR"); - - if(tmpdir == NULL) -#ifdef P_tmpdir - tmpdir = P_tmpdir; -#else - tmpdir = "/tmp"; -#endif + tmpdir = cli_gettempdir();
- if(checkaccess(tmpdir, UNPUSER, W_OK) != 1) { mprintf("@Can't write to temporary directoryn"); @@ -810,6 +860,14 @@ int checkstdin(const struct cl_node *roo return 63; } +#ifdef _WIN32
- + if (setmode(fileno(stdin), O_BINARY) == -1)
- + {
- + mprintf("@Cannot set binary mode for stdinn");
- + return 62;
- + }
- +#endif
- +
- while((ret = fread(buff, 1, FILEBUFF, stdin))) fwrite(buff, 1, ret, fs); @@ -827,7 +885,7 @@ int checkstdin(const struct cl_node *roo } else if(ret == CL_CLEAN) { if(!printinfected) - mprintf("stdin: OKn"); + mprintf("stdin: OK n");
- } else if(!printinfected) mprintf("stdin: %sn", cl_strerror(ret)); @@ -869,7 +927,11 @@ int clamav_unpack(const char *prog, char } else maxspace = 0; - +#ifdef _WIN32
- + /* Warning no support for maxfiles/maxspace while unpacking on win32 */
- + {
- + status = spawnvp(P_WAIT, prog, args);
- +#else
- switch(pid = fork()) { case -1: return -1; @@ -929,14 +991,15 @@ int clamav_unpack(const char *prog, char } } else waitpid(pid, &status, 0); - +#endif /* _WIN32 */
- if(WIFSIGNALED(status)) { switch(WTERMSIG(status)) { - +#ifndef _WIN32
- case 9: mprintf("nUnpacker process %d stopped due to exceeded limitsn", pid); return 0; +#endif
- case 6: /* abort */ mprintf("@Can't run %sn", prog); return -2; @@ -972,8 +1035,9 @@ void move_infected(const char *filename, return; } - if(!(tmp = strrchr(filename, '/'))) - tmp = (char *) filename; + tmp = (char *) (filename + strlen(filename) - 1);
- + while ((tmp > filename) && (*tmp != '/') && (*tmp != '\')) tmp--;
- + if (tmp > filename) tmp++; /* Trailing slash */
- movefilename_size = sizeof(char) * (strlen(movedir) + strlen(tmp) + sizeof(numext) + 2); @@ -1027,7 +1091,7 @@ void move_infected(const char *filename, } if(rename(filename, movefilename) == -1) { - if(filecopy(filename, movefilename) == -1) { + if(cli_filecopy(filename, movefilename) == -1) {
- mprintf("@cannot move '%s' to '%s': %sn", filename, movefilename, strerror(errno)); claminfo.notmoved++; free(movefilename); @@ -1035,7 +1099,7 @@ void move_infected(const char *filename, } chmod(movefilename, fstat.st_mode); -#ifndef C_OS2 +#if !defined(C_OS2) && !defined(_WIN32)
- chown(movefilename, fstat.st_uid, fstat.st_gid); #endif diff -auprbN clamav-0.88.1/clamscan/manager.h clamav-0.88.1-native/clamscan/manager.h --- clamav-0.88.1/clamscan/manager.h 2005-06-24 06:03:08.000000000 +1000 +++ clamav-0.88.1-native/clamscan/manager.h 2006-04-06 17:10:41.000000000 +1000 @@ -20,7 +20,9 @@ #define __MANAGER_H #include <clamav.h> +#ifdef HAVE_USER_GROUP_DB
- #include <pwd.h> +#endif
- #include "options.h" int scanmanager(const struct optstruct *opt); diff -auprbN clamav-0.88.1/clamscan/options.c clamav-0.88.1-native/clamscan/options.c --- clamav-0.88.1/clamscan/options.c 2005-06-24 06:03:09.000000000 +1000 +++ clamav-0.88.1-native/clamscan/options.c 2006-04-06 17:10:41.000000000 +1000 @@ -47,6 +47,14 @@ static char clamdscan_short[] = { 'h', ' int clamdscan_mode = 0; +#ifdef _WIN32 /* Report summary on Ctrl+C */
- +extern void console_ctrl_handler(DWORD ctrl_type);
- +static void stop_console_handler(void)
- +{
- + SetConsoleCtrlHandler((PHANDLER_ROUTINE) console_ctrl_handler, FALSE);
- +}
- +#endif
- +
- int main(int argc, char **argv) { int ret, opt_index, i, len; @@ -73,6 +81,7 @@ int main(int argc, char **argv) {"force", 0, 0, 0}, {"recursive", 0, 0, 'r'}, {"bell", 0, 0, 0}, + {"show-progress", 0, 0, 0},
- {"disable-summary", 0, 0, 0}, /* obsolete */ {"no-summary", 0, 0, 0}, {"infected", 0, 0, 'i'}, @@ -169,11 +178,26 @@ int main(int argc, char **argv) for(i=optind; i<argc; i++) { strncat(opt->filename, argv[i], strlen(argv[i])); +#ifdef _WIN32
- + {
- + /* strip trailing / */
- + char *check = &opt->filename[strlen(opt->filename) - 1];
- + while ((*check == '\') || (*check == '/'))
- + *check-- = 0;
- +
- + /* Allow c: d: notation */
- + if (opt->filename[strlen(opt->filename)-1] == ':')
- + strcat(opt->filename, "/");
- + }
- +#endif
- if(i != argc-1) strncat(opt->filename, "t", 1); } } +#ifdef _WIN32
- + INSTALL_CTRL_C_HANDLER();
- +#endif
- ret = clamscan(opt); free_opt(opt); diff -auprbN clamav-0.88.1/clamscan/others.c clamav-0.88.1-native/clamscan/others.c --- clamav-0.88.1/clamscan/others.c 2005-06-24 06:03:08.000000000 +1000 +++ clamav-0.88.1-native/clamscan/others.c 2006-04-06 17:10:41.000000000 +1000 @@ -30,10 +30,14 @@ #include <ctype.h> #include <unistd.h> #include <errno.h> +#ifdef HAVE_USER_GROUP_DB
- #include <pwd.h> +#endif
- #include <sys/types.h> #include <sys/stat.h> +#ifdef HAVE_SYS_WAIT_H
- #include <sys/wait.h> +#endif
- #include <sys/time.h> #include <time.h> #include <fcntl.h> @@ -74,6 +78,12 @@ int fileinfo(const char *filename, short int checkaccess(const char *path, const char *username, int mode) { +#ifdef _WIN32
- + /* Assume the file can be accessed, a fully compliant port here
- + would break the function in two part, win9x will be always dummy,
- + on winxp/2k/2k3 it would be not trivial. */
- + return 1;
- +#else
- struct passwd *user; int ret = 0, status; @@ -115,6 +125,7 @@ int checkaccess(const char *path, const } return ret; +#endif /* _WIN32 */
- } int match_regex(const char *filename, const char *pattern) @@ -122,7 +133,7 @@ int match_regex(const char *filename, co #ifdef HAVE_REGEX_H regex_t reg; int match, flags; -#if !defined(C_CYGWIN) && !defined(C_OS2) +#if !defined(C_CYGWIN) && !defined(C_OS2) && !defined(_WIN32)
- flags = REG_EXTENDED; #else flags = REG_EXTENDED | REG_ICASE; /* case insensitive on Windows */ diff -auprbN clamav-0.88.1/clamscan/treewalk.c clamav-0.88.1-native/clamscan/treewalk.c --- clamav-0.88.1/clamscan/treewalk.c 2005-12-23 12:16:56.000000000 +1100 +++ clamav-0.88.1-native/clamscan/treewalk.c 2006-04-06 17:10:41.000000000 +1000 @@ -26,8 +26,12 @@ #include <unistd.h> #include <sys/stat.h> #include <sys/types.h> +#ifdef HAVE_SYS_WAIT_H
- #include <sys/wait.h> +#endif
- +#ifdef HAVE_USER_GROUP_DB
- #include <grp.h> +#endif
- #include <dirent.h> #include <errno.h> @@ -134,67 +138,11 @@ int treewalk(const char *dirname, struct } -int rmdirs(const char *dirname) -{ - DIR *dd; - struct dirent *dent; - struct stat maind, statbuf; - char *fname; - - if((dd = opendir(dirname)) != NULL) { - while(stat(dirname, &maind) != -1) { - if(!rmdir(dirname)) break; - if(errno != ENOTEMPTY && errno != EEXIST && errno != EBADF) { - mprintf("@Can't remove temporary directory %s: %sn", dirname, strerror(errno)); - closedir(dd); - return 0; - } - - while((dent = readdir(dd))) { -#ifndef C_INTERIX - if(dent->d_ino) -#endif - { - if(strcmp(dent->d_name, ".") && strcmp(dent->d_name, "..")) { - fname = mcalloc(strlen(dirname) + strlen(dent->d_name) + 2, sizeof(char)); - sprintf(fname, "%s/%s", dirname, dent->d_name); - - /* stat the file */ - if(lstat(fname, &statbuf) != -1) { - if(S_ISDIR(statbuf.st_mode) && !S_ISLNK(statbuf.st_mode)) { - if(rmdir(fname) == -1) { /* can't be deleted */ - if(errno == EACCES) { - mprintf("@Can't remove some temporary directories due to access problem.n"); - closedir(dd); - return 0; - } - rmdirs(fname); - } - } else - unlink(fname); - } - - free(fname); - } - } - } - - rewinddir(dd); - - } - - } else { - if(!printinfected) - mprintf("%s: Can't open directory.n", dirname); - return 53; - } - - closedir(dd); - return 0; -} - int clamav_rmdirs(const char *dir) { +#ifdef _WIN32
- + return cli_rmdirs(dir);
- +#else
- #ifndef C_CYGWIN struct passwd *user; #endif @@ -229,7 +177,7 @@ int clamav_rmdirs(const char *dir) } } #endif - rmdirs(dir); + cli_rmdirs(dir);
- exit(0); break; default: @@ -239,7 +187,7 @@ int clamav_rmdirs(const char *dir) else return -2; } - +#endif /* _WIN32 */
- } int fixperms(const char *dirname) diff -auprbN clamav-0.88.1/clamscan/treewalk.h clamav-0.88.1-native/clamscan/treewalk.h --- clamav-0.88.1/clamscan/treewalk.h 2005-06-24 06:03:08.000000000 +1000 +++ clamav-0.88.1-native/clamscan/treewalk.h 2006-04-06 17:10:41.000000000 +1000 @@ -19,7 +19,9 @@ #ifndef __TREEWALK_H #define __TREEWALK_H +#ifdef HAVE_USER_GROUP_DB
- #include <pwd.h> +#endif
- #include <clamav.h> #include "options.h" @@ -31,7 +33,6 @@ struct s_du { int treewalk(const char *dirname, struct cl_node *root, const struct passwd *user, const struct optstruct *opt, const struct cl_limits *limits, int options, unsigned int depth); -int rmdirs(const char *dirname); int clamav_rmdirs(const char *dir); int fixperms(const char *dirname); int du(const char *dirname, struct s_du *n); diff -auprbN clamav-0.88.1/contrib/msvc/README.txt clamav-0.88.1-native/contrib/msvc/README.txt --- clamav-0.88.1/contrib/msvc/README.txt 1970-01-01 10:00:00.000000000 +1000 +++ clamav-0.88.1-native/contrib/msvc/README.txt 2006-04-06 17:10:43.000000000 +1000 @@ -0,0 +1,49 @@ +*** ClamAV native win32 port for 0.88.1 ***
- +
- +Copyright (c) 2005-2006 Gianluigi Tiesi <sherpya@netfarm.it>
- +
- +This program is free software; you can redistribute it and/or
- +modify it under the terms of the GNU Library General Public
- +License as published by the Free Software Foundation; either
- +version 2 of the License, or (at your option) any later version.
- +
- +This library is distributed in the hope that it will be useful,
- +but WITHOUT ANY WARRANTY; without even the implied warranty of
- +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- +Library General Public License for more details.
- +You should have received a copy of the GNU Library General Public
- +License along with this software; if not, write to the
- +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- +
- +***
- +
- +[what is working]
- +- libclamav dll linkable from external applications
- +- freshclam with dns query support (silent disabled on Win95 and NT4 due to missing os functionalities)
- +- sigtool
- +- No need for cygwin dlls or registry keys to handle temp directory (it's a native port)
- +- db path and config path can be optionally stored in the registry (see notes)
- +- The patch applies to 0.88.1 and doesn't affect unix compilation
- + (autoconf should be called before building it on unix)
- +
- +[what is not working]
- +- clamd/clamdscan - probabily they will never ported
- +- clamscan could crash unexpectly due to different behaviour of some functions on win32
- + please send me the file that causes the crash so I can fix it
- +
- +[todo]
- +- check mmap port for incompatibilites
- +- no support for maxfiles maxspace checks while unpacking with external programs
- +
- +- You can store database and config paths in the registry using the clamav.reg file
- + (I may make a nsis installer in the future), paths can be also REG_EXPAND_SZ,
- + environment variables are permitted (i.e. you can use paths like %HomeDrive%Clamav).
- +
- +- To use binaries compiled with Visual Studio 2005, you need the msvcrt80 side by side assembly,
- + the "simple way" is uncompress Microsoft.VC80.CRT.zip in the directory of executables,
- + the directory Microsoft.VC80.CRT must be placed as is, putting directly dlls in the same directory
- + of the executable will not work. On windows 9x you should put the dll and the manifest in windows
- + system directory without the Microsoft.VC80.CRT directory. For more info about this refer to the
- + relative msdn-page. You can also download the redist package directly from Microsoft.
- +
- +!!!! Please report bugs to sherpya@netfarm.it and not to bugs@clamav.net !!!!
- diff -auprbN clamav-0.88.1/contrib/msvc/clamav-config.h clamav-0.88.1-native/contrib/msvc/clamav-config.h --- clamav-0.88.1/contrib/msvc/clamav-config.h 1970-01-01 10:00:00.000000000 +1000 +++ clamav-0.88.1-native/contrib/msvc/clamav-config.h 2006-04-06 17:10:43.000000000 +1000 @@ -0,0 +1,121 @@ +/* Define if your snprintf is busted */
- +
- +/* "build clamd" */
- +/* #define BUILD_CLAMD 1 */
- +
- +/* thread safe */
- +#define CL_THREAD_SAFE 1
- +
- +/* where to look for the config file */
- +#define CONFDIR "."
- +
- +/* Path to virus database directory. */
- +#define DATADIR "."
- +
- +/* Name of the main database */
- +#define DB1NAME "main.cvd"
- +
- +/* Name of the daily database */
- +#define DB2NAME "daily.cvd"
- +
- +/* "default FD_SETSIZE value" */
- +#define DEFAULT_FD_SETSIZE 64
- +
- +/* file i/o buffer size */
- +#define FILEBUFF 8192
- +
- +/* have bzip2 */
- +#define HAVE_BZLIB_H 1
- +
- +/* have gmp installed */
- +#ifndef _M_X64 /* not yet working on x86_64 */
- +#define HAVE_GMP 1
- +#endif
- +
- +/* Define to 1 if you have the <inttypes.h> header file. */
- +#define HAVE_INTTYPES_H 1
- +
- +/* Define to 1 if you have the <limits.h> header file. */
- +#define HAVE_LIMITS_H 1
- +
- +/* Define to 1 if you have the <malloc.h> header file. */
- +#define HAVE_MALLOC_H 1
- +
- +/* Define to 1 if you have the `memcpy' function. */
- +#define HAVE_MEMCPY 1
- +
- +/* Define to 1 if you have the <memory.h> header file. */
- +#define HAVE_MEMORY_H 1
- +
- +/* Define to 1 if you have a working `mmap' system call. */
- +#define HAVE_MMAP 1
- +
- +/* Define to 1 if you have the <sys/mman.h> header file. */
- +#define HAVE_SYS_MMAN_H 1
- +
- +/* "pragma pack" */
- +#define HAVE_PRAGMA_PACK 1
- +
- +/* Define to 1 if you have the <regex.h> header file. */
- +#define HAVE_REGEX_H 1
- +
- +/* Define to 1 if you have the `snprintf' function. */
- +/* #undef HAVE_SNPRINTF */
- +
- +/* Define to 1 if you have the <stdlib.h> header file. */
- +#define HAVE_STDLIB_H 1
- +
- +/* Define to 1 if you have the <string.h> header file. */
- +#define HAVE_STRING_H 1
- +
- +/* Define to 1 if you have the <sys/stat.h> header file. */
- +#define HAVE_SYS_STAT_H 1
- +
- +/* Define to 1 if you have the <sys/types.h> header file. */
- +#define HAVE_SYS_TYPES_H 1
- +
- +/* zlib installed */
- +#define HAVE_ZLIB_H 1
- +
- +/* "no fd_set" */
- +#define NO_FD_SET 1
- +
- +/* Name of package */
- +#define PACKAGE "clamav"
- +
- +/* scan buffer size */
- +#define SCANBUFF 131072
- +
- +/* The number of bytes in type int */
- +#define SIZEOF_INT 4
- +
- +/* The number of bytes in type long */
- +#define SIZEOF_LONG 4
- +
- +/* The number of bytes in type long long */
- +#define SIZEOF_LONG_LONG 8
- +
- +/* The number of bytes in type short */
- +#define SIZEOF_SHORT 2
- +
- +/* Define to 1 if you have the ANSI C header files. */
- +#define STDC_HEADERS 1
- +
- +/* Version number of package */
- +#define VERSION "0.88.1"
- +
- +/* use libcurl in mbox code */
- +/* #define WITH_CURL 1 */
- +/* #define CURL_STATICLIB */
- +
- +/* endianess */
- +#define WORDS_BIGENDIAN 0
- +
- +/* thread safe */
- +/* #undef _REENTRANT */
- +
- +/* Define to `__inline__' or `__inline' if that's what the C compiler
- + calls it, or to nothing if 'inline' is not supported under any name. */
- +#define inline _inline
- +
- +#include <osdeps.h>
- diff -auprbN clamav-0.88.1/contrib/msvc/clamav.dsw clamav-0.88.1-native/contrib/msvc/clamav.dsw --- clamav-0.88.1/contrib/msvc/clamav.dsw 1970-01-01 10:00:00.000000000 +1000 +++ clamav-0.88.1-native/contrib/msvc/clamav.dsw 2006-04-06 17:10:43.000000000 +1000 @@ -0,0 +1,74 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00
- +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
- +
- +###############################################################################
- +
- +Project: "clamscan"=".clamscan.dsp" - Package Owner=<4>
- +
- +Package=<5>
- +{{{
- +}}}
- +
- +Package=<4>
- +{{{
- + Begin Project Dependency
- + Project_Dep_Name libclamav
- + End Project Dependency
- +}}}
- +
- +###############################################################################
- +
- +Project: "freshclam"=".freshclam.dsp" - Package Owner=<4>
- +
- +Package=<5>
- +{{{
- +}}}
- +
- +Package=<4>
- +{{{
- + Begin Project Dependency
- + Project_Dep_Name libclamav
- + End Project Dependency
- +}}}
- +
- +###############################################################################
- +
- +Project: "libclamav"=".libclamav.dsp" - Package Owner=<4>
- +
- +Package=<5>
- +{{{
- +}}}
- +
- +Package=<4>
- +{{{
- +}}}
- +
- +###############################################################################
- +
- +Project: "sigtool"=".sigtool.dsp" - Package Owner=<4>
- +
- +Package=<5>
- +{{{
- +}}}
- +
- +Package=<4>
- +{{{
- + Begin Project Dependency
- + Project_Dep_Name libclamav
- + End Project Dependency
- +}}}
- +
- +###############################################################################
- +
- +Global:
- +
- +Package=<5>
- +{{{
- +}}}
- +
- +Package=<3>
- +{{{
- +}}}
- +
- +###############################################################################
- +
- diff -auprbN clamav-0.88.1/contrib/msvc/clamav.rc clamav-0.88.1-native/contrib/msvc/clamav.rc --- clamav-0.88.1/contrib/msvc/clamav.rc 1970-01-01 10:00:00.000000000 +1000 +++ clamav-0.88.1-native/contrib/msvc/clamav.rc 2006-04-06 17:10:43.000000000 +1000 @@ -0,0 +1,39 @@ +#include <windows.h>
- +
- +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
- +
- +VS_VERSION_INFO VERSIONINFO
- + FILEVERSION 0,88,1,0
- + PRODUCTVERSION 0,88,1,0
- + FILEFLAGSMASK 0x17L
- +#ifdef _DEBUG
- + FILEFLAGS 0x1L
- +#else
- + FILEFLAGS 0x0L
- +#endif
- + FILEOS 0x4L
- + FILETYPE 0x2L
- + FILESUBTYPE 0x0L
- +BEGIN
- + BLOCK "StringFileInfo"
- + BEGIN
- + BLOCK "00000409"
- + BEGIN
- + VALUE "FileDescription", "ClamAV Antivirus"
- + VALUE "FileVersion", "0, 88, 1, 0"
- + VALUE "InternalName", __MODULE__
- + VALUE "LegalCopyright", "Copyright (C) 2006 ClamAV Team"
- + VALUE "OriginalFilename", __MODULE__
- + VALUE "ProductName", "ClamAV Antivirus"
- + VALUE "ProductVersion", "0, 88, 1, 0"
- + END
- + END
- + BLOCK "VarFileInfo"
- + BEGIN
- + VALUE "Translation", 0x0, 1033
- + END
- +END
- +
- +#ifdef __ICON__
- +100 ICON __ICON__
- +#endif
- diff -auprbN clamav-0.88.1/contrib/msvc/clamav.reg clamav-0.88.1-native/contrib/msvc/clamav.reg --- clamav-0.88.1/contrib/msvc/clamav.reg 1970-01-01 10:00:00.000000000 +1000 +++ clamav-0.88.1-native/contrib/msvc/clamav.reg 2006-04-06 17:10:43.000000000 +1000 @@ -0,0 +1,6 @@ +REGEDIT4
- +
- +[HKEY_LOCAL_MACHINESOFTWAREClamAV]
- +"ConfigDir"="C:\Clamav"
- +"DataDir"="C:\Clamav\db"
- +
- diff -auprbN clamav-0.88.1/contrib/msvc/clamav.sln clamav-0.88.1-native/contrib/msvc/clamav.sln --- clamav-0.88.1/contrib/msvc/clamav.sln 1970-01-01 10:00:00.000000000 +1000 +++ clamav-0.88.1-native/contrib/msvc/clamav.sln 2006-04-06 17:10:43.000000000 +1000 @@ -0,0 +1,62 @@ +锘