X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=common-src%2Fconffile.c;fp=common-src%2Fconffile.c;h=ae50db9c80fea4f97ccba858ee55eee91874abbe;hb=691567b16c13087b31ee4c2b6d038e57872fae82;hp=4d48220ae02cbd47b0c6acdc07d259eb5ae33aa8;hpb=cc7d7b45afc706099acf7ff2490ec5667d370651;p=debian%2Famanda diff --git a/common-src/conffile.c b/common-src/conffile.c index 4d48220..ae50db9 100644 --- a/common-src/conffile.c +++ b/common-src/conffile.c @@ -1,6 +1,7 @@ /* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-2000 University of Maryland at College Park + * Copyright (c) 2007-2012 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its @@ -92,6 +93,7 @@ typedef enum { CONF_DATA_PATH, CONF_AMANDA, CONF_DIRECTTCP, CONF_TAPER_PARALLEL_WRITE, CONF_INTERACTIVITY, CONF_TAPERSCAN, CONF_MAX_DLE_BY_VOLUME, CONF_EJECT_VOLUME, CONF_TMPDIR, + CONF_REPORT_USE_MEDIA, CONF_REPORT_NEXT_MEDIA, /* execute on */ CONF_PRE_AMCHECK, CONF_POST_AMCHECK, @@ -1054,6 +1056,8 @@ keytab_t server_keytab[] = { { "RECORD", CONF_RECORD }, { "RECOVERY_LIMIT", CONF_RECOVERY_LIMIT }, { "REP_TRIES", CONF_REP_TRIES }, + { "REPORT_USE_MEDIA", CONF_REPORT_USE_MEDIA }, + { "REPORT_NEXT_MEDIA", CONF_REPORT_NEXT_MEDIA }, { "REQ_TRIES", CONF_REQ_TRIES }, { "REQUIRED", CONF_REQUIRED }, { "RESERVE", CONF_RESERVE }, @@ -1319,6 +1323,8 @@ conf_var_t server_var [] = { { CONF_RECOVERY_LIMIT , CONFTYPE_HOST_LIMIT, read_host_limit , CNF_RECOVERY_LIMIT , NULL }, { CONF_INTERACTIVITY , CONFTYPE_STR , read_dinteractivity, CNF_INTERACTIVITY , NULL }, { CONF_TAPERSCAN , CONFTYPE_STR , read_dtaperscan , CNF_TAPERSCAN , NULL }, + { CONF_REPORT_USE_MEDIA , CONFTYPE_BOOLEAN , read_bool , CNF_REPORT_USE_MEDIA , NULL }, + { CONF_REPORT_NEXT_MEDIA , CONFTYPE_BOOLEAN , read_bool , CNF_REPORT_NEXT_MEDIA , NULL }, { CONF_UNKNOWN , CONFTYPE_INT , NULL , CNF_CNF , NULL } }; @@ -4523,9 +4529,11 @@ get_multiplier( /* get multiplier, if any */ get_conftoken(CONF_ANY); - if (tok == CONF_MULT1 && unit == CONF_UNIT_K) { + if (tok == CONF_NL || tok == CONF_END) { /* no multiplier */ + val = val; + } else if (tok == CONF_MULT1 && unit == CONF_UNIT_K) { val /= 1024; - } else if (tok == CONF_NL || tok == CONF_MULT1 || + } else if (tok == CONF_MULT1 || (tok == CONF_MULT1K && unit == CONF_UNIT_K)) { val *= 1; /* multiply by one */ } else if (tok == CONF_MULT7) { @@ -5269,6 +5277,8 @@ init_defaults( conf_init_str (&conf_data[CNF_KRB5PRINCIPAL] , "service/amanda"); conf_init_str (&conf_data[CNF_LABEL_NEW_TAPES] , ""); conf_init_bool (&conf_data[CNF_EJECT_VOLUME] , 0); + conf_init_bool (&conf_data[CNF_REPORT_USE_MEDIA] , TRUE); + conf_init_bool (&conf_data[CNF_REPORT_NEXT_MEDIA] , TRUE); conf_init_str (&conf_data[CNF_TMPDIR] , ""); conf_init_bool (&conf_data[CNF_USETIMESTAMPS] , 1); conf_init_int (&conf_data[CNF_CONNECT_TRIES] , CONF_UNIT_NONE, 3); @@ -5512,6 +5522,15 @@ update_derived_values( autolabel->autolabel = AL_VOLUME_ERROR | AL_EMPTY; } } + + if (!getconf_seen(CNF_REPORT_USE_MEDIA) && + getconf_seen(CNF_MAX_DLE_BY_VOLUME)) { + conf_init_bool(&conf_data[CNF_REPORT_USE_MEDIA], FALSE); + } + if (!getconf_seen(CNF_REPORT_NEXT_MEDIA) && + getconf_seen(CNF_MAX_DLE_BY_VOLUME)) { + conf_init_bool(&conf_data[CNF_REPORT_NEXT_MEDIA], FALSE); + } } /* fill in the debug_* values */