Closed Rob--W closed 3 years ago
Rob thx, I have a look to integrate them as soon as time permits. Regarding the -P
and -R
do you know if they are portable to Windows?
Rob thx, I have a look to integrate them as soon as time permits. Regarding the
-P
and-R
do you know if they are portable to Windows?
I tested on Windows (cross-compiled with MinGW-w64) and the behavior was identical to Linux (with the library-provided getopt
). I haven't tested with MSVC, but I don't expect any issues since your project already uses parameterless options (e.g. -h
, -v
, -V
).
(At first I tried to do something special upon detecting an empty string parameter. This works as expected on Linux, but not on Windows. So I used -P
instead of -p ""
, which in retrospect looks better too.)
I explicitly accounted for the possibility of not having a password, having empty password and having non-empty passwords. Although I don't do any special input processing, passwords with multi-byte UTF-8 should work too because I don't touch bytes with the high order bit set.
Heap free issue will be corrected by changes in: https://github.com/libyal/libyal/issues/49
@joachimmetz Do I need to rebase and remove the commit that fixed the HeapFree
issue?
keep the PR as is. I'll merge or integrate changes step by step, the getopt changes also need to go into libyal
small update, I'll try to continue merging these changes shortly
confirmed the infinite loop in the fallback getopt implementation, however the proposed changes do not match the getopt behavior. I'll make some adjustments before merge. Changed added to libyal to generate source files: https://github.com/libyal/libyal/commit/0c062b28e4d2042da72f6dd1146225d5ce608c0c
Password related changes integrated in https://github.com/libyal/libfvde/commit/86e0c5bbbf81a9a9c746744b3fb6dbab700fca03. Note that it was solved differently then proposed. This should cover the proposed functionality. Closing issue.
I have added two new options,
-P
and-R
to prompt for the password and recovery password, respectively. The ability to specify a password without explicitly passing it through the command-line arguments fixes #16 and Debian bug 867110.Before adding the feature, I fixed a few bugs, including major issues such undefined memory deallocation behavior on Windows and infinite loops in argument parsing.
I suggest to review each commit in isolation (and read their commit messages to understand the context of each commit).