projects
/
silc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0b2d864
)
make publickeydir actually accepting only .pub as suffix
author
Giovanni Giacobbi
<johnny@silcnet.org>
Sat, 30 Nov 2002 17:51:33 +0000
(17:51 +0000)
committer
Giovanni Giacobbi
<johnny@silcnet.org>
Sat, 30 Nov 2002 17:51:33 +0000
(17:51 +0000)
apps/silcd/serverconfig.c
patch
|
blob
|
history
diff --git
a/apps/silcd/serverconfig.c
b/apps/silcd/serverconfig.c
index d40958746709ed5422947e0da0578ceb4d39ed52..b25f4e9437c5318b83c4402d1cc3104ef5d465f4 100644
(file)
--- a/
apps/silcd/serverconfig.c
+++ b/
apps/silcd/serverconfig.c
@@
-187,14
+187,14
@@
static bool my_parse_publickeydir(const char *dirname, void **auth_data)
/* errors are not considered fatal */
while ((get_file = readdir(dp))) {
/* errors are not considered fatal */
while ((get_file = readdir(dp))) {
- int dirname_len = strlen(dirname);
- char buf[1024];
const char *filename = get_file->d_name;
const char *filename = get_file->d_name;
+ char buf[1024];
+ int dirname_len = strlen(dirname), filename_len = strlen(filename);
struct stat check_file;
/* Ignore "." and "..", and take files only with ".pub" suffix. */
if (!strcmp(filename, ".") || !strcmp(filename, "..") ||
struct stat check_file;
/* Ignore "." and "..", and take files only with ".pub" suffix. */
if (!strcmp(filename, ".") || !strcmp(filename, "..") ||
-
!strstr(filename
, ".pub"))
+
(filename_len < 5) || strcmp(filename + filename_len - 4
, ".pub"))
continue;
memset(buf, 0, sizeof(buf));
continue;
memset(buf, 0, sizeof(buf));