mirror of
https://github.com/Cisco-Talos/clamav.git
synced 2025-11-01 16:40:54 +00:00
Add support for passing the CVD version number on the command line
via --cvd-version rather than sigtool prompting for the version if the previous version of the database is not present.
This commit is contained in:
parent
7f50a91ced
commit
3be7f9a93d
2 changed files with 5 additions and 1 deletions
|
|
@ -112,6 +112,7 @@ const struct clam_option __clam_options[] = {
|
|||
{ NULL, "build", 'b', TYPE_STRING, NULL, -1, NULL, 0, OPT_SIGTOOL, "", "" },
|
||||
{ NULL, "max-bad-sigs", 0, TYPE_NUMBER, MATCH_NUMBER, 3000, NULL, 0, OPT_SIGTOOL, "Maximum number of mismatched signatures when building a CVD. Zero disables this limit.", "3000" },
|
||||
{ NULL, "flevel", 0, TYPE_NUMBER, MATCH_NUMBER, CL_FLEVEL, NULL, 0, OPT_SIGTOOL, "Feature level to put in the CVD", "" },
|
||||
{ NULL, "cvd-version", 0, TYPE_NUMBER, MATCH_NUMBER, 0, NULL, 0, OPT_SIGTOOL, "Version number of the CVD to build", "" },
|
||||
{ NULL, "unsigned", 0, TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_SIGTOOL, "", "" },
|
||||
{ NULL, "no-cdiff", 0, TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_SIGTOOL, "", "" },
|
||||
{ NULL, "server", 0, TYPE_STRING, NULL, -1, NULL, 0, OPT_SIGTOOL, "", "" },
|
||||
|
|
|
|||
|
|
@ -793,6 +793,8 @@ static int build(const struct optstruct *opts)
|
|||
version = oldcvd->version + 1;
|
||||
oldsigs = oldcvd->sigs;
|
||||
cl_cvdfree(oldcvd);
|
||||
} else if (optget(opts, "cvd-version")->numarg != 0) {
|
||||
version = optget(opts, "cvd-version")->numarg;
|
||||
} else {
|
||||
mprintf("Version number: ");
|
||||
if(scanf("%u", &version) == EOF) {
|
||||
|
|
@ -2927,11 +2929,12 @@ static void help(void)
|
|||
mprintf(" --build=NAME [cvd] -b NAME build a CVD file\n");
|
||||
mprintf(" --max-bad-sigs=NUMBER Maximum number of mismatched signatures when building a CVD. Default: 3000\n");
|
||||
mprintf(" --flevel=FLEVEL Specify a custom flevel. Default: %u\n", cl_retflevel());
|
||||
mprintf(" --cvd-version=NUMBER Specify the version number to use for the build. Default is to prompt if no old CVD can me found\n");
|
||||
mprintf(" --no-cdiff Don't generate .cdiff file\n");
|
||||
mprintf(" --unsigned Create unsigned database file (.cud)\n");
|
||||
mprintf(" --print-certs=FILE Print Authenticode details from a PE\n");
|
||||
mprintf(" --server=ADDR ClamAV Signing Service address\n");
|
||||
mprintf(" --datadir=DIR Use DIR as default database directory\n");
|
||||
mprintf(" --datadir=DIR Use DIR as default database directory\n");
|
||||
mprintf(" --unpack=FILE -u FILE Unpack a CVD/CLD file\n");
|
||||
mprintf(" --unpack-current=SHORTNAME Unpack local CVD/CLD into cwd\n");
|
||||
mprintf(" --list-sigs[=FILE] -l[FILE] List signature names\n");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue