mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-29 16:24:03 -05:00
Android: Clean entire socket directory
Despite interface (and group) related sockets are not used for control, they are created and may be left. Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
This commit is contained in:
parent
92ecda40e0
commit
7b74c0acfb
@ -229,7 +229,6 @@ void wpa_ctrl_cleanup(void)
|
|||||||
struct dirent entry;
|
struct dirent entry;
|
||||||
struct dirent *result;
|
struct dirent *result;
|
||||||
size_t dirnamelen;
|
size_t dirnamelen;
|
||||||
int prefixlen = os_strlen(CONFIG_CTRL_IFACE_CLIENT_PREFIX);
|
|
||||||
size_t maxcopy;
|
size_t maxcopy;
|
||||||
char pathname[PATH_MAX];
|
char pathname[PATH_MAX];
|
||||||
char *namep;
|
char *namep;
|
||||||
@ -246,11 +245,8 @@ void wpa_ctrl_cleanup(void)
|
|||||||
namep = pathname + dirnamelen;
|
namep = pathname + dirnamelen;
|
||||||
maxcopy = PATH_MAX - dirnamelen;
|
maxcopy = PATH_MAX - dirnamelen;
|
||||||
while (readdir_r(dir, &entry, &result) == 0 && result != NULL) {
|
while (readdir_r(dir, &entry, &result) == 0 && result != NULL) {
|
||||||
if (os_strncmp(entry.d_name, CONFIG_CTRL_IFACE_CLIENT_PREFIX,
|
if (os_strlcpy(namep, entry.d_name, maxcopy) < maxcopy)
|
||||||
prefixlen) == 0) {
|
unlink(pathname);
|
||||||
if (os_strlcpy(namep, entry.d_name, maxcopy) < maxcopy)
|
|
||||||
unlink(pathname);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user