"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cf-serverd/server_common.c" between
cfengine-3.15.3.tar.gz and cfengine-3.15.4.tar.gz

About: CFEngine is a configuration management system for configuring and maintaining Unix-like computers (using an own high level policy language). Community version.

server_common.c  (cfengine-3.15.3):server_common.c  (cfengine-3.15.4)
skipping to change at line 1567 skipping to change at line 1567
/** /**
* @return #true if the connection should remain open for next requests, or * @return #true if the connection should remain open for next requests, or
* #false if the server should actively close it - for example when * #false if the server should actively close it - for example when
* protocol errors have occurred. * protocol errors have occurred.
*/ */
bool DoExec2(const EvalContext *ctx, bool DoExec2(const EvalContext *ctx,
ServerConnectionState *conn, ServerConnectionState *conn,
char *exec_args, char *exec_args,
char *sendbuf, size_t sendbuf_size) char *sendbuf, size_t sendbuf_size)
{ {
assert(conn != NULL);
/* STEP 0: Verify cfruncommand was successfully configured. */ /* STEP 0: Verify cfruncommand was successfully configured. */
if (NULL_OR_EMPTY(CFRUNCOMMAND)) if (NULL_OR_EMPTY(CFRUNCOMMAND))
{ {
Log(LOG_LEVEL_INFO, "EXEC denied due to empty cfruncommand"); Log(LOG_LEVEL_INFO, "EXEC denied due to empty cfruncommand");
RefuseAccess(conn, "EXEC"); RefuseAccess(conn, "EXEC");
return false; return false;
} }
/* STEP 1: Resolve and check permissions of CFRUNCOMMAND's arg0. IT is /* STEP 1: Resolve and check permissions of CFRUNCOMMAND's arg0. IT is
* done now and not at configuration time, as the file stat may * done now and not at configuration time, as the file stat may
skipping to change at line 1780 skipping to change at line 1782
xsnprintf(sendbuf, sendbuf_size, "> %s\n", line); xsnprintf(sendbuf, sendbuf_size, "> %s\n", line);
if (SendTransaction(conn->conn_info, sendbuf, 0, CF_DONE) == -1) if (SendTransaction(conn->conn_info, sendbuf, 0, CF_DONE) == -1)
{ {
Log(LOG_LEVEL_INFO, Log(LOG_LEVEL_INFO,
"Sending failed, aborting EXEC (send: %s)", "Sending failed, aborting EXEC (send: %s)",
GetErrorStr()); GetErrorStr());
break; break;
} }
} }
free(line); free(line);
cf_pclose(pp); int exit_code = cf_pclose(pp);
if (exit_code >= 0)
{
xsnprintf(sendbuf, sendbuf_size, "(exit code: %d)\n", exit_code);
if (SendTransaction(conn->conn_info, sendbuf, 0, CF_DONE) == -1)
{
Log(LOG_LEVEL_INFO, "Failed to send exit code from EXEC agent run");
}
}
return true; return true;
} }
 End of changes. 2 change blocks. 
1 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)