1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

lejp-conf: skip conf.d files containing tilde

https://github.com/warmcat/libwebsockets/issues/1051
This commit is contained in:
Andy Green 2017-10-12 07:03:44 +08:00
parent 1673554c6b
commit 6f3f2df7ca
2 changed files with 6 additions and 2 deletions

View file

@ -1,7 +1,7 @@
/*
* libwebsockets web server application
*
* Copyright (C) 2010-2016 Andy Green <andy@warmcat.com>
* Copyright (C) 2010-2017 Andy Green <andy@warmcat.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -815,9 +815,12 @@ lwsws_get_config_d(void *user, const char *d, const char * const *paths,
n = scandir(d, &namelist, filter, alphasort);
if (n < 0) {
lwsl_err("Scandir on %s failed\n", d);
return 1;
}
for (i = 0; i < n; i++) {
if (strchr(namelist[i]->d_name, '~'))
goto skip;
lws_snprintf(path, sizeof(path) - 1, "%s/%s", d,
namelist[i]->d_name);
ret = lwsws_get_config(user, path, paths, count_paths, cb);
@ -826,6 +829,7 @@ lwsws_get_config_d(void *user, const char *d, const char * const *paths,
free(namelist[i]);
goto bail;
}
skip:
free(namelist[i]);
}

View file

@ -1,7 +1,7 @@
/*
* libwebsockets web server application
*
* Copyright (C) 2010-2016 Andy Green <andy@warmcat.com>
* Copyright (C) 2010-2017 Andy Green <andy@warmcat.com>
*
* This file is made available under the Creative Commons CC0 1.0
* Universal Public Domain Dedication.