Added basic Makefile, updated README and some code fixes.
This commit is contained in:
parent
cd0030370a
commit
7cf30917aa
3 changed files with 13 additions and 4 deletions
9
Makefile
Normal file
9
Makefile
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
all:
|
||||||
|
$(CC) -Werror -lpam -lpam_misc -o checkpw checkpw.c
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f ./checkpw
|
||||||
|
|
||||||
|
install:
|
||||||
|
cp ./checkpw /usr/bin/
|
||||||
|
|
||||||
|
|
@ -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
|
git clone https://git.xw3.org/hanez/checkpw.git
|
||||||
cd checkpw
|
cd checkpw
|
||||||
gcc -lpam -lpam_misc -Werror -o checkpw checkpw.c
|
make
|
||||||
sudo cp ./checkpw /usr/bin/
|
sudo make install
|
||||||
```
|
```
|
||||||
|
|
||||||
# Usage:
|
# Usage:
|
||||||
|
|
|
||||||
|
|
@ -256,10 +256,10 @@ int main(int argc, char *argv[]) {
|
||||||
// Authenticate the user
|
// Authenticate the user
|
||||||
if (authenticate(username, password, verbose) == 0) {
|
if (authenticate(username, password, verbose) == 0) {
|
||||||
printf("Authenticated successfully.\n");
|
printf("Authenticated successfully.\n");
|
||||||
exit(0);
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
printf("Authentication failed.\n");
|
printf("Authentication failed.\n");
|
||||||
exit(1);
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue