Add pure specifiers to some internal functions.

Some of the internal functions for getting MATCHTEXT and REGEXREPLACE
are not marked as pure.  This fix makes a significant difference to a
few archived example queries with conditional regexreplaces.

Fixes gh-3013

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Fix gh-2629 Configmgr - save as button
- Add a 'Save Environment As' button to toolbar.
- 'Save Environment As' can only be used in read-only mode
- 'Save Environment As' loads the saved environment file

Signed-off-by: Gleb Aronsky <gleb.aronsky@lexisnexis.com>
Fix gh-2629 Configmr - Save As Button

  - Add a 'Save Envrionment As' button to toolbar
  - 'Save Environment As' can be used in read-only or write-mode
    - In write-mode 'Save Environment As' will save in memory/volatile
      configuration to target file.
  - 'Save Environment As' in read-only mode will load the target
    file after save
  - 'Save Environment As...' from Navigator context menu (Hardware)
    will behave identically to the 'Save Envrionment As' button

Signed-off-by: Gleb Aronsky <gleb.aronsky@lexisnexis.com>
Fix gh-2933 - Ensure pid files are removed on reboot

Thor creates some additional pid files in it's instance directory.
If the node is cold booted, these pid files persist and are checked on the next Thor startup, by that time the pids could belond to other processes, in which case Thor can deadlock waiting for an old pid to exit, or in the case of slaves, could kill a random hpcc process believing it was a thorslave.

Ensure pid files are written to /var/run, which is cleared on reboot

Signed-off-by: Jake Smith <jake.smith@lexisnexis.com>
Fix gh-3063 - possible crash in esp

A subscriber object that was being link counted by the subscription mechasnism was being destroyed on the stack, consequently a notification could, depending on timing, lead to late invalid access to the destoyed subscriber object.

Signed-off-by: Jake Smith <jake.smith@lexisnexis.com>
Minor spacing change based on feedback.

Signed-off-by: Gleb Aronsky <gleb.aronsky@lexisnexis.com>
gh-3054 Fix incorrect 'Cluster Stopped' display for hThor and Roxie

In 3.8.0, Roxie and hThor clusters walways displayed 'Cluster stopped'
on the main activities page, even though the clusters were in fact running
properly.

This patch fixes that, and also ensures that workunits being run on
roxie via queue are displayed on the activities page.

Fixes gh-3054.
Fixes gh-2017.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Merge pull request #3072 from jakesmith/gh-2933

Fix gh-2933 - Ensure pid files are removed on reboot

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Fix gh-3024 Allow set permissions for repository root

When examining repository module type, code was referencing incorrect
resource name variable, resulting in "repository." being prepended to the
resource name (so "repository" because "repository.repository". Corrected
code to look at namebuf.str and tested on Windows and Ubuntu. The 0
return code will be address in gh-3023

Signed-off-by: William Whitehead <william.whitehead@lexisnexis.com>
Merge pull request #3080 from RussWhitehead/ldapPerms

Fix gh-3024 Allow set permissions for repository root

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
FIX gh-3023 Fix error calling MakeAbsoluteSD

MakeAbsoluteSD is a Win32 API, and when it fails, a call to GetLastError
retrieves the error code. However in Linux it is a method call implemented
in permissions.cpp, and in that implemenation it does not "SetLastError"
(a Win32 call).

In this bug, the call to MakeAbsoluteSD failed, and the error message was
built up from a call to GetLastError, which returns 0 since nothing was
set. This fix adds debug logging to the Linux implementation of that call,
and does not call GetLastError unless its a Win32 build

Signed-off-by: William Whitehead <william.whitehead@lexisnexis.com>
Fix gh-3070 superfile deleted when removing its subfiles

In existing EclWatch, removing all subfiles from a superfile
will delete the superfile itself.  This fix adds a checkbox
on Removing Subfiles page before a user deletes subfiles.
The checkbox will be enabled when a user is selected to
delete all of the subfiles. The user may choose to delete
(or not delete) the superfile using the checkbox.

Signed-off-by: Kevin Wang <kevin.wang@lexisnexis.com>
Merge pull request #3077 from richardkchapman/server-status-gh3054

gh-3054 Fix incorrect 'Cluster Stopped' display for hThor and Roxie

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Merge pull request #3075 from afishbeck/result_lib_attributes

Add result_lib.xslt support for displaying attributes

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Merge pull request #3073 from afishbeck/result_schema_xpath

Fix schemas not matching results when using xpaths

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Merge pull request #3071 from jakesmith/gh-3063

Fix gh-3063 - possible crash in esp

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Merge pull request #3082 from RussWhitehead/ldapSD

FIX gh-3023 Fix error calling MakeAbsoluteSD

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Fix gh-3081 Thor slave not shown when group name not set

The preflight does not see slave node after resizing/renaming
cluster. The problem also happens on Cluster Process page
(before the preflight page). It was due to empty group name
read from getClusterGroupName(). This fix checks the attribute
'nodeGroup', If it is emoty, use the attribute 'name' as group
name.

Signed-off-by: Kevin Wang <kevin.wang@lexisnexis.com>
Fix gh-3088 - fix possible memory manager deadlock

Deadlock could occur, if resizing a spillable row array at the same time
that an oom condition occurs.

Signed-off-by: Jake Smith <jake.smith@lexisnexis.com>
Merge pull request #3089 from jakesmith/mm-deadlock-fix

Fix gh-3088 - fix possible memory manager deadlock

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>