~ubuntu-branches/ubuntu/jaunty/clamav/jaunty-backports

« back to all changes in this revision

Viewing changes to clamdscan/clamdscan.c

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-10-02 15:36:00 UTC
  • mfrom: (10.1.6 sid)
  • mto: This revision was merged to the branch mainline in revision 13.
  • Revision ID: james.westby@ubuntu.com-20101002153600-2tx3vki1u55cdrjy
Tags: 0.96.3+dfsg-2ubuntu0.10.04.1
Microversion update to 0.96.3 for Lucid (LP: #653738)

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
void help(void);
45
45
 
46
46
extern int printinfected;
 
47
struct optstruct *clamdopts = NULL;
47
48
 
48
49
static void print_server_version(const struct optstruct *opt)
49
50
{
69
70
        return 2;
70
71
    }
71
72
 
 
73
    if((clamdopts = optparse(optget(opts, "config-file")->strarg, 0, NULL, 1, OPT_CLAMD, 0, NULL)) == NULL) {
 
74
        logg("!Can't parse clamd configuration file %s\n", optget(opts, "config-file")->strarg);
 
75
        return 2;
 
76
    }
 
77
 
72
78
    if(optget(opts, "verbose")->enabled) {
73
79
        mprintf_verbose = 1;
74
80
        logg_verbose = 1;
83
89
    if(optget(opts, "version")->enabled) {
84
90
        print_server_version(opts);
85
91
        optfree(opts);
 
92
        optfree(clamdopts);
86
93
        exit(0);
87
94
    }
88
95
 
89
96
    if(optget(opts, "help")->enabled) {
90
97
        optfree(opts);
 
98
        optfree(clamdopts);
91
99
        help();
92
100
    }
93
101
 
101
109
        if(logg("--------------------------------------\n")) {
102
110
            mprintf("!Problem with internal logger.\n");
103
111
            optfree(opts);
 
112
            optfree(clamdopts);
104
113
            exit(2);
105
114
        }
106
115
    } else 
110
119
    if(optget(opts, "reload")->enabled) {
111
120
        ret = reload_clamd_database(opts);
112
121
        optfree(opts);
 
122
        optfree(clamdopts);
113
123
        logg_close();
114
124
        exit(ret);
115
125
    }
116
126
 
117
127
    if(actsetup(opts)) {
118
128
        optfree(opts);
 
129
        optfree(clamdopts);
119
130
        logg_close();
120
131
        exit(2);
121
132
    }
134
145
    gettimeofday(&t1, NULL);
135
146
 
136
147
    ret = client(opts, &infected, &err);
 
148
    optfree(clamdopts);
137
149
 
138
150
    /* TODO: Implement STATUS in clamd */
139
151
    if(!optget(opts, "no-summary")->enabled) {