Brian, Thanks for the information.  Your notes read like you are very
familiar with INTERIX.  I appreciate the code snippets for correcting
the paths.  I apologize for stating WIN32 kernel when I should have
referred to the WIN32 environment and an NT Kernel
that we get from Microsoft. 

I've currently loaded SFU 3.5 on a WindowsXP Pro with SP3. I'm
also installing GNU/Debian rather than the tool set from INTERIX.  This
will provide a fuller tool set.  I plan to re-implement the UNIX paths
on the NTFS disk.

Your notes read that you've already built ClamAV for INTERIX, but
perhaps abandoned the effort, so I'm wondering if you are using
CLAMAV, as you built it, from someone elses build, or in the WIN32
application version?

Since I'm new to the INTERIX environment,  I joined the INTERIX
community and I've followed the tutorials, but I'm still learning UNIX
commands and builds.  Could you recommend some training materials?
Would you be willing to help with a trail build of CLAMAV as my
learning test?

My objective is to build ClamAV as a native Win32 application from
source so that others Windows users can have a more current build that
doesn't require Cygwin.  I know previous writers have complained about
too many paths and targets, but documentation of how to install and
what to expect from the install should address the users.   I'm also
hoping the ClamWIN folks might look at INTERIX and move to a native
Win32 environment build and be able to add the proactive scanning
sometime sooner than later. 

Thanks, Brian A




On Mon, 8 Sep 2008 16:20:31 -0400
"Brian A. Reiter" <[EMAIL PROTECTED]> wrote:

> 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: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Brian
> Amundsen Sent: Monday, September 08, 2008 2:42 PM
> To: [email protected]
> 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
_______________________________________________
http://lists.clamav.net/cgi-bin/mailman/listinfo/clamav-win32

Reply via email to