Correcting and adding headers for future testing purposes.

This commit is contained in:
Bandie 2018-04-01 16:45:09 +02:00
parent 25046d1c5e
commit 607e7e241c
Signed by: Bandie
GPG Key ID: C1E133BC65A822DD
7 changed files with 56 additions and 8 deletions

View File

@ -6,7 +6,6 @@ DATE : 2018-03-27T02:34:08+02:00
LICENSE : GNU-GPLv3 LICENSE : GNU-GPLv3
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
@ -21,6 +20,7 @@ LICENSE : GNU-GPLv3
#include "pam_panic_authdevice.h" #include "pam_panic_authdevice.h"
#include "pam_panic_password.h" #include "pam_panic_password.h"
#ifdef REBOOT #ifdef REBOOT
#ifdef POWEROFF #ifdef POWEROFF
#ifdef CRYPTSETUP #ifdef CRYPTSETUP

34
src/pam_panic/pam_panic.h Normal file
View File

@ -0,0 +1,34 @@
/*
FILENAME : pam_panic.c
DESCRIPTION : Header is made for testing purposes.
AUTHOR : Bandie
DATE : 2018-03-27T02:34:08+02:00
LICENSE : GNU-GPLv3
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/wait.h>
#include <regex.h>
#include <string.h>
#include <security/pam_modules.h>
#include <security/pam_ext.h>
#include <syslog.h>
#include "pam_panic_reject.h"
#include "pam_panic_authdevice.h"
#include "pam_panic_password.h"
void argSplit(char **some_arg, char **some_temp, const char *arg);
void constrPath(char **dst, char **src);
PAM_EXTERN int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char *argv[]);
PAM_EXTERN int pam_sm_setcred(pam_handle_t *pamh, int flags, int argc, const char *argv[]);
PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t *pamh, int flags, int argc, const char *argv[]);
PAM_EXTERN int pam_sm_open_session(pam_handle_t *pamh, int flags, int argc, const char *argv[]);
PAM_EXTERN int pam_sm_close_session(pam_handle_t *pamh, int flags, int argc, const char *argv[]);
PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, const char *argv[]);

View File

@ -9,4 +9,4 @@ LICENSE : GNU-GPLv3
#define ASK "Please enter your secret key to decrypt the firewall and access the mainframe. " #define ASK "Please enter your secret key to decrypt the firewall and access the mainframe. "
#include "pam_panic_authdevice.c" int authDevice(pam_handle_t *pamh, char *allowed, char *rejected, char *serious_dev, int8_t bSerious, int8_t bReboot, int8_t bPoweroff);

View File

@ -5,7 +5,13 @@ DATE : 2018-03-27T02:34:08+02:00
LICENSE : GNU-GPLv3 LICENSE : GNU-GPLv3
*/ */
#include <crypt.h> #include <crypt.h>
#include "pam_panic_password.c"
#ifndef PPASSFILE
#error PPASSFILE must be declared!
#endif
int authPassword(pam_handle_t *pamh, char *serious_dev, int8_t bSerious, int8_t bReboot, int8_t bPoweroff);

View File

@ -5,5 +5,4 @@ DATE : 2018-03-27T02:34:08+02:00
LICENSE : GNU-GPLv3 LICENSE : GNU-GPLv3
*/ */
int reject(char *serious_dev, int8_t bSerious, int8_t bReboot, int8_t bPoweroff);
#include "pam_panic_reject.c"

View File

@ -1,7 +1,7 @@
/* /*
FILENAME : pam_panic_pw.c FILENAME : pam_panic_pw.c
DESCRIPTION : Generates and saves password for pam_panic DESCRIPTION : Generates and saves password for pam_panic
AUTHOR : Bandie AUTHOR : Bandie, some Author of the glibc manpage
DATE : 2018-03-27T02:34:08+02:00 DATE : 2018-03-27T02:34:08+02:00
LICENSE : GNU-GPLv3 LICENSE : GNU-GPLv3
*/ */

View File

@ -0,0 +1,9 @@
/*
FILENAME : pam_panic_pw.h
AUTHOR : Bandie
DATE : 2018-03-27T02:34:08+02:00
LICENSE : GNU-GPLv3
*/
int writePassword(char pw[][99]);
int main();