Skip to content

Commit

Permalink
Security/1038 update packages (#486)
Browse files Browse the repository at this point in the history
* Updated scripts update_apt_package_in_package_list.sh and update_apt_packages_in_package_list.sh
* Updated curl from 7.81.0-1ubuntu1.19 to .20
* Updated java rules in base.MODULE.bazel
* included cstdint in string_ops.cc
* Update version number
* Updated libcurl4-openssl-dev|7.81.0-1ubuntu1.19|7.81.0-1ubuntu1.20
  • Loading branch information
ckunki authored Dec 20, 2024
1 parent e3b70b8 commit 3612f64
Show file tree
Hide file tree
Showing 15 changed files with 45 additions and 43 deletions.
2 changes: 1 addition & 1 deletion exaudfclient/base/base.MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "googletest", version = "1.15.0")
bazel_dep(name = "rules_java", version = "6.1.1")
bazel_dep(name = "rules_java", version = "7.6.1")
bazel_dep(name = "rules_jvm_external", version = "6.2")

python_local_repository = use_repo_rule("//base:python_repository.bzl", "python_local_repository")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "base/javacontainer/script_options/string_ops.h"
#include <regex>
#include <iostream>
#include <cstdint>

namespace SWIGVMContainers {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
curl|7.81.0-1ubuntu1.19 # t1
curl|7.81.0-1ubuntu1.20 # t1
wget|1.21.2-2ubuntu1.1 # t2
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
curl|7.81.0-1ubuntu1.19 # t1
curl|7.81.0-1ubuntu1.20 # t1
wget| # t2
git|
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
coreutils|8.32-4.1ubuntu1.2
locales|2.35-0ubuntu3.8
curl|7.81.0-1ubuntu1.19
curl|7.81.0-1ubuntu1.20
ca-certificates|20240203~22.04.1
bzip2|1.0.8-5build1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
coreutils|8.32-4.1ubuntu1.2
locales|2.35-0ubuntu3.8
tar|1.34+dfsg-1ubuntu0.1.22.04.2
curl|7.81.0-1ubuntu1.19
curl|7.81.0-1ubuntu1.20
openjdk-17-jdk-headless|17.0.13+11-2ubuntu1~22.04
build-essential|12.9ubuntu3
libpcre3-dev|2:8.39-13ubuntu0.22.04.1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ca-certificates|20240203~22.04.1
curl|7.81.0-1ubuntu1.19
curl|7.81.0-1ubuntu1.20
openjdk-17-jdk-headless|17.0.13+11-2ubuntu1~22.04
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
coreutils|8.32-4.1ubuntu1.2
locales|2.35-0ubuntu3.8
curl|7.81.0-1ubuntu1.19
curl|7.81.0-1ubuntu1.20
ca-certificates|20240203~22.04.1
bzip2|1.0.8-5build1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
coreutils|8.32-4.1ubuntu1.2
locales|2.35-0ubuntu3.8
tar|1.34+dfsg-1ubuntu0.1.22.04.2
curl|7.81.0-1ubuntu1.19
curl|7.81.0-1ubuntu1.20
openjdk-11-jdk|11.0.25+9-1ubuntu1~22.04
build-essential|12.9ubuntu3
libpcre3-dev|2:8.39-13ubuntu0.22.04.1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
unzip|6.0-26ubuntu3.2
git|1:2.34.1-1ubuntu1.11
libcurl4-openssl-dev|7.81.0-1ubuntu1.19
libcurl4-openssl-dev|7.81.0-1ubuntu1.20
build-essential|12.9ubuntu3
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ca-certificates|20240203~22.04.1
python3.10-dev|3.10.12-1~22.04.7
python3-distutils|3.10.8-1~22.04
curl|7.81.0-1ubuntu1.19
curl|7.81.0-1ubuntu1.20
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
coreutils|8.32-4.1ubuntu1.2
locales|2.35-0ubuntu3.8
curl|7.81.0-1ubuntu1.19
curl|7.81.0-1ubuntu1.20
ca-certificates|20240203~22.04.1
bzip2|1.0.8-5build1
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
package-mode = false
name = "exasol-script-languages"
version = "8.1.0"
version = "9.1.0"
description = "Script Languages"

license = "MIT"
Expand Down
51 changes: 26 additions & 25 deletions scripts/update_apt_package_in_package_list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,35 @@ set -o errexit
set -o nounset
set -o pipefail

if [ $# -eq 0 ];
then
echo '"Package|Installed|Candidate" SEARCH_DIRECTORY REPLACE'
exit 1
if [ $# == 0 ]; then
echo '"Package|Installed|Candidate" [SEARCH_DIRECTORY] [REPLACE]'
echo '- SEARCH_DIRECTORY: default .'
echo '- REPLACE: either yes or no, default: no'
exit 1
fi

LIST_NEWEST_VERSION_OUTPUT=$1 # Package|Installed|Candidate
SEARCH_DIRECTORY=$2
REPLACE=$3
# Format of $1: Package|Installed|Candidate
# Set array variable SPEC.
IFS='|' read -ra SPEC <<< "$1"
SEARCH_DIRECTORY=${2:-flavors}
REPLACE=${3:-no}

PACKAGE=$(echo "$LIST_NEWEST_VERSION_OUTPUT" | cut -f 1 -d "|")
CANDIDATE_VERSION=$(echo "$LIST_NEWEST_VERSION_OUTPUT" | cut -f 3 -d "|")
CURRENT_VERSION=$(echo "$LIST_NEWEST_VERSION_OUTPUT" | cut -f 2 -d "|")
PACKAGE=${SPEC[0]}
CURRENT_VERSION=${SPEC[1]}
CANDIDATE_VERSION=${SPEC[2]}

FILES=$(grep -R "^$PACKAGE|$CURRENT_VERSION" "$SEARCH_DIRECTORY" | cut -f 1 -d ":")
for FILE in $FILES
do
echo "Found package $PACKAGE|$CURRENT_VERSION in $FILE"
echo "Original lines:"
grep "^$PACKAGE|$CURRENT_VERSION" "$FILE"
echo "Updated lines:"
CURRENT_VERSION_ESCAPE=${CURRENT_VERSION//\~/\\~}
SEARCH_REPLACE_PATTERN="s/^($PACKAGE\|$CURRENT_VERSION_ESCAPE).*$/$PACKAGE|$CANDIDATE_VERSION/g"
sed -E "$SEARCH_REPLACE_PATTERN" "$FILE" | grep "^$PACKAGE|"
if [[ "$REPLACE" == "yes" ]]
then
echo "Updating file $FILE:"
sed -E -i "$SEARCH_REPLACE_PATTERN" "$FILE"
fi
echo
for FILE in $FILES; do
echo "Found package $PACKAGE|$CURRENT_VERSION in $FILE"
echo "Original lines:"
grep "^$PACKAGE|$CURRENT_VERSION" "$FILE"
echo "Updated lines:"
CURRENT_VERSION_ESCAPE=${CURRENT_VERSION//\~/\\~}
SEARCH_REPLACE_PATTERN="s/^($PACKAGE\|$CURRENT_VERSION_ESCAPE).*$/$PACKAGE|$CANDIDATE_VERSION/g"
sed -E "$SEARCH_REPLACE_PATTERN" "$FILE" | grep "^$PACKAGE|"
if [ "$REPLACE" == "yes" ]; then
echo "Updating file $FILE:"
sed -E -i "$SEARCH_REPLACE_PATTERN" "$FILE"
fi
echo
done
12 changes: 6 additions & 6 deletions scripts/update_apt_packages_in_package_list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ set -o pipefail

SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"

if [ $# -eq 0 ];
then
echo 'SEARCH_DIRECTORY REPLACE'
exit 1
if [ $# -eq 0 ]; then
echo 'SEARCH_DIRECTORY REPLACE'
exit 1
fi

SEARCH_DIRECTORY=$1
REPLACE=$2

while read -r LIST_NEWEST_VERSION_OUTPUT; do
bash "$SCRIPT_DIR/update_apt_package_in_package_list.sh" "$LIST_NEWEST_VERSION_OUTPUT" "$SEARCH_DIRECTORY" "$REPLACE" || true
while read -r LIST_NEWEST_VERSION_OUTPUT; do
bash "$SCRIPT_DIR/update_apt_package_in_package_list.sh" \
"$LIST_NEWEST_VERSION_OUTPUT" "$SEARCH_DIRECTORY" "$REPLACE" || true
done

0 comments on commit 3612f64

Please sign in to comment.