Hi Brian,
First thing is that I'm not sure you totally understand what Interix is.
It's a subsystem over the NT kernel that operates independently from the
"Windows" (aka client-server runtime) subsystem. The original design of NT
was to provide a platform and "flavor" -neutral kernel. There were
originally 3 "flavors": CSRSS (Windows), OS/2 and POSIX. Fast-forward to
today and the OS/2 subsystem is gone. The minimal Posix system has been
replaced with Interix which includes not just a Posix subsystem but a
serious UNIX implementation based on OpenBSD. The client-server runtime
subsystem is dominant and controls the video display.
The subsystems can interact with various mechanisms like stdin/stdout,
TCP/IP, etc. With Interix 5.2 and alter, one can also build a mixed-mode
binary which can call into both subsystems. The primary purpose of this is
to link to Windows Oracle drivers from Unix code.
It is definitely possible to compile ClamAV using the tools provided with
Interix out-of-the-box with the addition of libraries (like gmp and BIND)
and utilities from the Interop Community Tools. <url:
http://www.suacommunity.com/tool_warehouse.htm >
There are some gotchas to be aware of. First, you may have to tweak and
babysit the build. In particular, it tends to inappropriately detect
poll(3)." On Subsystem for UNIX-based Applications, poll() is supported only
for use with ctl files (located in /proc/procID). No other file types are
allowed." Sometimes the #defines in new code are wrong because they make
assumptions that windows cannot be unix-like and check the wrong symbol
defines. It can take some fiddling to get the defines correct to make a
clean build.
The main advantage to building on Interix is that *much* less porting work
is necessary than with a native Win32 build. The performance is *much*
better than with Cygwin Posix emulation over win32. You also get the full
suite of features including the cryptography that requires gmp. Everything
except clamuko should work.
If you want to use Win32 apps to interact with clamd, clamdscan and/or
clamscan, you'll run into a problem where windows apps use paths like
"C:\foo\bar\", but the Posix path would be "/dev/fs/C/foo/bar/". Interix
provides a winpath2unix function to convert Windows paths to Posix. It
doesn't take much to make clamav smart enough to do the translation.
Add something like this to shared/misc.c:
#ifdef __INTERIX
int iswinpath( const char *filename )
{
int iswinpath = 0;
char c;
while( c = *filename++ )
{
if( c == '\\' || c == ':' )
{
iswinpath = 1;
break;
}
}
return iswinpath;
}
char *convertwinpath( const char *filename )
{
char errbuff[512];
char path[PATH_MAX];
if ( winpath2unix( filename, 0, path, sizeof(path) ) != 0 )
{
snprintf( errbuff, sizeof(errbuff), "ERROR: Unable to
convert Windows path \"%s\" to POSIX.\n", filename );
}
return path;
}
#endif
In the scan() function of clamd/scanner.c add something along the lines of
this before stat is called on the filename:
#if __INTERIX
if( iswinpath( filename ) )
filename = convertwinpath( filename );
#endif
There may be a handful of other places that you need to futz with to fix-up
the paths.
I haven't spent much time with clamav in a while. I got frustrated with
debugging random crashes in clamd threads. Your mileage may vary.
Cheers.
-Brian
-----Original Message-----
From: clamav-win32-bounces@lists.clamav.net
[mailto:clamav-win32-bounces@lists.clamav.net] On Behalf Of Brian Amundsen
Sent: Monday, September 08, 2008 2:42 PM
To: clamav-win32@lists.clamav.net
Subject: Re: [clamav-win32] WINDOWS/INTERIX and Win32 or CLAMAV source
I'm a newbie to dual environments. I have have a WIN32 kernel with
both WINXP and Interix loaded for access to the WIN32 kernel. (INTERIX
is native UNIX Korn and C Shell access to the WIN32 kernel, meant to
allow migration of UNIX appls to WIN32.) I currently run CLAMAV-WIN32
native version from TBB. I'm wondering if I should download CLAMAV from
source and build under INTERIX also (current version in INTERIX TOOLS
is OLD)? Since both the WINXP and the INTERIX shells have access to the
WIN32 Kernel I'm wondering which (or both) environments need to be
protected. OK wait, let me correct that... I know WINXP needs to be
protected, but I'm not sure if INTERIX needs the protection or to
simplify and somehow protect only the Kernel? Suggestions would be
greatly appreciated. Biran A
_______________________________________________
http://lists.clamav.net/cgi-bin/mailman/listinfo/clamav-win32 _______________________________________________
http://lists.clamav.net/cgi-bin/mailman/listinfo/clamav-win32