Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor changes/fixes #6

Merged
merged 4 commits into from Jul 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -40,13 +40,13 @@ TESTS=./unit_tests.sh
all: ppm ppm_test

ppm_test:
$(CC) $(LDAP_INC) $(LDAP_LIBS) $(LIBS) ppm.so -o ppm_test ppm_test.c
$(CC) $(LDAP_INC) $(LDAP_LIBS) -Wl,-rpath=. -o ppm_test ppm_test.c ppm.so $(LIBS)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if -Wl,rpath=. might be better as -Wl,rpath=.:$(LIBDIR)?


ppm.o:
$(CC) $(OPT) -c $(INCS) ppm.c

ppm: clean ppm.o
$(CC) $(LDAP_INC) -shared -o ppm.so ppm.o
$(CC) $(LDAP_INC) -shared -o ppm.so ppm.o $(CRACK_LIB)

install: ppm
cp -f ppm.so $(LIBDIR)
Expand Down
2 changes: 1 addition & 1 deletion ppm.c
Expand Up @@ -206,7 +206,7 @@ read_config_file(conf * fileConf, int *numParam, char *ppm_config_file)
ppm_log(LOG_NOTICE, "ppm: Opening file %s", ppm_config_file);
if ((config = fopen(ppm_config_file, "r")) == NULL) {
ppm_log(LOG_ERR, "ppm: Opening file %s failed", ppm_config_file);

exit(EXIT_FAILURE);
}

while (fgets(line, 256, config) != NULL) {
Expand Down
11 changes: 10 additions & 1 deletion ppm_test.c
Expand Up @@ -6,7 +6,7 @@ int main(int argc, char *argv[])
{
int ret = 1;

if(argc > 0)
if(argc > 1)
{
printf("Testing password : %s\n", argv[1]);

Expand All @@ -19,6 +19,15 @@ int main(int argc, char *argv[])

ret = check_password(argv[1], &errmsg, &pEntry);

if(ret == 0)
{
printf("Password is OK!\n");
}
else
{
printf("Password failed checks : %s\n", errmsg);
}

ber_memfree(errmsg);
return ret;

Expand Down