diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ff97ca3 --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +all: + $(CC) -Werror -lpam -lpam_misc -o checkpw checkpw.c + +clean: + rm -f ./checkpw + +install: + cp ./checkpw /usr/bin/ + diff --git a/README.md b/README.md index 9f78871..94eb7a2 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ checkpw is a program that checks the validity of a users password on a Linux/PAM ``` git clone https://git.xw3.org/hanez/checkpw.git cd checkpw -gcc -lpam -lpam_misc -Werror -o checkpw checkpw.c -sudo cp ./checkpw /usr/bin/ +make +sudo make install ``` # Usage: diff --git a/checkpw.c b/checkpw.c index 26eaae1..903b371 100644 --- a/checkpw.c +++ b/checkpw.c @@ -256,10 +256,10 @@ int main(int argc, char *argv[]) { // Authenticate the user if (authenticate(username, password, verbose) == 0) { printf("Authenticated successfully.\n"); - exit(0); + return 0; } else { printf("Authentication failed.\n"); - exit(1); + return 1; } }