>> rkml wrote: >>> The one thing I would really like to see is if ClamAV can run in service >>> mode natively. >> >> FWIW. The Interix subsystem (SFU/SUA) is very much a BSD-flavored UNIX >> environment. If you build ClamAV under Interix then clamd can be >> configured >> as a daemon process which starts automatically when the system starts. >> Freshclam run daemonized or on a cron schedule. > >Interesting.... Has anyone been able to create such a build? Would a >FreeBSD build suffice?
A lot of the Interix source was forked from the OpenBSD project but you can't use binaries from another platform. You would have to build from source on the target Interix platform using the SDK tools provided by Microsoft and you will need to get other things like GMP and libtool from the community "tools warehouse" maintainted by Interopsystems. The ancient last build I packaged should still be available, too. http://www.suacommunity.com/tool_warehouse.htm I used to maintain builds for Interix of ClamAV for Interix. It isn't too terribly difficult. The main thing to be aware of is that the UNIX subsystem can interact with the "Windows" subsystem. The main thing I would do was add a few lines of code to check for Windows paths being sent and patch the paths to be POSIX. Sometimes you have to futz with the header file created by the congifure script. For one thing, I recall that it always detects poll(3) but poll(3) is only implemented for internal use of the proc filesystem in Interix and can't be used, so I would always have to manually undefined HAVE_POLL. There is a built-in function in Interix to convert Windows-style paths to POSIX-style paths, winpath2unix(2). It is defined in interix.h. Here's how to patch ClamAV to make use of this feature of the Interix platform. Add to misc.h: #ifdef __INTERIX int iswinpath( const char *filename ); char *convertwinpath( const char *filename ); #endif Add to 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 Wherever paths come into clamav such as an argv[] to clamscan or the scan function (scanner.c) of clamd add this to patch the filename: #if __INTERIX if( iswinpath( filename ) ) filename = convertwinpath( filename ); #endif _______________________________________________ http://lists.clamav.net/cgi-bin/mailman/listinfo/clamav-win32
