Skip to content

Commit 3b476f0

Browse files
committed
Don't consider empty client.keys to be a failure condition on servers
client.keys is already reloaded each time a given key is not found in memory so there's no harm in this file being empty. In fact, it's downright annoying if you're using authd because you have to wait for the first agent to register and then manually restart the server before they can start communicating. Removing this check would make the Chef cookbook less clunky. Disclaimer: I haven't tested this at all because I've already sunk too much time into the cookbook. The change seems simple enough though.
1 parent aaf2001 commit 3b476f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/os_crypto/shared/keys.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ void OS_ReadKeys(keystore *keys)
250250
/* Clear one last time before leaving */
251251
__memclear(id, name, ip, key, KEYSIZE + 1);
252252

253-
/* Check if there are any agents available */
254-
if (keys->keysize == 0) {
253+
/* Check if there are any keys available, except on remoted */
254+
if (keys->keysize == 0 && strcmp(__local_name, "ossec-remoted") != 0) {
255255
ErrorExit(NO_REM_CONN, __local_name);
256256
}
257257

0 commit comments

Comments
 (0)