BINDTODEVICE fix was broken

git-svn: trunk@984
remotes/push_mirror/metadata
Nigel Horne 21 years ago
parent 1d3d7dd9c9
commit c5a386b3f4
  1. 7
      clamav-devel/ChangeLog
  2. 2
      clamav-devel/clamav-milter/INSTALL
  3. 19
      clamav-devel/clamav-milter/clamav-milter.c

@ -1,3 +1,10 @@
Sat Oct 9 23:11:35 BST 2004 (njh)
----------------------------------
* clamav-milter: Correct fix for systems where BINDTODEVICE is not
supported
SESSIONS: If the PORT command to clamd fails, reset the
link
Sat Oct 9 09:03:21 BST 2004 (njh) Sat Oct 9 09:03:21 BST 2004 (njh)
---------------------------------- ----------------------------------
* libclamav/mbox.c: Only use libcurl if the version is >= 7.11 * libclamav/mbox.c: Only use libcurl if the version is >= 7.11

@ -517,6 +517,8 @@ Changes
once as 'msg.xxxxxx' and once as 'msg.xxxxxx.virusname' once as 'msg.xxxxxx' and once as 'msg.xxxxxx.virusname'
0.80i 5/10/04 ScanMail is no longer needed 0.80i 5/10/04 ScanMail is no longer needed
Improved tracing of the infected machine Improved tracing of the infected machine
0.80j 8/10/04 SESSION: reset the session if the PORT command fails
Correct --broadcast code if BINDTODEVICE isn't supported
INTERNATIONALISATION INTERNATIONALISATION

@ -26,6 +26,9 @@
* *
* Change History: * Change History:
* $Log: clamav-milter.c,v $ * $Log: clamav-milter.c,v $
* Revision 1.141 2004/10/09 22:10:08 nigelhorne
* BINDTODEVICE fix was broken
*
* Revision 1.140 2004/10/07 15:36:43 nigelhorne * Revision 1.140 2004/10/07 15:36:43 nigelhorne
* Remove scanmail requirement * Remove scanmail requirement
* *
@ -431,9 +434,9 @@
* Revision 1.6 2003/09/28 16:37:23 nigelhorne * Revision 1.6 2003/09/28 16:37:23 nigelhorne
* Added -f flag use MaxThreads if --max-children not set * Added -f flag use MaxThreads if --max-children not set
*/ */
static char const rcsid[] = "$Id: clamav-milter.c,v 1.140 2004/10/07 15:36:43 nigelhorne Exp $"; static char const rcsid[] = "$Id: clamav-milter.c,v 1.141 2004/10/09 22:10:08 nigelhorne Exp $";
#define CM_VERSION "0.80i" #define CM_VERSION "0.80j"
/*#define CONFDIR "/usr/local/etc"*/ /*#define CONFDIR "/usr/local/etc"*/
@ -1146,20 +1149,21 @@ main(int argc, char **argv)
* Drop privileges * Drop privileges
*/ */
if(getuid() == 0) { if(getuid() == 0) {
#ifdef SO_BINDTODEVICE
if(iface) { if(iface) {
#ifdef SO_BINDTODEVICE
struct ifreq ifr; struct ifreq ifr;
memset(&ifr, '\0', sizeof(struct ifreq)); memset(&ifr, '\0', sizeof(struct ifreq));
strncpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name) - 1); strncpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name) - 1);
if(setsockopt(broadcastSock, SOL_SOCKET, SO_BINDTODEVICE, &ifr, sizeof(ifr)) < 0) { if(setsockopt(broadcastSock, SOL_SOCKET, SO_BINDTODEVICE, &ifr, sizeof(ifr)) < 0) {
perror(iface); perror(iface);
return EX_UNAVAILABLE; return EX_CONFIG;
}
} }
#else #else
fprintf(stderr, _("%s: The iface option to --broadcast is not supported on your operating system\n"), argv[0]); fprintf(stderr, _("%s: The iface option to --broadcast is not supported on your operating system\n"), argv[0]);
return EX_CONFIG;
#endif #endif
}
if((cpt = cfgopt(copt, "User")) != NULL) { if((cpt = cfgopt(copt, "User")) != NULL) {
if((user = getpwnam(cpt->strarg)) == NULL) { if((user = getpwnam(cpt->strarg)) == NULL) {
fprintf(stderr, _("%s: Can't get information about user %s\n"), argv[0], cpt->strarg); fprintf(stderr, _("%s: Can't get information about user %s\n"), argv[0], cpt->strarg);
@ -3423,6 +3427,11 @@ connect2clamd(struct privdata *privdata)
else else
cli_warnmsg(_("Expected port information from clamd, got '%s'\n"), cli_warnmsg(_("Expected port information from clamd, got '%s'\n"),
buf); buf);
#ifdef SESSION
pthread_mutex_lock(&sstatus_mutex);
cmdSocketsStatus[privdata->serverNumber] = CMDSOCKET_DOWN;
pthread_mutex_unlock(&sstatus_mutex);
#endif
return 0; return 0;
} }

Loading…
Cancel
Save