summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--CMakeLists.txt9
-rw-r--r--config.h.in10
-rw-r--r--pam_wlan_helper.c11
4 files changed, 20 insertions, 12 deletions
diff --git a/.gitignore b/.gitignore
index 8d73a56..b25c15b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1 @@
*~
-pam_wlan.so
-pam_wlan_test
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d762cd7..17a8385 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,6 +9,15 @@ find_package(libnm_glib REQUIRED)
set(PAM_MODULE_DIR "${CMAKE_INSTALL_PREFIX}/lib/security" CACHE STRING "PAM module directory")
set(PAM_WLAN_HELPER_DIR "${CMAKE_INSTALL_PREFIX}/lib/security/pam_wlan" CACHE STRING "pam_wlan_helper install directory")
+set(CONNECTION_TIMEOUT "10" CACHE STRING "Connection timeout")
+set(CONNECTION_ID "" CACHE STRING "Connection ID")
+set(CONNECTION_UUID "" CACHE STRING "Connection UUID")
+set(CONNECTION_SSID "" CACHE STRING "Connection SSID")
+set(CONNECTION_AUTH_ALG "open" CACHE STRING "Connection authentication algorithm")
+set(CONNECTION_KEY_MGMT "wpa-eap" CACHE STRING "Connection key management method")
+set(CONNECTION_EAP "ttls" CACHE STRING "Connection EAP method")
+set(CONNECTION_PHASE2_AUTHEAP "mschapv2" CACHE STRING "Connection EAP phase2 authentication method")
+
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${PAM_INCLUDE_DIR} ${LIBNM_GLIB_INCLUDE_DIRS})
link_directories(${LIBNM_GLIB_LIBRARY_DIRS})
diff --git a/config.h.in b/config.h.in
index e5d6a26..6c83480 100644
--- a/config.h.in
+++ b/config.h.in
@@ -29,3 +29,13 @@
#define PAM_WLAN_HELPER "@PAM_WLAN_HELPER_DIR@/pam_wlan_helper"
+
+
+#define CONNECTION_TIMEOUT @CONNECTION_TIMEOUT@
+#define CONNECTION_ID "@CONNECTION_ID@"
+#define CONNECTION_UUID "@CONNECTION_UUID@"
+#define CONNECTION_SSID "@CONNECTION_SSID@"
+#define CONNECTION_AUTH_ALG "@CONNECTION_AUTH_ALG@"
+#define CONNECTION_KEY_MGMT "@CONNECTION_KEY_MGMT@"
+#define CONNECTION_EAP "@CONNECTION_EAP@"
+#define CONNECTION_PHASE2_AUTHEAP "@CONNECTION_PHASE2_AUTHEAP@"
diff --git a/pam_wlan_helper.c b/pam_wlan_helper.c
index 76db00a..7043ade 100644
--- a/pam_wlan_helper.c
+++ b/pam_wlan_helper.c
@@ -46,16 +46,7 @@
#include <nm-setting-ip4-config.h>
#include <nm-setting-ip6-config.h>
-
-#define TIMEOUT 10
-#define CONNECTION_ID "UzL-Wlan"
-#define CONNECTION_UUID "af7b7f0b-3e09-442e-8841-f7d7482fa7b0"
-
-#define CONNECTION_SSID "UzL-Wlan"
-#define CONNECTION_AUTH_ALG "open"
-#define CONNECTION_KEY_MGMT "wpa-eap"
-#define CONNECTION_EAP "ttls"
-#define CONNECTION_PHASE2_AUTHEAP "mschapv2"
+#include <config.h>
#define UNUSED __attribute__((unused))