mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #2485] Incorrect usage of $JOHN in fopen(3) #1644
Labels
No labels
bug
core branch
documentation
enhancement
enhancement
fixed - pending verify
fuzz bug
good first issue
invalid
invalid
maintenance/cleanup
new cracking mode
new format
new tool
non-trivial
notes/external issues
portability
question
RFC / discussion
testing
WONTFIX
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openwall/john#1644
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @carlorosati on GitHub (Mar 27, 2017).
Original GitHub issue: https://github.com/openwall/john/issues/2485
On a default
./configure && make -jhttps://github.com/magnumripper/JohnTheRipper/blob/bleeding-jumbo/src/config.c#L233 is used by./fake_salts.c:162: cfg_init(CFG_PRIVATE_FULL_NAME, 1);
./fake_salts.c:163: cfg_init(CFG_PRIVATE_ALT_NAME, 1);
./fake_salts.c:165: cfg_init(CFG_FULL_NAME, 1);
./fake_salts.c:166: cfg_init(CFG_ALT_NAME, 0);
./config.c:567: cfg_init(Name, allow_missing);
./dynamic_utils.c:72: cfg_init(CFG_PRIVATE_FULL_NAME, 1);
./dynamic_utils.c:73: cfg_init(CFG_PRIVATE_ALT_NAME, 1);
./dynamic_utils.c:75: cfg_init(CFG_FULL_NAME, 1);
./dynamic_utils.c:76: cfg_init(CFG_ALT_NAME, 0);
./john.c:1445: cfg_init(options.config, 0);
./john.c:1446: cfg_init(CFG_FULL_NAME, 1);
./john.c:1447: cfg_init(CFG_ALT_NAME, 0);
./john.c:1452: cfg_init(CFG_PRIVATE_FULL_NAME, 1);
./john.c:1453: cfg_init(CFG_PRIVATE_ALT_NAME, 1);
./john.c:1455: cfg_init(CFG_FULL_NAME, 1);
./john.c:1456: cfg_init(CFG_ALT_NAME, 0);
with the following parameters
params.h:152:#define CFG_FULL_NAME "$JOHN/john.conf"
params.h:153:#define CFG_ALT_NAME "$JOHN/john.ini"
containing
$JOHNThese will not expand to the correspondingly named environment variable. It merely tries to open the file at base directory literally named
$JOHN. Try it yourself by executing the following command in any directory other than../runand you will see this fixes all of the missing{john,best64}.{ini,conf}issues.@magnumripper commented on GitHub (Mar 27, 2017):
They are not supposed to. While
$JOHNmay look like an environment variable, it isn't - it's just a placeholder. That placeholder is replaced with something else (depending on build type) inpath_expand().What issues? I'm not aware of any. My guess is you try to use a non-systemwide build as if it was a systemwide one. If you use
./johnorsome/path/johninstead of justjohn, there is no problem, right? If you want to use john without a path, you need to build systemwide. See params.h for (brief) hints about how that's done. Any questions to john-users mailing list, please.@magnumripper commented on GitHub (Mar 27, 2017):
Watch this:
The last one is "wrong use". For a systemwide build, $JOHN would have been replaced with some hardcoded path like /usr/share/john in that case. But this (like yours) is just a default build.
@carlorosati commented on GitHub (Mar 27, 2017):
Well,
path_expand()is not working.% strace -e open ./john --test |& grep -F '$JOHN'
open("$JOHN/john.local.conf", O_RDONLY) = -1 ENOENT (No such file or directory)
open("$JOHN/john-local.conf", O_RDONLY) = -1 ENOENT (No such file or directory)
Also the build-info output does match yours.
% ./john --list=build-info | grep JOHN
$JOHN is ./
% ../run/john --list=build-info | grep JOHN
$JOHN is ../run/
% john --list=build-info | grep JOHN
$JOHN is
@magnumripper commented on GitHub (Mar 27, 2017):
It looks for a john-local.conf that's not present (which is normal). Nothing wrong with that.
@carlorosati commented on GitHub (Mar 27, 2017):
Okay. This will be fixed by the --prefix temporary workaround of copying files from run
@magnumripper commented on GitHub (Mar 27, 2017):
Exactly, so there is no problem. You are/were just using it wrong. Please move this discussion to john-users mailing list.