Added basic Makefile, updated README and some code fixes.

This commit is contained in:
Johannes Findeisen 2024-08-10 18:47:15 +02:00
commit 7cf30917aa
3 changed files with 13 additions and 4 deletions

9
Makefile Normal file
View file

@ -0,0 +1,9 @@
all:
$(CC) -Werror -lpam -lpam_misc -o checkpw checkpw.c
clean:
rm -f ./checkpw
install:
cp ./checkpw /usr/bin/

View file

@ -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:

View file

@ -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;
}
}