file header comment updated

This commit is contained in:
2018-11-14 09:30:54 -05:00
parent 0c909d5a93
commit eb4fd57eb9
9 changed files with 77 additions and 29 deletions
+13
View File
@@ -1,3 +1,16 @@
////////
//
// header file for autorisation
// used either for absec_fs or absec_mysql
//
// author: Jean-Luc Cyr
// date: 2018-10
//
// usage: include this file as header definition
// then link the program with either -labsec_fs or -labsec_mysql
//
#include "httpd.h"
#include <sys/stat.h>
int mysql_lookup(request_rec *r, struct stat *fperm);
+8
View File
@@ -1,3 +1,11 @@
/////
//
// File : absec_fs.c
// Author : Jean-Luc Cyr
// Date : 2018-10
//
// Description: Using filesystem as autorisation method
//
#include "absec_auto.h"
+8
View File
@@ -1,3 +1,11 @@
/////
//
// File : absec_ls.c
// Author : Jean-Luc Cyr
// Date : 2018-10
//
// Description: tool to query permissions from mysql database
//
#include <stdio.h>
#include <string.h>
+8
View File
@@ -1,3 +1,11 @@
/////
//
// File : absec_mysql.c
// Author : Jean-Luc Cyr
// Date : 2018-10
//
// Description: Using mysql database as autorisation method
//
#include "absec_auto.h"
+8 -19
View File
@@ -1,23 +1,17 @@
/////
//
// File : absec_pam.c
// Author : Jean-Luc Cyr
// Date : 2018-10
//
// Description: Using PAM as authentification method
//
#include "absec_authen.h"
#include <security/pam_appl.h>
#include <security/pam_misc.h>
////////////////////////////////////////////////////////////////
/* Check user autentication against unix user/pass */
/*static int check_autentication(request_rec *r)
{
return 0;
}*/
////////////////////////////////////////////////////////////////
/* Check check file perms */
/*static int check_autorization(request_rec *r)
{
return 0;
}*/
// Global var for passing fake response to PAM callback
struct pam_response *reply;
@@ -59,8 +53,3 @@ int check_user(char* user, char* pass) {
}
}
////////////////////////////////////////////////////////////////
/*void main(int argc, char** argv) {
printf("absec_pam OK\n");
exit(0);
}*/
+3 -7
View File
@@ -55,14 +55,10 @@ gcc absec_mysql.c `mysql_config --cflags --libs` -I/usr/include/apache2 -I/usr/i
#exit
echo "----------------"
echo "Compiling autho test with mysql"
#/home/jlcyr/apache2/bin/apxs -lpam -lpam_misc `mysql_config --cflags --libs` -c -i mod_absec.c
gcc test_mysql.c absec_mysql.o -lpam -lpam_misc `mysql_config --cflags --libs` -o test_mysql
#gcc -o test_pam -lpam -lpam_misc absec_pam.o test_pam.c
#ld -o test_pam -lc --entry main test_pam.o
#ld -lpam -lpam_misc --shared -o test_pam absec_pam.o test_pam.o
echo "Compiling auto test with mysql (test_auto -labsec_mysql)"
gcc test_auto.c absec_mysql.o `mysql_config --cflags --libs` -I/usr/include/apache2 -I/usr/include/apr-1.0 -o test_auto
echo "Running test"
./test_mysql
./test_auto
echo "----------------"
+11 -2
View File
@@ -1,3 +1,12 @@
/////
//
// File : mod_absec.c
// Author : Jean-Luc Cyr
// Date : 2018-10
//
// Description: apache module for authentification and autorisation management
//
/*
** mod_absec.c -- Apache absec module
** [base Autogenerated via ``apxs -n absec -g'']
@@ -58,8 +67,8 @@
#include <shadow.h>
#include <sys/stat.h>
#include "absec_pam.h"
#include "absec_mysql.h"
#include "absec_authen.h"
#include "absec_auto.h"
////////////////////////////////////////////////////////////////
/* Main routine - called after request processing */
+9
View File
@@ -1,3 +1,12 @@
/////
//
// File : test_authen.c
// Author : Jean-Luc Cyr
// Date : 2018-10
//
// Description: authentification method test file
//
//#include "absec_pam.h"
//#include "absec_etc.h"
#include "absec_authen.h"
+9 -1
View File
@@ -1,8 +1,16 @@
#include "absec_auto.h"
//#include <mysql.h>
#include <mysql.h>
#include <stdio.h>
/////
//
// File : test_auto.c
// Author : Jean-Luc Cyr
// Date : 2018-10
//
// Description: autorisation method test file
//
int main() {
MYSQL *conn;