Skip to content

Commit

Permalink
Fixes #7797: Warn when the servers answers an empty string to a (S)OP…
Browse files Browse the repository at this point in the history
…ENDIR
  • Loading branch information
amousset committed Jan 18, 2016
1 parent 232e74e commit 5d73e60
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff -upr cfengine-3.6.0/libcfnet/client_code.c cfengine-3.6.0-new/libcfnet/client_code.c
--- cfengine-3.6.0/libcfnet/client_code.c 2014-06-11 16:13:56.000000000 +0200
+++ cfengine-3.6.0-new/libcfnet/client_code.c 2016-01-18 14:51:30.015183919 +0100
@@ -630,6 +630,14 @@ Item *RemoteDirList(const char *dirname,
DecryptString(conn->encryption_type, in, recvbuffer, conn->session_key, n);
}

+ if (recvbuffer[0] == '\0')
+ {
+ Log(LOG_LEVEL_ERR,
+ "Empty%s server packet when listing directory '%s'!",
+ (start == NULL) ? " first" : "",
+ dirname);
+ }
+
if (FailedProtoReply(recvbuffer))
{
Log(LOG_LEVEL_INFO, "Network access to '%s:%s' denied", conn->this_server, dirname);

0 comments on commit 5d73e60

Please sign in to comment.