280
280
config->ctrl_interface = strdup(pos + 15);
281
281
wpa_printf(MSG_DEBUG, "ctrl_interface='%s'",
282
282
config->ctrl_interface);
283
#ifndef CONFIG_CTRL_IFACE_UDP
284
283
} else if (strncmp(pos, "ctrl_interface_group=", 21) == 0) {
287
const char *group = pos + 21;
289
grp = getgrnam(group);
291
config->ctrl_interface_gid = grp->gr_gid;
292
config->ctrl_interface_gid_set = 1;
293
wpa_printf(MSG_DEBUG, "ctrl_interface_group=%d"
294
" (from group name '%s')",
295
(int) config->ctrl_interface_gid,
300
/* Group name not found - try to parse this as gid */
301
config->ctrl_interface_gid = strtol(group, &endp, 10);
302
if (*group == '\0' || *endp != '\0') {
303
wpa_printf(MSG_DEBUG, "Line %d: Invalid group "
304
"'%s'", line, group);
308
config->ctrl_interface_gid_set = 1;
309
wpa_printf(MSG_DEBUG, "ctrl_interface_group=%d",
310
(int) config->ctrl_interface_gid);
311
#endif /* CONFIG_CTRL_IFACE_UDP */
284
free(config->ctrl_interface_group);
285
config->ctrl_interface_group = strdup(pos + 21);
286
wpa_printf(MSG_DEBUG, "ctrl_interface_group='%s' "
288
config->ctrl_interface_group);
312
289
#endif /* CONFIG_CTRL_IFACE */
313
290
} else if (strncmp(pos, "eapol_version=", 14) == 0) {
314
291
config->eapol_version = atoi(pos + 14);
663
643
#ifdef CONFIG_CTRL_IFACE
664
644
if (config->ctrl_interface)
665
645
fprintf(f, "ctrl_interface=%s\n", config->ctrl_interface);
666
#ifndef CONFIG_CTRL_IFACE_UDP
667
if (config->ctrl_interface_gid_set) {
668
fprintf(f, "ctrl_interface_group=%d\n",
669
(int) config->ctrl_interface_gid);
671
#endif /* CONFIG_CTRL_IFACE_UDP */
646
if (config->ctrl_interface_group)
647
fprintf(f, "ctrl_interface_group=%s\n",
648
config->ctrl_interface_group);
672
649
#endif /* CONFIG_CTRL_IFACE */
673
650
if (config->eapol_version != DEFAULT_EAPOL_VERSION)
674
651
fprintf(f, "eapol_version=%d\n", config->eapol_version);