Skip to content
Snippets Groups Projects
Commit b7b635b9 authored by apriestman's avatar apriestman
Browse files

Restore password option to the usage statement.

Generate error if password is given without file system type.
parent a478a3cd
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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) {
......
......@@ -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)) {
......
......@@ -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
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment