~ubuntu-branches/ubuntu/hardy/clamav/hardy-backports

« back to all changes in this revision

Viewing changes to clamdscan/clamdscan.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Meskes, Stephen Gran, Michael Meskes, Michael Tautschnig
  • Date: 2008-11-29 12:15:34 UTC
  • mfrom: (1.1.1 upstream)
  • mto: (4.1.3 sid) (0.5.4 karmic)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20081129121534-8sbpoy6kr01ox2eo
[ Stephen Gran ]
* New upstream version

[ Michael Meskes ]
* Removed unused debconf templates and unfuzzied all translations.

[ Michael Tautschnig ]
* Removed --unzip from clampipe script (closes: #506055)
* Moved clamav-milter specific stuff from its specific README.Debian to
  clamav-global one.
* Sync start of clamav-milter with clamav-daemon when clamav-daemon is being
  upgraded (closes: #309067)
* The TemporaryDirectory option has been added long ago, no need for hacks
  via clamav-daemon.default anymore (closes: #253080)

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
 
40
40
void help(void);
41
41
 
42
 
short printinfected = 0;
43
 
 
 
42
extern int printinfected;
44
43
extern int notremoved, notmoved;
45
44
 
46
45
static void print_server_version(const struct optstruct *opt)
51
50
    }
52
51
}
53
52
 
 
53
static int reload_server_database(const struct optstruct *opt)
 
54
{
 
55
    if(reload_clamd_database(opt)) {
 
56
        logg("!Clamd did not reload the database\n");
 
57
        return 2;
 
58
    }
 
59
    return 0;
 
60
}
 
61
 
54
62
int main(int argc, char **argv)
55
63
{
56
64
        int ds, dms, ret, infected;
61
69
        const char *clamdscan_accepted[] = { "help", "version", "verbose", "quiet",
62
70
                                  "stdout", "log", "move", "copy", "remove",
63
71
                                  "config-file", "no-summary",  "fdpass",
64
 
                                  "disable-summary", "multiscan", NULL };
65
 
 
66
 
 
67
 
    opt = opt_parse(argc, argv, clamscan_shortopt, clamscan_longopt, clamdscan_accepted);
 
72
                                  "disable-summary", "multiscan", "reload",
 
73
                                  "infected",
 
74
                                  NULL };
 
75
 
 
76
 
 
77
    opt = opt_parse(argc, argv, clamscan_shortopt, clamscan_longopt, clamdscan_accepted, NULL);
68
78
    if(!opt) {
69
79
        mprintf("!Can't parse the command line\n");
70
80
        return 2;
108
118
        logg_file = NULL;
109
119
 
110
120
 
 
121
    if(opt_check(opt, "reload")) {
 
122
        ret = reload_server_database(opt);
 
123
        opt_free(opt);
 
124
        logg_close();
 
125
        exit(ret);
 
126
    }
 
127
 
111
128
    time(&starttime);
112
129
    /* ctime() does \n, but I need it once more */
113
130
 
133
150
        logg("Time: %d.%3.3d sec (%d m %d s)\n", ds, dms/1000, ds/60, ds%60);
134
151
    }
135
152
 
 
153
    logg_close();
136
154
    opt_free(opt);
137
155
    exit(ret);
138
156
}
160
178
    mprintf("    --multiscan           -m           Force MULTISCAN mode\n");
161
179
    mprintf("    --infected            -i           Only print infected files\n");
162
180
    mprintf("    --no-summary                       Disable summary at end of scanning\n");
 
181
    mprintf("    --reload                           Request clamd to reload virus database\n");
163
182
    mprintf("    --fdpass                           pass filedescriptor to clamd (useful if clamd is running as a different user)\n");
164
183
    mprintf("\n");
165
184