mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 04:11:08 +00:00
res_crypto: Don't load non-regular files in keys directory
ASTERISK-30046 Change-Id: Ie77e0648f8b0b1c2159fb24662d1989cfd4cc36d
This commit is contained in:
committed by
Friendly Automation
parent
2dac2bf8dc
commit
d13afaf302
5
doc/UPGRADE-staging/res_crypto-regular-file-keys.txt
Normal file
5
doc/UPGRADE-staging/res_crypto-regular-file-keys.txt
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
Subject: res_crypto
|
||||||
|
|
||||||
|
In addition to only paying attention to files ending with .key or .pub
|
||||||
|
in the keys directory, we now also ignore any files which aren't regular
|
||||||
|
files.
|
@@ -507,6 +507,13 @@ static void crypto_load(int ifd, int ofd)
|
|||||||
/* Load new keys */
|
/* Load new keys */
|
||||||
if ((dir = opendir(ast_config_AST_KEY_DIR))) {
|
if ((dir = opendir(ast_config_AST_KEY_DIR))) {
|
||||||
while ((ent = readdir(dir))) {
|
while ((ent = readdir(dir))) {
|
||||||
|
if (!strcmp(ent->d_name, ".") || !strcmp(ent->d_name, "..")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (ent->d_type != DT_REG) {
|
||||||
|
ast_log(LOG_WARNING, "Non-regular file '%s' in keys directory\n", ent->d_name);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
try_load_key(ast_config_AST_KEY_DIR, ent->d_name, ifd, ofd, ¬e);
|
try_load_key(ast_config_AST_KEY_DIR, ent->d_name, ifd, ofd, ¬e);
|
||||||
}
|
}
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
|
Reference in New Issue
Block a user