static RES_ITEM options_items[] = {
{"compression", store_opts, {0}, 0, 0, 0},
{"signature", store_opts, {0}, 0, 0, 0},
+ {"basejob", store_opts, {0}, 0, 0, 0},
{"accurate", store_opts, {0}, 0, 0, 0},
{"verify", store_opts, {0}, 0, 0, 0},
{"onefs", store_opts, {0}, 0, 0, 0},
INC_KW_DIGEST,
INC_KW_ENCRYPTION,
INC_KW_VERIFY,
+ INC_KW_BASEJOB,
INC_KW_ACCURATE,
INC_KW_ONEFS,
INC_KW_RECURSE,
{"signature", INC_KW_DIGEST},
{"encryption", INC_KW_ENCRYPTION},
{"verify", INC_KW_VERIFY},
+ {"basejob", INC_KW_BASEJOB},
{"accurate", INC_KW_ACCURATE},
{"onefs", INC_KW_ONEFS},
{"recurse", INC_KW_RECURSE},
bstrncat(opts, lc->str, optlen);
bstrncat(opts, ":", optlen); /* terminate it */
Dmsg3(900, "Catopts=%s option=%s optlen=%d\n", opts, option,optlen);
+ } else if (keyword == INC_KW_BASEJOB) { /* special case */
+ /* ***FIXME**** ensure these are in permitted set */
+ bstrncat(opts, "J", optlen); /* indicate BaseJob */
+ bstrncat(opts, lc->str, optlen);
+ bstrncat(opts, ":", optlen); /* terminate it */
+ Dmsg3(900, "Catopts=%s option=%s optlen=%d\n", opts, option,optlen);
} else if (keyword == INC_KW_STRIPPATH) { /* another special case */
if (!is_an_integer(lc->str)) {
scan_err1(lc, _("Expected a strip path positive integer, got:%s:"), lc->str);
struct stat statc;
int32_t LinkFIc;
bool stat = false;
+ char *opts;
char *fname;
CurFile elt;
decode_stat(elt.lstat, &statc, &LinkFIc); /* decode catalog stat */
+ if (jcr->get_JobLevel() == L_FULL) {
+ opts = ff_pkt->BaseJobOpts;
+ } else {
+ opts = ff_pkt->AccurateOpts;
+ }
+
/*
* Loop over options supplied by user and verify the
* fields he requests.
*/
- for (char *p=ff_pkt->AccurateOpts; !stat && *p; p++) {
+ for (char *p=opts; !stat && *p; p++) {
char ed1[30], ed2[30];
switch (*p) {
case 'i': /* compare INODEs */
}
break;
case 'p': /* permissions bits */
+ /* TODO: If something change only in perm, user, group
+ * Backup only the attribute stream
+ */
if (statc.st_mode != ff_pkt->statp.st_mode) {
Dmsg3(dbglvl-1, "%s st_mode differ. Cat: %x File: %x\n",
fname,
* The remainder of the function is all about getting the checksum.
* First we initialise, then we read files, other streams and Finder Info.
*/
- if (!stat && *elt.chksum && ff_pkt->type != FT_LNKSAVED &&
+ if (!stat && ff_pkt->type != FT_LNKSAVED &&
(S_ISREG(ff_pkt->statp.st_mode) &&
ff_pkt->flags & (FO_MD5|FO_SHA1|FO_SHA256|FO_SHA512)))
{
+
+ if (!*elt.chksum) {
+ Jmsg(jcr, M_WARNING, 0, _("Can't verify checksum for %s\n"),
+ ff_pkt->fname);
+ stat = true;
+ break;
+ }
+
/*
- * Create our digest context. If this fails, the digest will be set to NULL
- * and not used.
+ * Create our digest context. If this fails, the digest will be set
+ * to NULL and not used.
*/
if (ff_pkt->flags & FO_MD5) {
digest = crypto_digest_new(jcr, CRYPTO_DIGEST_MD5);
break;
case ':':
+ case 'J':
case 'C':
default:
break;
}
/*
- * Set up signature digest handling. If this fails, the signature digest will be set to
- * NULL and not used.
+ * Set up signature digest handling. If this fails, the signature digest
+ * will be set to NULL and not used.
+ */
+ /* TODO landonf: We should really only calculate the digest once, for
+ * both verification and signing.
*/
- // TODO landonf: We should really only calculate the digest once, for both verification and signing.
if (jcr->crypto.pki_sign) {
signing_digest = crypto_digest_new(jcr, signing_algorithm);
}
fo->AccurateOpts[j] = 0;
break;
+ case 'J': /* Basejob options */
+ /* Copy BaseJob Options */
+ for (j=0; *p && *p != ':'; p++) {
+ fo->BaseJobOpts[j] = *p;
+ if (j < (int)sizeof(fo->BaseJobOpts) - 1) {
+ j++;
+ }
+ }
+ fo->BaseJobOpts[j] = 0;
+ break;
case 'P': /* strip path */
/* Get integer */
p++; /* skip P */
ff->VerifyOpts[0] = 'V';
ff->VerifyOpts[1] = 0;
strcpy(ff->AccurateOpts, "C:mcs"); /* mtime+ctime+size by default */
+ strcpy(ff->BaseJobOpts, "J:mspug5"); /* mtime+size+perm+user+group+chk */
for (i=0; i<fileset->include_list.size(); i++) {
findINCEXE *incexe = (findINCEXE *)fileset->include_list.get(i);
fileset->incexe = incexe;
ff->drivetypes = fo->drivetype;
bstrncat(ff->VerifyOpts, fo->VerifyOpts, sizeof(ff->VerifyOpts));
bstrncat(ff->AccurateOpts, fo->AccurateOpts, sizeof(ff->AccurateOpts));
+ bstrncat(ff->BaseJobOpts, fo->BaseJobOpts, sizeof(ff->BaseJobOpts));
}
dlistString *node;
foreach_dlist(node, &incexe->name_list) {
int strip_path; /* strip path count */
char VerifyOpts[MAX_FOPTS]; /* verify options */
char AccurateOpts[MAX_FOPTS]; /* accurate mode options */
+ char BaseJobOpts[MAX_FOPTS]; /* basejob mode options */
alist regex; /* regex string(s) */
alist regexdir; /* regex string(s) for directories */
alist regexfile; /* regex string(s) for files */
bool incremental; /* incremental save */
char VerifyOpts[20];
char AccurateOpts[20];
+ char BaseJobOpts[20];
struct s_included_file *included_files_list;
struct s_excluded_file *excluded_files_list;
struct s_excluded_file *excluded_paths_list;