|
@@ -533,6 +533,8 @@ static void eap_fast_write(char **buf, char **pos, size_t *buf_len,
|
|
static int eap_fast_write_pac(struct eap_sm *sm, const char *pac_file,
|
|
static int eap_fast_write_pac(struct eap_sm *sm, const char *pac_file,
|
|
char *buf, size_t len)
|
|
char *buf, size_t len)
|
|
{
|
|
{
|
|
|
|
+ int ret = 0;
|
|
|
|
+
|
|
if (os_strncmp(pac_file, "blob://", 7) == 0) {
|
|
if (os_strncmp(pac_file, "blob://", 7) == 0) {
|
|
struct wpa_config_blob *blob;
|
|
struct wpa_config_blob *blob;
|
|
blob = os_zalloc(sizeof(*blob));
|
|
blob = os_zalloc(sizeof(*blob));
|
|
@@ -555,12 +557,16 @@ static int eap_fast_write_pac(struct eap_sm *sm, const char *pac_file,
|
|
"file '%s' for writing", pac_file);
|
|
"file '%s' for writing", pac_file);
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
- fwrite(buf, 1, len, f);
|
|
|
|
|
|
+ if (fwrite(buf, 1, len, f) != len) {
|
|
|
|
+ wpa_printf(MSG_INFO, "EAP-FAST: Failed to write all "
|
|
|
|
+ "PACs into '%s'", pac_file);
|
|
|
|
+ ret = -1;
|
|
|
|
+ }
|
|
os_free(buf);
|
|
os_free(buf);
|
|
fclose(f);
|
|
fclose(f);
|
|
}
|
|
}
|
|
|
|
|
|
- return 0;
|
|
|
|
|
|
+ return ret;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|