From be88280161f284e8d2f984f598d66a423132100b Mon Sep 17 00:00:00 2001 From: simon987 Date: Sat, 27 Feb 2021 15:23:56 -0500 Subject: [PATCH] wip --- src/cli.c | 1 + src/cli.h | 1 + src/main.c | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cli.c b/src/cli.c index 1cd8f2c..2aa3c54 100644 --- a/src/cli.c +++ b/src/cli.c @@ -227,6 +227,7 @@ int scan_args_validate(scan_args_t *args, int argc, const char **argv) { LOG_DEBUGF("cli.c", "arg depth=%d", args->depth) LOG_DEBUGF("cli.c", "arg path=%s", args->path) LOG_DEBUGF("cli.c", "arg archive=%s", args->archive) + LOG_DEBUGF("cli.c", "arg archive_passphrase=%s", args->archive_passphrase) LOG_DEBUGF("cli.c", "arg tesseract_lang=%s", args->tesseract_lang) LOG_DEBUGF("cli.c", "arg tesseract_path=%s", args->tesseract_path) LOG_DEBUGF("cli.c", "arg exclude=%s", args->exclude_regex) diff --git a/src/cli.h b/src/cli.h index 27139ef..bc1aeb0 100644 --- a/src/cli.h +++ b/src/cli.h @@ -18,6 +18,7 @@ typedef struct scan_args { char *path; char *archive; archive_mode_t archive_mode; + char *archive_passphrase; char *tesseract_lang; const char *tesseract_path; char *exclude_regex; diff --git a/src/main.c b/src/main.c index d5b5593..f632302 100644 --- a/src/main.c +++ b/src/main.c @@ -21,7 +21,7 @@ #define EPILOG "Made by simon987 . Released under GPL-3.0" -static const char *const Version = "2.9.0"; +static const char *const Version = "2.9.1"; static const char *const usage[] = { "sist2 scan [OPTION]... PATH", "sist2 index [OPTION]... INDEX", @@ -99,6 +99,7 @@ void initialize_scan_context(scan_args_t *args) { ScanCtx.arc_ctx.log = _log; ScanCtx.arc_ctx.logf = _logf; ScanCtx.arc_ctx.parse = (parse_callback_t) parse; + memset(ScanCtx.arc_ctx.passphrase, 0, sizeof(ScanCtx.arc_ctx.passphrase)); // Comic ScanCtx.comic_ctx.log = _log; @@ -439,6 +440,7 @@ int main(int argc, const char *argv[]) { OPT_STRING(0, "archive", &scan_args->archive, "Archive file mode (skip|list|shallow|recurse). " "skip: Don't parse, list: only get file names as text, " "shallow: Don't parse archives inside archives. DEFAULT: recurse"), + OPT_STRING(0, "archive-passphrase", &scan_args->archive_passphrase, "Passphrase for encrypted archive files"), OPT_STRING(0, "ocr", &scan_args->tesseract_lang, "Tesseract language (use tesseract --list-langs to see " "which are installed on your machine)"), OPT_STRING('e', "exclude", &scan_args->exclude_regex, "Files that match this regex will not be scanned"),