Skip to content

Commit

Permalink
Merge branch 'candidate-6.0.8' into candidate-6.2.0
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
  • Loading branch information
richardkchapman committed Nov 22, 2016
2 parents ba5b70b + 524728d commit f0280cd
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 12 deletions.
11 changes: 10 additions & 1 deletion cmake_modules/commonSetup.cmake
Expand Up @@ -225,6 +225,11 @@ IF ("${COMMONSETUP_DONE}" STREQUAL "")
set(CMAKE_MODULE_PATH "${HPCC_SOURCE_DIR}/cmake_modules/")

if(UNIX AND SIGN_MODULES)
execute_process(COMMAND bash "-c" "gpg --version | awk 'NR==1{print $3}'"
OUTPUT_VARIABLE GPG_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
message(STATUS "gpg version ${GPG_VERSION}")
#export gpg public key used for signing to new installation
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/pub.key
COMMAND gpg --output=${CMAKE_BINARY_DIR}/pub.key --batch --no-tty --export ${SIGN_MODULES_KEYID}
Expand Down Expand Up @@ -945,9 +950,13 @@ IF ("${COMMONSETUP_DONE}" STREQUAL "")
if(DEFINED SIGN_MODULES_KEYID)
set(GPG_DEFAULT_KEY_OPTION --default-key)
endif()
set(GPG_BATCH_OPTIONS --batch --no-tty)
if("${GPG_VERSION}" VERSION_GREATER "2.1")
set(GPG_BATCH_OPTIONS --pinentry-mode=loopback ${GPG_BATCH_OPTIONS})
endif()
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${module}
COMMAND gpg --output ${CMAKE_CURRENT_BINARY_DIR}/${module} ${GPG_DEFAULT_KEY_OPTION} ${SIGN_MODULES_KEYID} --clearsign ${GPG_PASSPHRASE_OPTION} ${SIGN_MODULES_PASSPHRASE} --batch --no-tty ${module}
COMMAND gpg ${GPG_BATCH_OPTIONS} --output ${CMAKE_CURRENT_BINARY_DIR}/${module} ${GPG_PASSPHRASE_OPTION} ${SIGN_MODULES_PASSPHRASE} ${GPG_DEFAULT_KEY_OPTION} ${SIGN_MODULES_KEYID} --clearsign ${module} </dev/null
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Adding signed ${module} to project"
)
Expand Down
1 change: 1 addition & 0 deletions cmake_modules/dependencies/yakkety.cmake
@@ -0,0 +1 @@
SET_DEPENDENCIES ( CPACK_DEBIAN_PACKAGE_DEPENDS g++ openssh-client openssh-server expect rsync libapr1 python psmisc )
7 changes: 3 additions & 4 deletions system/jlib/jdebug.cpp
Expand Up @@ -1481,7 +1481,7 @@ class CProcessMonitor
CIArrayOf<CProcInfo> processes;
unsigned tot_time;
bool busy;

CriticalSection sect;

static int compare(CInterface * const *i1, CInterface * const *i2)
{
Expand All @@ -1502,9 +1502,8 @@ class CProcessMonitor
processes.item(i1).active = false;
DIR *dir = opendir("/proc");
loop {
struct dirent *ent;
struct dirent entryMem;
readdir_r(dir, &entryMem, &ent);
CriticalBlock b(sect);
struct dirent *ent = readdir(dir);
if (!ent)
break;
if ((ent->d_name[0]>='0')&&(ent->d_name[0]<='9')) {
Expand Down
5 changes: 3 additions & 2 deletions system/jlib/jfile.cpp
Expand Up @@ -3557,6 +3557,7 @@ class CLinuxDirectoryIterator : public CDirectoryIterator
DIR * handle;
struct stat st;
bool gotst;
CriticalSection sect;

bool loadst()
{
Expand Down Expand Up @@ -3617,11 +3618,11 @@ class CLinuxDirectoryIterator : public CDirectoryIterator
bool next()
{
loop {
struct dirent dirEntry;
struct dirent *entry;
loop {
gotst = false;
readdir_r(handle, &dirEntry, &entry);
CriticalBlock b(sect);
entry = readdir(handle);
// need better checking here?
if (!entry)
break;
Expand Down
5 changes: 3 additions & 2 deletions system/jlib/jregexp.cpp
Expand Up @@ -1344,10 +1344,11 @@ static bool WildMatchNreplace ( const char *src, int srclen, int srcidx,
(toupper(src[srcidx])!=toupper(next_char)))
goto Fail;
}
else
else {
if ((srcidx == srclen) || (src[srcidx]!=next_char))
goto Fail;
srcidx++;
}
srcidx++;
}
else {
loop {
Expand Down
8 changes: 6 additions & 2 deletions system/jlib/jthread.cpp
Expand Up @@ -1644,20 +1644,24 @@ class CIgnoreSIGPIPE
public:
CIgnoreSIGPIPE()
{
oact.sa_handler = SIG_IGN;
struct sigaction act;
sigset_t blockset;
sigemptyset(&blockset);
act.sa_mask = blockset;
act.sa_handler = SIG_IGN;
act.sa_flags = 0;
sigaction(SIGPIPE, &act, NULL);
sigaction(SIGPIPE, &act, &oact);
}

~CIgnoreSIGPIPE()
{
signal(SIGPIPE, SIG_DFL);
if (oact.sa_handler != SIG_IGN)
sigaction(SIGPIPE, &oact, NULL);
}

private:
struct sigaction oact;
};

#define WHITESPACE " \t\n\r"
Expand Down
10 changes: 9 additions & 1 deletion system/security/LdapSecurity/ldaputils.cpp
Expand Up @@ -23,6 +23,9 @@

#include "ldaputils.hpp"

#ifndef _WIN32
# include <signal.h>
#endif

//------------------------------------
// LdapUtils implementation
Expand Down Expand Up @@ -107,7 +110,12 @@ int LdapUtils::LdapSimpleBind(LDAP* ld, char* userdn, char* password)
ldap_set_option(ld, LDAP_OPT_TIMEOUT, &timeout);
ldap_set_option(ld, LDAP_OPT_NETWORK_TIMEOUT, &timeout);
#endif
return ldap_bind_s(ld, userdn, password, LDAP_AUTH_SIMPLE);
int srtn = ldap_bind_s(ld, userdn, password, LDAP_AUTH_SIMPLE);
#ifndef _WIN32
// secure ldap tls might overwrite SIGPIPE handler
signal(SIGPIPE, SIG_IGN);
#endif
return srtn;
}

// userdn is required for ldap_simple_bind_s, not really necessary for ldap_bind_s.
Expand Down
2 changes: 2 additions & 0 deletions thorlcr/graph/thgraphmaster.cpp
Expand Up @@ -237,6 +237,8 @@ void CSlaveMessageHandler::main()
size32_t startCtxLen;
msg.read(startCtxLen);
element->doCreateActivity(parentExtractSz, parentExtract, startCtxLen ? &msg : nullptr);
if (element->queryActivity())
element->preStart(parentExtractSz, parentExtract);
}
catch (IException *e)
{
Expand Down

0 comments on commit f0280cd

Please sign in to comment.