BINDTODEVICE fix was broken

git-svn: trunk@984
remotes/push_mirror/metadata
Nigel Horne 21 years ago
parent 1d3d7dd9c9
commit c5a386b3f4
  1. 9
      clamav-devel/ChangeLog
  2. 2
      clamav-devel/clamav-milter/INSTALL
  3. 21
      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)
----------------------------------
* libclamav/mbox.c: Only use libcurl if the version is >= 7.11
@ -13,7 +20,7 @@ Fri Oct 8 17:53:30 CEST 2004 (tk)
Thu Oct 7 16:37:04 BST 2004 (njh)
----------------------------------
* clamav-milter: Requirement for ScanMail removed since that is no
longer supported in clamd.conf
longer supported in clamd.conf
Thu Oct 7 12:18:59 BST 2004 (trog)
-----------------------------------

@ -517,6 +517,8 @@ Changes
once as 'msg.xxxxxx' and once as 'msg.xxxxxx.virusname'
0.80i 5/10/04 ScanMail is no longer needed
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

@ -26,6 +26,9 @@
*
* Change History:
* $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
* Remove scanmail requirement
*
@ -431,9 +434,9 @@
* Revision 1.6 2003/09/28 16:37:23 nigelhorne
* 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"*/
@ -1146,20 +1149,21 @@ main(int argc, char **argv)
* Drop privileges
*/
if(getuid() == 0) {
#ifdef SO_BINDTODEVICE
if(iface) {
#ifdef SO_BINDTODEVICE
struct ifreq ifr;
memset(&ifr, '\0', sizeof(struct ifreq));
strncpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name) - 1);
if(setsockopt(broadcastSock, SOL_SOCKET, SO_BINDTODEVICE, &ifr, sizeof(ifr)) < 0) {
perror(iface);
return EX_UNAVAILABLE;
return EX_CONFIG;
}
}
#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
}
if((cpt = cfgopt(copt, "User")) != NULL) {
if((user = getpwnam(cpt->strarg)) == NULL) {
fprintf(stderr, _("%s: Can't get information about user %s\n"), argv[0], cpt->strarg);
@ -3423,6 +3427,11 @@ connect2clamd(struct privdata *privdata)
else
cli_warnmsg(_("Expected port information from clamd, got '%s'\n"),
buf);
#ifdef SESSION
pthread_mutex_lock(&sstatus_mutex);
cmdSocketsStatus[privdata->serverNumber] = CMDSOCKET_DOWN;
pthread_mutex_unlock(&sstatus_mutex);
#endif
return 0;
}

Loading…
Cancel
Save