Skip to content

Commit

Permalink
Make the config file directory configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
vorlonofportland committed Mar 31, 2023
1 parent fec610e commit abfb344
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ AC_PREREQ(2.63)
AC_INIT([pam_session_timelimit], [0.1],
[https://github.com/vorlonofportland/pam_session_timelimit/issues])

AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_HOST

Expand All @@ -44,6 +45,9 @@ AC_ARG_WITH(

AC_SUBST(configdir)

AC_DEFINE_UNQUOTED(CONFIGDIR, "$configdir",
[Define to the directory used for the config file])

AC_CONFIG_FILES([Makefile tests/Makefile doc/Makefile])

AC_OUTPUT
4 changes: 2 additions & 2 deletions pam_session_timelimit.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
#include <security/pam_modules.h>
#include <security/pam_ext.h>

#include "config.h"

#define UNUSED __attribute__((unused))

/* FIXME: this will be a configurable directory */
#define DEFAULT_CONFIG_PATH "/etc/security/time_limits.conf"
#define DEFAULT_CONFIG_PATH CONFIGDIR "/time_limits.conf"


static void cleanup(pam_handle_t *handle UNUSED, void *data, int err UNUSED)
Expand Down

0 comments on commit abfb344

Please sign in to comment.