[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.95+dfsg-1-6156-g094ec9b
aCaB
acab at clamav.net
Sun Apr 4 01:07:54 UTC 2010
The following commit has been merged in the debian/unstable branch:
commit ad0afaf1851ab6cff18b83b7d5822fec28192bbb
Author: aCaB <acab at clamav.net>
Date: Tue Oct 13 20:14:52 2009 +0200
win32: add clamscan
diff --git a/ChangeLog b/ChangeLog
index 735270e..431929d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Tue Oct 13 20:13:53 CEST 2009 (acab)
+------------------------------------
+ * win32: clamscan builds (and will scan soon...)
+
Tue Oct 13 00:54:05 CEST 2009 (acab)
------------------------------------
* win32/compat: add POSIX compatible snprintf
diff --git a/win32/ClamAV.sln b/win32/ClamAV.sln
index f692aa5..a172e7b 100644
--- a/win32/ClamAV.sln
+++ b/win32/ClamAV.sln
@@ -3,6 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 10.00
# Visual C++ Express 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libclamav", "libclamav.vcproj", "{3AD5B16C-340A-40AC-96AD-6017B941A316}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clamscan", "clamscan.vcproj", "{F79E7CA7-E49D-479E-8D68-0EA9CB585575}"
+ ProjectSection(ProjectDependencies) = postProject
+ {3AD5B16C-340A-40AC-96AD-6017B941A316} = {3AD5B16C-340A-40AC-96AD-6017B941A316}
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -13,6 +18,10 @@ Global
{3AD5B16C-340A-40AC-96AD-6017B941A316}.Debug|Win32.Build.0 = Debug|Win32
{3AD5B16C-340A-40AC-96AD-6017B941A316}.Release|Win32.ActiveCfg = Release|Win32
{3AD5B16C-340A-40AC-96AD-6017B941A316}.Release|Win32.Build.0 = Release|Win32
+ {F79E7CA7-E49D-479E-8D68-0EA9CB585575}.Debug|Win32.ActiveCfg = Debug|Win32
+ {F79E7CA7-E49D-479E-8D68-0EA9CB585575}.Debug|Win32.Build.0 = Debug|Win32
+ {F79E7CA7-E49D-479E-8D68-0EA9CB585575}.Release|Win32.ActiveCfg = Release|Win32
+ {F79E7CA7-E49D-479E-8D68-0EA9CB585575}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/contrib/Windows/Projects/clamAV/libclamunrar_iface/libclamunrar_iface.vcproj b/win32/clamscan.vcproj
old mode 100755
new mode 100644
similarity index 60%
copy from contrib/Windows/Projects/clamAV/libclamunrar_iface/libclamunrar_iface.vcproj
copy to win32/clamscan.vcproj
index 972ebdf..b691515
--- a/contrib/Windows/Projects/clamAV/libclamunrar_iface/libclamunrar_iface.vcproj
+++ b/win32/clamscan.vcproj
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
- Name="libclamunrar_iface"
- ProjectGUID="{FA8BFB8E-F74F-4A71-A474-D2167B432E36}"
- RootNamespace="libclamunrar_iface"
+ Version="9,00"
+ Name="clamscan"
+ ProjectGUID="{F79E7CA7-E49D-479E-8D68-0EA9CB585575}"
+ RootNamespace="clamscan"
Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
@@ -18,9 +19,9 @@
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="2"
- CharacterSet="0"
+ IntermediateDirectory="$(SolutionDir)build\$(ProjectName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
@@ -40,17 +41,16 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories=""$(SolutionDir)";"$(ProjectDir)..\libclamav""
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCLAMUNRAR_IFACE_EXPORTS;_USE_32BIT_TIME_T;HAVE_CONFIG_H;_CRT_SECURE_NO_DEPRECATE;PTW32_STATIC_LIB"
- StringPooling="true"
+ AdditionalIncludeDirectories=""$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir)..""
+ PreprocessorDefinitions="WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H"
MinimalRebuild="true"
- ExceptionHandling="0"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
- WarningLevel="4"
- Detect64BitPortabilityProblems="true"
+ WarningLevel="3"
DebugInformationFormat="4"
+ CompileAs="1"
+ DisableSpecificWarnings="4996;4244;4018;4090;4333;4101;4146"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -63,11 +63,9 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies=""$(TargetDir)\libclamav.lib" "$(TargetDir)\libclamunrar.lib""
LinkIncremental="2"
- ModuleDefinitionFile="$(InputDir)/libclamunrar_iface.def"
GenerateDebugInformation="true"
- SubSystem="2"
+ SubSystem="1"
TargetMachine="1"
/>
<Tool
@@ -89,18 +87,15 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="2"
- CharacterSet="0"
+ IntermediateDirectory="$(SolutionDir)build\$(ProjectName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
@@ -120,15 +115,17 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""$(SolutionDir)";"$(ProjectDir)..\libclamav""
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCLAMUNRAR_IFACE_EXPORTS;_USE_32BIT_TIME_T;HAVE_CONFIG_H;_CRT_SECURE_NO_DEPRECATE;PTW32_STATIC_LIB"
- StringPooling="true"
- ExceptionHandling="0"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ AdditionalIncludeDirectories=""$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir)..""
+ PreprocessorDefinitions="WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H"
RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
- WarningLevel="4"
- Detect64BitPortabilityProblems="true"
+ WarningLevel="3"
DebugInformationFormat="3"
+ CompileAs="1"
+ DisableSpecificWarnings="4996;4244;4018;4090;4333;4101;4146"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -141,11 +138,9 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies=""$(TargetDir)\libclamav.lib" "$(TargetDir)\libclamunrar.lib""
LinkIncremental="1"
- ModuleDefinitionFile="$(InputDir)/libclamunrar_iface.def"
GenerateDebugInformation="true"
- SubSystem="2"
+ SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
@@ -169,9 +164,6 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
@@ -185,29 +177,61 @@
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
- RelativePath=".\unrar_iface.c"
+ RelativePath="..\clamscan\clamscan.c"
+ >
+ </File>
+ <File
+ RelativePath="..\clamscan\manager.c"
+ >
+ </File>
+ <File
+ RelativePath="..\clamscan\others.c"
>
</File>
+ <Filter
+ Name="shared"
+ >
+ <File
+ RelativePath="..\shared\actions.c"
+ >
+ </File>
+ <File
+ RelativePath="..\shared\getopt.c"
+ >
+ </File>
+ <File
+ RelativePath="..\shared\misc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\shared\optparser.c"
+ >
+ </File>
+ <File
+ RelativePath="..\shared\output.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="compat"
+ >
+ <File
+ RelativePath=".\compat\libgen.c"
+ >
+ </File>
+ </Filter>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
- <File
- RelativePath=".\unrar_iface.h"
- >
- </File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
- <File
- RelativePath=".\libclamunrar_iface.def"
- >
- </File>
</Filter>
</Files>
<Globals>
diff --git a/win32/compat/dirent.h b/win32/compat/dirent.h
index b7ed1bf..2c560ae 100644
--- a/win32/compat/dirent.h
+++ b/win32/compat/dirent.h
@@ -55,4 +55,5 @@ DIR *opendir(const char *name);
struct dirent *readdir(DIR *dirp);
void rewinddir(DIR *dirp);
int closedir(DIR *dirp);
-#endif
\ No newline at end of file
+
+#endif /* __DIRENT_H */
\ No newline at end of file
diff --git a/win32/compat/libgen.c b/win32/compat/libgen.c
new file mode 100644
index 0000000..44bdccb
--- /dev/null
+++ b/win32/compat/libgen.c
@@ -0,0 +1,153 @@
+/*
+ * Copyright (C) 2009 Sourcefire, Inc.
+ *
+ * Authors: aCaB <acab at clamav.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
+#include <string.h>
+#include "libgen.h"
+
+/*
+Note: an exact implementation of is not really possible, but this is good enough for us
+
+*path* *dirname* *basename*
+
+"C:" "C:" ""
+"C:\" "C:" ""
+"C:\\" "C:" ""
+"C:file" "C:file" ""
+"C:file\" "C:file" ""
+"C:\file" "C:" "file"
+"C:\file\" "C:" "file"
+"C:\path\file" "C:\path" "file"
+"C:\path\file\" "C:\path" "file"
+
+"\\net" "\\net" ""
+"\\net\" "\\net" ""
+"\\net\share" "\\net" "share"
+"\\net\share\" "\\net" "share"
+"\\net\share\file" "\\net\share" "file"
+"\\net\share\file\" "\\net\share" "file"
+"\\net\share\path\file" "\\net\share\path" "file"
+"\\net\share\path\file\" "\\net\share\path" "file"
+
+"\\?\C:" "\\?\C:" ""
+"\\?\C:\" "\\?\C:" ""
+"\\?\C:\\" "\\?\C:" ""
+"\\?\C:\file" "\\?\C:" "file"
+"\\?\C:\file\" "\\?\C:" "file"
+"\\?\C:\path\file" "\\?\C:\path" "file"
+"\\?\C:\path\file\" "\\?\C:\path" "file"
+
+"\" "" ""
+"\\" "" ""
+"\file" "" "file"
+"\file\" "" "file"
+"\path\file" "\path" "file"
+"\path\file\" "\path" "file"
+
+"." "." ""
+".\" "." ""
+".." ".." ""
+"..\" ".." ""
+"file" "." "file"
+"file\" "." "file"
+"path\file" "path" "file"
+"path\file\" "path" "file"
+
+"\\.\PhysicalDrive0" "\\.\PhysicalDrive0" ""
+"\\.\PhysicalDrive0\other" "\\.\PhysicalDrive0" "other"
+
+"" "." ""
+NULL "." ""
+
+
+Hopefully I didn't miss anything...
+
+*/
+
+
+static void splitpath(char *path, char **dir, char **base) {
+ char *startpath, *endpath;
+ int len;
+ if(!path || !(len = strlen(path))) {
+ *dir = ".";
+ *base = "";
+ return;
+ }
+
+ endpath = &path[len-1];
+ while(endpath >= path && *endpath == '\\') {
+ *endpath = '\0';
+ endpath--;
+ }
+ if(endpath < path) {
+ *dir = "";
+ *base = "";
+ return;
+ }
+ len = endpath-path + 1;
+ if(len > 2 && path[0] == '\\' && path[1] == '\\') {
+ if(len > 4 && (path[2] == '.' || path[2] == '?') && path[3] == '\\')
+ startpath = strchr(path + 4, '\\');
+ else
+ startpath = strchr(path + 2, '\\');
+
+ if(!startpath) {
+ *dir = path;
+ *base = "";
+ return;
+ }
+ startpath ++;
+ } else startpath = path;
+ endpath = strrchr(startpath, '\\');
+ if(!endpath) {
+ if(startpath == path) {
+ if(!strcmp(path, ".") || !strcmp(path, "..") || (len >= 2 && ((*path >= 'a' && *path <= 'z') || (*path >= 'A' && *path <= 'Z')) && path[1] == ':')) {
+ *dir = path;
+ *base = "";
+ return;
+ }
+ *dir = ".";
+ *base = path;
+ return;
+ }
+ *base = startpath;
+ endpath = startpath - 1;
+ startpath = path;
+ } else {
+ *base = endpath + 1;
+ }
+ *dir = path;
+
+ while(endpath >= startpath && *endpath == '\\') {
+ *endpath = '\0';
+ endpath--;
+ }
+}
+
+char *dirname(char *path) {
+ char *dir, *base;
+ splitpath(path, &dir, &base);
+ return dir;
+}
+
+char *basename(char *path) {
+ char *dir, *base;
+ splitpath(path, &dir, &base);
+ return base;
+}
diff --git a/libclamav/7z.h b/win32/compat/libgen.h
similarity index 83%
copy from libclamav/7z.h
copy to win32/compat/libgen.h
index cdc11fd..e3b8037 100644
--- a/libclamav/7z.h
+++ b/win32/compat/libgen.h
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Sourcefire, Inc.
*
- * Authors: aCaB
+ * Authors: aCaB <acab at clamav.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -18,15 +18,14 @@
* MA 02110-1301, USA.
*/
-#ifndef __7Z_H
-#define __7Z_H
+#ifndef __LIBGEN_H
+#define __LIBGEN_H
#if HAVE_CONFIG_H
#include "clamav-config.h"
#endif
-#include "others.h"
+char *dirname(char *path);
+char *basename(char *path);
-int cli_7unz (int, cli_ctx *);
-
-#endif
+#endif /* __LIBGEN_H */
\ No newline at end of file
diff --git a/win32/libclamav.def b/win32/libclamav.def
new file mode 100644
index 0000000..99ed064
--- /dev/null
+++ b/win32/libclamav.def
@@ -0,0 +1,38 @@
+LIBRARY libclamav
+; cl_stuff - should be exported as is
+EXPORTS cl_debug
+EXPORTS cl_load
+EXPORTS cl_engine_compile
+EXPORTS cl_engine_set_num
+EXPORTS cl_engine_set_str
+EXPORTS cl_engine_free
+EXPORTS cl_engine_new
+EXPORTS cl_strerror
+EXPORTS cl_init
+EXPORTS cl_retdbdir
+EXPORTS cl_scandesc
+EXPORTS cl_scanfile
+EXPORTS cl_cvdfree
+EXPORTS cl_cvdhead
+
+; cli_stuff - should be mangled or exported by ordinal only
+EXPORTS cli_gentemp
+EXPORTS cli_gettmpdir
+EXPORTS cli_regcomp
+EXPORTS cli_regexec
+EXPORTS cli_regfree
+EXPORTS cli_ctime
+
+; shared stuff - to be either double compiled into the tools or treated like cli_xxx
+EXPORTS gettimeofday
+EXPORTS opendir
+EXPORTS readdir
+EXPORTS closedir
+EXPORTS snprintf
+
+; winsock - bridging for now
+EXPORTS htonl
+EXPORTS htons
+EXPORTS send
+EXPORTS select
+EXPORTS gethostbyname
diff --git a/win32/libclamav.vcproj b/win32/libclamav.vcproj
index 252879d..80cdb76 100644
--- a/win32/libclamav.vcproj
+++ b/win32/libclamav.vcproj
@@ -19,7 +19,7 @@
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="build\$(ProjectName)\$(ConfigurationName)"
+ IntermediateDirectory="$(SolutionDir)build\$(ProjectName)\$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
>
@@ -41,7 +41,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories=""$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)\compat";"$(SolutionDir)\3rdparty\zlib";"$(SolutionDir)\3rdparty\pthreads";"$(SolutionDir)\3rdparty\bzip2";"$(SolutionDir)..""
+ AdditionalIncludeDirectories=""$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir)..""
PreprocessorDefinitions="WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@@ -66,6 +66,7 @@
AdditionalDependencies="ws2_32.lib"
LinkIncremental="2"
IgnoreAllDefaultLibraries="false"
+ ModuleDefinitionFile="$(SolutionDir)libclamav.def"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"
@@ -95,7 +96,7 @@
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="build\$(ProjectName)\$(ConfigurationName)"
+ IntermediateDirectory="$(SolutionDir)build\$(ProjectName)\$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
WholeProgramOptimization="1"
@@ -119,7 +120,7 @@
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
- AdditionalIncludeDirectories=""$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)\compat";"$(SolutionDir)\3rdparty\zlib";"$(SolutionDir)\3rdparty\pthreads";"$(SolutionDir)\3rdparty\bzip2";"$(SolutionDir)..""
+ AdditionalIncludeDirectories=""$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir)..""
PreprocessorDefinitions="WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
@@ -144,6 +145,7 @@
AdditionalDependencies="ws2_32.lib"
LinkIncremental="1"
IgnoreAllDefaultLibraries="false"
+ ModuleDefinitionFile="$(SolutionDir)libclamav.def"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
@@ -793,6 +795,10 @@
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
+ <File
+ RelativePath=".\libclamav.def"
+ >
+ </File>
</Filter>
</Files>
<Globals>
diff --git a/win32/platform.h b/win32/platform.h
index 42079e6..ee23b44 100644
--- a/win32/platform.h
+++ b/win32/platform.h
@@ -8,14 +8,20 @@
#include <io.h>
#include <direct.h>
+#include "gettimeofday.h"
#include "snprintf.h"
typedef int ssize_t;
+typedef unsigned short mode_t;
#define strcasecmp lstrcmpi
#define strncasecmp strnicmp
#define mkdir(path, mode) mkdir(path)
#define lstat stat
+/* FIXME: need to wrap all win32 and winsock functions and map
+ (WSA)GetLastError to errno */
+#define EWOULDBLOCK 31337
+
#define PATH_MAX 32767
#define S_IRUSR S_IREAD
--
Debian repository for ClamAV
More information about the Pkg-clamav-commits
mailing list