Skip to content

Commit

Permalink
Merge pull request #862 from amousset/bug_7793/random_wrong_or_partia…
Browse files Browse the repository at this point in the history
…l_copy_of_promises_from_node_to_server

Fixes #7793: Random wrong or partial copy of promises from node to server
  • Loading branch information
jooooooon committed Jan 18, 2016
2 parents 47a733f + c367f98 commit 27c139f
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
diff -upr cfengine-3.7.1-old/libcfnet/client_code.c cfengine-3.7.1/libcfnet/client_code.c
--- cfengine-3.7.1-old/libcfnet/client_code.c 2016-01-18 14:25:43.404660718 +0100
+++ cfengine-3.7.1/libcfnet/client_code.c 2016-01-18 14:28:06.454387620 +0100
@@ -348,6 +348,13 @@ Item *RemoteDirList(const char *dirname,
goto err;
}

+ if (encrypt)
+ {
+ memcpy(in, recvbuffer, nbytes);
+ DecryptString(conn->encryption_type, in, recvbuffer,
+ conn->session_key, nbytes);
+ }
+
if (recvbuffer[0] == '\0')
{
Log(LOG_LEVEL_ERR,
@@ -357,13 +364,6 @@ Item *RemoteDirList(const char *dirname,
goto err;
}

- if (encrypt)
- {
- memcpy(in, recvbuffer, nbytes);
- DecryptString(conn->encryption_type, in, recvbuffer,
- conn->session_key, nbytes);
- }
-
if (FailedProtoReply(recvbuffer))
{
Log(LOG_LEVEL_INFO, "Network access to '%s:%s' denied", conn->this_server, dirname);

0 comments on commit 27c139f

Please sign in to comment.