Skip to content

Commit

Permalink
Don't consider empty client.keys to be a failure condition on servers
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
chewi committed Nov 16, 2015
1 parent aaf2001 commit 3b476f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/os_crypto/shared/keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ void OS_ReadKeys(keystore *keys)
/* Clear one last time before leaving */
__memclear(id, name, ip, key, KEYSIZE + 1);

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

Expand Down

0 comments on commit 3b476f0

Please sign in to comment.