~ubuntu-branches/ubuntu/raring/clamav/raring

« back to all changes in this revision

Viewing changes to clamd/tcpserver.c

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Gran
  • Date: 2008-09-05 17:25:34 UTC
  • mfrom: (0.35.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080905172534-yi3f8fkye1o7u1r3
* New upstream version (closes: #497662, #497773)
  - lots of new options for clamd.conf
  - fixes CVEs CVE-2008-3912, CVE-2008-3913, CVE-2008-3914, and
    CVE-2008-1389
* No longer supports --unzip option, so typo is gone (closes: #496276)
* Translations:
  - sv (thanks Martin Bagge <brother@bsnet.se>) (closes: #491760)

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
#include "server.h"
52
52
#include "tcpserver.h"
53
53
 
 
54
#ifndef C_WINDOWS
 
55
#define closesocket(s)  close(s)
 
56
#endif
 
57
 
54
58
int tcpserver(const struct cfgstruct *copt)
55
59
{
56
60
        struct sockaddr_in server;
87
91
    if(bind(sockfd, (struct sockaddr *) &server, sizeof(struct sockaddr_in)) == -1) {
88
92
        estr = strerror(errno);
89
93
        logg("!TCP: bind() error: %s\n", estr);
90
 
        close(sockfd);
 
94
        closesocket(sockfd);
91
95
        return -1;
92
96
    } else {
93
97
        if(taddr->enabled)
102
106
    if(listen(sockfd, backlog) == -1) {
103
107
        estr = strerror(errno);
104
108
        logg("!TCP: listen() error: %s\n", estr);
105
 
        close(sockfd);
 
109
        closesocket(sockfd);
106
110
        return -1;
107
111
    }
108
112