Skip to content

Commit

Permalink
Integrate buildPam.sh into install target
Browse files Browse the repository at this point in the history
Bugs: #13
  • Loading branch information
Jnchi authored Dec 6, 2018
1 parent 989178d commit d0a30d3
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 44 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ paket-files/
# Generated by Autotools

.libs/
m4/
Makefile
Makefile.in
aclocal.m4
Expand All @@ -269,5 +270,7 @@ build-aux/
config.status
configure
libtool
m4/
*.la
src/.deps/
src/.dirstamp
src/*.lo
File renamed without changes.
16 changes: 11 additions & 5 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
pamdir = $(libdir)/security
ACLOCAL_AMFLAGS = -I m4

dist_doc_data = README.md

MODULES_LDFLAGS = -PIC -fno-stack-protector -avoid-version -module -shared -export-dynamic
AM_LDFLAGS = -Wl,-x -Wl,--strip-debug -Wl,--build-id=none -no-undefined
MODULES_LDFLAGS = -fPIC -fno-stack-protector -avoid-version -module -shared -export-dynamic

libdir = $(PAMDIR)

lib_LTLIBRARIES= pam-aad.la
lib_LTLIBRARIES= pam_aad.la

pam_aad_la_SOURCES = src/aad.c
pam_aad_la_SOURCES = src/pam_aad.c

CORE_SRC =
CORE_SRC += src/rest.c src/rest.h
Expand All @@ -18,10 +21,13 @@ pam_aad_la_SOURCES += $(CORE_SRC)

pam_aad_la_LIBADD = -lpam -lssl -lcrypto -lm -ljwt
pam_aad_la_CFLAGS = $(AM_CFLAGS)
pam_aad_la_LDFLAGS = $(AM_LDFLAGS) $(MODULES_LDFLAGS) -export-symbols-regex "pam_sm_(setcred|open_session|authenticate)"
pam_aad_la_LDFLAGS = $(AM_LDFLAGS) $(MODULES_LDFLAGS) -export-symbols-regex "^pam_sm_"

super-clean: maintainer-clean
rm -fr aclocal autom4te.cache/ m4 missing libtool config.guess
rm -fr config.lt config.status config.sub configure depcomp
rm -fr libtool install-sh *~ Makefile aclocal.m4 config.h.in ltmain.sh
rm -fr Makefile.in

install-data-hook:
rm -f $(moduledir)/pam_aad.la
4 changes: 4 additions & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh -x

umask 022
autoreconf -fiv
7 changes: 0 additions & 7 deletions buildPam.sh

This file was deleted.

61 changes: 35 additions & 26 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,58 +1,67 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.65])
AC_INIT([pam_aad], [0.8], [info@cyberninjas.com])

AC_INIT([pam_aad], [0.0.1], [info@cyberninjas.com])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_HOST

AM_INIT_AUTOMAKE([1.11 foreign subdir-objects])
AM_INIT_AUTOMAKE([1.11 foreign subdir-objects -Wall -Werror])
AM_SILENT_RULES([yes])
AM_MAINTAINER_MODE

AC_USE_SYSTEM_EXTENSIONS
# Checks for programs.

dnl Checks for programs.
AC_PROG_CC_C_O
AM_PROG_AR
AC_LIBTOOL_WIN32_DLL
AC_DISABLE_STATIC
AC_PROG_LIBTOOL

LT_INIT([disable-static])
AC_ENABLE_STATIC([no])
AC_ENABLE_SHARED([yes])

AC_ARG_ENABLE([man],
[AS_HELP_STRING([--disable-man], [Disable man page generation])],
[:],
[enable_man=yes]
)
[AS_HELP_STRING([--disable-man], [Disable man page generation])],
[:],
[enable_man=yes]
)

AC_SUBST(PAMDIR, "\$(exec_prefix)/lib/security")
AC_ARG_WITH(pam-dir,
AC_HELP_STRING([--with-pam-dir=DIR],
[Where to install PAM module [[PREFIX/lib/security]]]),
[case "${withval}" in
/*) PAMDIR="${withval}";;
./*|../*) AC_MSG_ERROR(Bad value for --with-pam-dir);;
*) PAMDIR="\$(exec_prefix)/lib/${withval}";;
esac])
AC_MSG_NOTICE([PAM installation path $PAMDIR])

# Checks for libraries.
dnl Checks for libraries.
AC_CHECK_LIB([crypto], [CRYPTO_new_ex_data])
AC_CHECK_LIB([jwt], [jwt_set_alg])
AC_CHECK_LIB([m], [cos])
AC_CHECK_LIB([pam], [pam_get_user])
AC_CHECK_LIB([ssl], [SSL_library_init])

# Checks for header files.
dnl Checks for header files.
AC_CHECK_HEADERS([float.h limits.h stddef.h stdlib.h string.h syslog.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
dnl Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
AC_TYPE_SIZE_T

# Checks for library functions.
dnl Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([floor memset pow strchr strdup strstr])

AC_CONFIG_FILES([Makefile])
AC_OUTPUT

echo "
$PACKAGE_NAME version $PACKAGE_VERSION
Prefix.........: $prefix
Debug Build....: $debug
C Compiler.....: $CC $CFLAGS
Linker.........: $LD $LDFLAGS $LIBS
"
AC_MSG_NOTICE([Summary of build options:
Version: ${VERSION}
Host type: ${host}
Install prefix: ${prefix}
Compiler: ${CC}
Library types: Shared=${enable_shared}, Static=${enable_static}
PAM: ${PAMDIR}
])
3 changes: 0 additions & 3 deletions src/.gitignore

This file was deleted.

4 changes: 2 additions & 2 deletions src/aad.c → src/pam_aad.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ int request_azure_auth(pam_handle_t *pamh, int echocode, const char *resource_id

static int parse_args(pam_handle_t *pamh, int argc, const char **argv,
Params *params){
params->debug = 0;
params->echocode = PAM_PROMPT_ECHO_OFF;
params->debug = 1;
params->echocode = PAM_PROMPT_ECHO_ON;
int i;
for (i = 0; i < argc; ++i){
if(!memcmp(argv[i], "client_id=", 10)){
Expand Down

0 comments on commit d0a30d3

Please sign in to comment.