if (!isatty(2)) do_statline_dynamic = NO;
+ s = (char *)srcblk;
+ d = getenv("HOME");
+ if (!d) d = "";
+ n = PATH_MAX > sizeof(srcblk) ? sizeof(srcblk) : PATH_MAX;
+ if (xstrlcpy(s, d, n) >= n) goto _baddfname;
+ if (xstrlcat(s, "/.tfcrypt.defs", n) >= n) goto _baddfname;
+ read_defaults(s, YES);
+_baddfname:
+ memset(s, 0, n);
+
opterr = 0;
- while ((c = getopt(argc, argv, "s:aU:C:r:K:t:TPkzxc:l:qedn:vV:pwE:O:S:AmM:R:Z:WHD:")) != -1) {
+ while ((c = getopt(argc, argv, "L:s:aU:C:r:K:t:TPkzxc:l:qedn:vV:pwE:O:S:AmM:R:Z:WHD:")) != -1) {
switch (c) {
+ case 'L':
+ read_defaults(optarg, NO);
+ break;
case 's':
saltf = optarg;
break;
catch_all_errors = YES;
break;
}
+ if (!strcmp(optarg, "xseek")) {
+ ignore_seek_errors = YES;
+ break;
+ }
if (!strcmp(optarg, "exit"))
error_action = TFC_ERRACT_EXIT;
else if (!strncmp(optarg, "cont", 4))
if (counter_opt == TFC_CTR_HEAD && ctr_mode != TFC_MODE_ECB)
iseek += ctrsz;
if (lseek(sfd, iseek, SEEK_SET) == -1)
- xerror(YES, NO, NO, "%s: seek failed", srcfname);
+ xerror(ignore_seek_errors, NO, NO, "%s: seek failed", srcfname);
}
if (ctr_mode == TFC_MODE_PLAIN) goto _plain;
if (!tweakf) skein(key+TF_FROM_BITS(TF_MAX_BITS)+TF_SIZE_UNIT, 2*TF_UNIT_BITS, NULL, key, TF_FROM_BITS(TFC_KEY_BITS));
tf_key_tweak_compat(key);
}
- if (ctr_mode == TFC_MODE_STREAM) tfe_init_iv(&tfe, key, ctr);
if (ctr_mode == TFC_MODE_ECB) goto _ctrskip2;
tfc_data_to_words64(&iseek_blocks, sizeof(iseek_blocks));
tf_ctr_set(ctr, &iseek_blocks, sizeof(iseek_blocks));
if (oseek) {
if (lseek(dfd, oseek, SEEK_SET) == -1)
- xerror(YES, NO, NO, "%s: seek failed", dstfname);
+ xerror(ignore_seek_errors, NO, NO, "%s: seek failed", dstfname);
}
for (x = 1; x < NSIG; x++) signal(x, SIG_IGN);
delta_processed += ldone;
}
+ if (ctr_mode == TFC_MODE_STREAM) tfe_init_iv(&tfe, key, ctr);
+
errno = 0;
do_stop = NO;
while (1) {