diff --git a/absec_auto.h b/absec_auto.h index 7669c4a..17b06bc 100644 --- a/absec_auto.h +++ b/absec_auto.h @@ -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 int mysql_lookup(request_rec *r, struct stat *fperm); diff --git a/absec_fs.c b/absec_fs.c index 24f0a98..64a851b 100644 --- a/absec_fs.c +++ b/absec_fs.c @@ -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" diff --git a/absec_ls.c b/absec_ls.c index 30e6319..95cfcbd 100644 --- a/absec_ls.c +++ b/absec_ls.c @@ -1,3 +1,11 @@ +///// +// +// File : absec_ls.c +// Author : Jean-Luc Cyr +// Date : 2018-10 +// +// Description: tool to query permissions from mysql database +// #include #include diff --git a/absec_mysql.c b/absec_mysql.c index 24f0a98..dc6d6f2 100644 --- a/absec_mysql.c +++ b/absec_mysql.c @@ -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" diff --git a/absec_pam.c b/absec_pam.c index df76d01..07d6cc4 100644 --- a/absec_pam.c +++ b/absec_pam.c @@ -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 #include -//////////////////////////////////////////////////////////////// -/* 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); -}*/ \ No newline at end of file diff --git a/compile.sh b/compile.sh index cabd554..38fae9d 100755 --- a/compile.sh +++ b/compile.sh @@ -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 "----------------" diff --git a/mod_absec.c b/mod_absec.c index 749a8e8..2fce627 100755 --- a/mod_absec.c +++ b/mod_absec.c @@ -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 #include -#include "absec_pam.h" -#include "absec_mysql.h" +#include "absec_authen.h" +#include "absec_auto.h" //////////////////////////////////////////////////////////////// /* Main routine - called after request processing */ diff --git a/test_authen.c b/test_authen.c index 28283b6..ef69271 100644 --- a/test_authen.c +++ b/test_authen.c @@ -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" diff --git a/test_auto.c b/test_auto.c index b043945..20a1252 100644 --- a/test_auto.c +++ b/test_auto.c @@ -1,8 +1,16 @@ #include "absec_auto.h" -//#include +#include #include +///// +// +// File : test_auto.c +// Author : Jean-Luc Cyr +// Date : 2018-10 +// +// Description: autorisation method test file +// int main() { MYSQL *conn;