aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Android.mk8
-rw-r--r--config.c9
-rw-r--r--eloop.c2
-rw-r--r--os_unix.c2
-rw-r--r--wpa_ctrl.c7
5 files changed, 25 insertions, 3 deletions
diff --git a/Android.mk b/Android.mk
index 5e8f07f..09a73eb 100644
--- a/Android.mk
+++ b/Android.mk
@@ -13,6 +13,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+ifndef WPA_SUPPLICANT_VERSION
+WPA_SUPPLICANT_VERSION := VER_0_5_X
+endif
+
+ifeq ($(WPA_SUPPLICANT_VERSION),VER_0_5_X)
+
LOCAL_PATH := $(call my-dir)
WPA_BUILD_SUPPLICANT := false
@@ -716,3 +722,5 @@ LOCAL_SHARED_LIBRARIES := libcutils
LOCAL_COPY_HEADERS_TO := libwpa_client
LOCAL_COPY_HEADERS := wpa_ctrl.h
include $(BUILD_SHARED_LIBRARY)
+
+endif # VER_0_5_X
diff --git a/config.c b/config.c
index e5aeac2..a1112b7 100644
--- a/config.c
+++ b/config.c
@@ -91,6 +91,14 @@ static int wpa_config_parse_str(const struct parse_data *data,
size_t res_len, *dst_len;
char **dst, *tmp;
+ if (os_strcmp(value, "NULL") == 0) {
+ wpa_printf(MSG_DEBUG, "Unset configuration string '%s'",
+ data->name);
+ tmp = NULL;
+ res_len = 0;
+ goto set;
+ }
+
tmp = wpa_config_parse_string(value, &res_len);
if (tmp == NULL) {
wpa_printf(MSG_ERROR, "Line %d: failed to parse %s '%s'.",
@@ -123,6 +131,7 @@ static int wpa_config_parse_str(const struct parse_data *data,
return -1;
}
+set:
dst = (char **) (((u8 *) ssid) + (long) data->param1);
dst_len = (size_t *) (((u8 *) ssid) + (long) data->param2);
os_free(*dst);
diff --git a/eloop.c b/eloop.c
index 9cac792..0ab5c73 100644
--- a/eloop.c
+++ b/eloop.c
@@ -417,6 +417,8 @@ int eloop_register_signal_terminate(eloop_signal_handler handler,
int ret = eloop_register_signal(SIGINT, handler, user_data);
if (ret == 0)
ret = eloop_register_signal(SIGTERM, handler, user_data);
+ if (ret == 0)
+ ret = eloop_register_signal(SIGSEGV, handler, user_data);
return ret;
}
diff --git a/os_unix.c b/os_unix.c
index edb160a..8498b15 100644
--- a/os_unix.c
+++ b/os_unix.c
@@ -181,7 +181,7 @@ int os_program_init(void)
/* We ignore errors here since errors are normal if we
* are already running as non-root.
*/
- gid_t groups[] = { AID_INET, AID_WIFI, AID_KEYSTORE };
+ gid_t groups[] = { AID_INET, AID_WIFI };
setgroups(sizeof(groups)/sizeof(groups[0]), groups);
prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);
diff --git a/wpa_ctrl.c b/wpa_ctrl.c
index 32866cf..29a3705 100644
--- a/wpa_ctrl.c
+++ b/wpa_ctrl.c
@@ -140,8 +140,11 @@ struct wpa_ctrl * wpa_ctrl_open(const char *ctrl_path)
void wpa_ctrl_close(struct wpa_ctrl *ctrl)
{
+ if (ctrl == NULL)
+ return;
unlink(ctrl->local.sun_path);
- close(ctrl->s);
+ if (ctrl->s >= 0)
+ close(ctrl->s);
os_free(ctrl);
}
@@ -187,7 +190,7 @@ void wpa_ctrl_cleanup(void)
#else /* CONFIG_CTRL_IFACE_UNIX */
#ifdef ANDROID
-void wpa_ctrl_cleanup()
+void wpa_ctrl_cleanup(void)
{
}
#endif /* ANDROID */