Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -ur pam_notifo-v0.1/Makefile pam_notifo-v0.1-ubuntu/Makefile
- --- pam_notifo-v0.1/Makefile 2010-09-10 18:27:36.000000000 -0400
- +++ pam_notifo-v0.1-ubuntu/Makefile 2011-12-15 10:01:37.148099341 -0500
- @@ -1,5 +1,16 @@
- #CC=clang
- +ubuntu: ubuntu.lock
- +
- +ubuntu.lock:
- + gcc -O2 -g -fPIC -lcurl -c -o pam_notifo.o pam_notifo.c
- + gcc -shared -lcurl -g -o pam_notifo.so pam_notifo.o -lcurl -lpam
- + strip pam_notifo.so
- + touch ubuntu.lock
- +
- +clean:
- + @rm -f ubuntu.lock pam_notifo.so pam_notifo.o
- +
- all: pam_notifo.so
- # This is at least the correct way to compile for Mac OS X Snow Leopard with curl
- diff -ur pam_notifo-v0.1/pam_notifo.c pam_notifo-v0.1-ubuntu/pam_notifo.c
- --- pam_notifo-v0.1/pam_notifo.c 2010-09-10 18:28:56.000000000 -0400
- +++ pam_notifo-v0.1-ubuntu/pam_notifo.c 2011-12-13 16:09:54.353590703 -0500
- @@ -25,8 +25,8 @@
- #include <security/pam_modules.h>
- #include <security/pam_appl.h>
- -#include <security/openpam.h>
- #include <stdio.h>
- +#include <string.h>
- #include <stdlib.h>
- #include <syslog.h>
- #include <unistd.h>
- @@ -129,6 +129,7 @@
- int pam_sm_open_session(pam_handle_t *pamh, int flags, int argc, const char **argv){
- int ret;
- int pam_err;
- + int count;
- const char *pam_user = NULL;
- char *pam_service = NULL;
- char *pam_tty = NULL;
- @@ -175,14 +176,25 @@
- // Get Notifo user info
- - notifo_user = openpam_get_option(pamh, PAM_NOTIFO_USER_KEY);
- + if (argc > 1) {
- + for (count = 0; count < argc; count++) {
- + if (strncmp(argv[count],PAM_NOTIFO_USER_KEY,strlen(PAM_NOTIFO_USER_KEY))==0) {
- + notifo_user=argv[count]+strlen(PAM_NOTIFO_USER_KEY)+1;
- + }
- + if (strncmp(argv[count],PAM_NOTIFO_API_KEY,strlen(PAM_NOTIFO_API_KEY))==0) {
- + notifo_api_key=argv[count]+strlen(PAM_NOTIFO_API_KEY)+1;
- + }
- + }
- + }
- + //notifo_user = openpam_get_option(pamh, PAM_NOTIFO_USER_KEY);
- + // # No openpam
- if( notifo_user == NULL ) {
- syslog(LOG_WARNING, "Notifo username not provided in '%s' pam config file.", pam_service);
- return PAM_SESSION_ERR;
- }
- // Get Notifo API key
- - notifo_api_key = openpam_get_option(pamh, PAM_NOTIFO_API_KEY);
- + //notifo_api_key = openpam_get_option(pamh, PAM_NOTIFO_API_KEY);
- if( notifo_api_key == NULL ) {
- syslog(LOG_WARNING, "Notifo API key not provided in '%s' pam config file.", pam_service);
- return PAM_SESSION_ERR;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement