diff mbox

[10/12] hostapd-config: Error out if user configures sqlite db without CONFIG_SQLITE.

Message ID 1427405998-13038-10-git-send-email-greearb@candelatech.com
State Accepted
Headers show

Commit Message

Ben Greear March 26, 2015, 9:39 p.m. UTC
From: Ben Greear <greearb@candelatech.com>

This should make it more obvious to users that they have a fatal configuration
problem.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 hostapd/config_file.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox

Patch

diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index cae9fd3..f1e8df8 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -222,9 +222,14 @@  static int hostapd_config_read_eap_user(const char *fname,
 		return 0;
 
 	if (os_strncmp(fname, "sqlite:", 7) == 0) {
+#ifdef CONFIG_SQLITE
 		os_free(conf->eap_user_sqlite);
 		conf->eap_user_sqlite = os_strdup(fname + 7);
 		return 0;
+#else
+		wpa_printf(MSG_ERROR, "EAP user file is sqlite, but CONFIG_SQLITE is not enabled.\n");
+		return -1;
+#endif
 	}
 
 	f = fopen(fname, "r");