diff --git a/tools/fstools/fls.cpp b/tools/fstools/fls.cpp index a988f85d29041c4688521506fe3661175e6bd44d..ece240bee9746adcadfdb23a295d4c947ebc1968 100644 --- a/tools/fstools/fls.cpp +++ b/tools/fstools/fls.cpp @@ -67,7 +67,7 @@ usage() "\t-z: Time zone of original machine (i.e. EST5EDT or GMT) (only useful with -l)\n"); tsk_fprintf(stderr, "\t-s seconds: Time skew of original machine (in seconds) (only useful with -l & -m)\n"); - //tsk_fprintf(stderr, "\t-k password: Decryption password for encrypted volumes\n"); + tsk_fprintf(stderr, "\t-k password: Decryption password for encrypted volumes\n"); exit(1); } @@ -255,6 +255,12 @@ main(int argc, char **argv1) usage(); } + /* Passwords only work if the file system type has been specified */ + if (strlen(password) > 0 && fstype == TSK_FS_TYPE_DETECT) { + tsk_fprintf(stderr, "File system type must be specified to use a password\n"); + usage(); + } + /* Set the full flag to print the full path name if recursion is ** set and we are only displaying files or deleted files diff --git a/tools/fstools/fsstat.cpp b/tools/fstools/fsstat.cpp index e6a1afa249915598d2ddae9ce2fd4efd9a0506c7..fcdae9e53dcbf4d1f36c9bb2b3845eec2ddf79c9 100644 --- a/tools/fstools/fsstat.cpp +++ b/tools/fstools/fsstat.cpp @@ -39,7 +39,7 @@ usage() "\t-B pool_volume_block: Starting block (for pool volumes only)\n"); tsk_fprintf(stderr, "\t-v: verbose output to stderr\n"); tsk_fprintf(stderr, "\t-V: Print version\n"); - //tsk_fprintf(stderr, "\t-k password: Decryption password for encrypted volumes\n"); + tsk_fprintf(stderr, "\t-k password: Decryption password for encrypted volumes\n"); exit(1); } @@ -173,6 +173,12 @@ main(int argc, char **argv1) usage(); } + /* Passwords only work if the file system type has been specified */ + if (strlen(password) > 0 && fstype == TSK_FS_TYPE_DETECT) { + tsk_fprintf(stderr, "File system type must be specified to use a password\n"); + usage(); + } + if ((img = tsk_img_open(argc - OPTIND, &argv[OPTIND], imgtype, ssize)) == NULL) { diff --git a/tools/fstools/icat.cpp b/tools/fstools/icat.cpp index 44e6809c5cc0ab4e615ffaec7b3291d3d07c8ee9..2f6622cf2ec7ca3f1821315f670114f2c5d8d686 100644 --- a/tools/fstools/icat.cpp +++ b/tools/fstools/icat.cpp @@ -56,7 +56,7 @@ usage() tsk_fprintf(stderr, "\t-S snap_id: Snapshot ID (for APFS only)\n"); tsk_fprintf(stderr, "\t-v: verbose to stderr\n"); tsk_fprintf(stderr, "\t-V: Print version\n"); - //tsk_fprintf(stderr, "\t-k password: Decryption password for encrypted volumes\n"); + tsk_fprintf(stderr, "\t-k password: Decryption password for encrypted volumes\n"); exit(1); } @@ -203,6 +203,12 @@ main(int argc, char **argv1) usage(); } + /* Passwords only work if the file system type has been specified */ + if (strlen(password) > 0 && fstype == TSK_FS_TYPE_DETECT) { + tsk_fprintf(stderr, "File system type must be specified to use a password\n"); + usage(); + } + /* Get the inode address */ if (tsk_fs_parse_inum(argv[argc - 1], &inum, &type, &type_used, &id, &id_used)) { diff --git a/tools/fstools/istat.cpp b/tools/fstools/istat.cpp index 9a0f702c05025182b74c6b69558b5cafd006aabc..75fb6c4b6dcfb64ce6cb59c88f5b3e6818c7acdf 100644 --- a/tools/fstools/istat.cpp +++ b/tools/fstools/istat.cpp @@ -55,7 +55,7 @@ usage() tsk_fprintf(stderr, "\t-S snap_id: Snapshot ID (for APFS only)\n"); tsk_fprintf(stderr, "\t-v: verbose output to stderr\n"); tsk_fprintf(stderr, "\t-V: print version\n"); - //tsk_fprintf(stderr, "\t-k password: Decryption password for encrypted volumes\n"); + tsk_fprintf(stderr, "\t-k password: Decryption password for encrypted volumes\n"); exit(1); } @@ -216,6 +216,12 @@ main(int argc, char **argv1) usage(); } + /* Passwords only work if the file system type has been specified */ + if (strlen(password) > 0 && fstype == TSK_FS_TYPE_DETECT) { + tsk_fprintf(stderr, "File system type must be specified to use a password\n"); + usage(); + } + /* if we are given the inode in the inode-type-id form, then ignore * the other stuff w/out giving an error *