Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormboelen <michael@cisofy.com>2015-12-21 14:08:47 +0300
committermboelen <michael@cisofy.com>2015-12-21 14:08:47 +0300
commit040c2efc1c328627d9b89336d80c4ae35e6a7d17 (patch)
tree47713ea248892c184d5d1aafb06b27098aca2acc
parent252f774f57c5f6a1b93b81146a6a9b87ae722dce (diff)
Perform compressed uploads by default
-rw-r--r--include/consts2
-rw-r--r--include/data_upload7
-rw-r--r--include/profiles2
3 files changed, 8 insertions, 3 deletions
diff --git a/include/consts b/include/consts
index 039dddc1..84d982cd 100644
--- a/include/consts
+++ b/include/consts
@@ -60,6 +60,7 @@ unset LANG
COMPLIANCE_ENABLE_PCI_DSS=0
COMPLIANCE_TESTS_PERFORMED=0
COMPLIANCE_FINDINGS_FOUND=0
+ COMPRESSED_UPLOADS=1
CONTROL_URL_APPEND=""
CONTROL_URL_PREPEND=""
CSUMBINARY=""
@@ -112,7 +113,6 @@ unset LANG
OS=""; OS_MODE=""
OS_REDHAT_OR_CLONE=0
OSIRISBINARY=""
- OPTIONS_COMPRESSED_UPLOADS=1
PASSWORD_MAXIMUM_DAYS=-1
PASSWORD_MINIMUM_DAYS=-1
PAM_2F_AUTH_ENABLED=0
diff --git a/include/data_upload b/include/data_upload
index 79f11598..66e8f938 100644
--- a/include/data_upload
+++ b/include/data_upload
@@ -138,7 +138,12 @@ output "Settings file: ${SETTINGS_FILE}"
# Try to connect
output "Uploading data.."
logtext "Command used: ${CURLBINARY} ${CURL_OPTIONS} -s -S --data-urlencode \"data@${REPORTFILE}\" --data-urlencode \"licensekey=${LICENSE_KEY}\" --data-urlencode \"hostid=${HOSTID}\" ${UPLOAD_URL}"
- UPLOAD=`${CURLBINARY} ${CURL_OPTIONS} -s -S --data-urlencode "data@${REPORTFILE}" --data-urlencode "licensekey=${LICENSE_KEY}" --data-urlencode "hostid=${HOSTID}" ${UPLOAD_URL} 2> /dev/null`
+ # Add a space
+ CURL_OPTIONS=" ${CURL_OPTIONS}"
+ if [ ${COMPRESSED_UPLOADS} -eq 1 ]; then
+ CURL_OPTIONS="${CURL_OPTIONS} --compressed"
+ fi
+ UPLOAD=`${CURLBINARY}${CURL_OPTIONS} -s -S --data-urlencode "data@${REPORTFILE}" --data-urlencode "licensekey=${LICENSE_KEY}" --data-urlencode "hostid=${HOSTID}" ${UPLOAD_URL} 2> /dev/null`
EXITCODE=$?
if [ ${EXITCODE} -gt 0 ]; then
echo "${RED}Error: ${NORMAL}Error occurred, cURL ended during the upload of the report data."
diff --git a/include/profiles b/include/profiles
index 39907c2e..5a7dd29e 100644
--- a/include/profiles
+++ b/include/profiles
@@ -175,7 +175,7 @@
# Compression of uploads (enabled by default)
upload_compressed)
- if [ "${VALUE}" = "0" ]; then OPTIONS_COMPRESSED_UPLOADS=1 ]; fi
+ if [ "${VALUE}" = "0" ]; then COMPRESSED_UPLOADS=1 ]; fi
;;
# Options during upload of data