diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cc243cd..19a11b0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,10 +12,14 @@ jobs: container: 'ubuntu:latest' artifact: 'ubuntu' - - os: ubuntu-latest + - os: alpine-latest container: 'alpine:latest' artifact: 'alpine' - + + - os: rockylinux + container: 'rockylinux:9' # they do not have latest, but 9 will be covered for all the defaults for all latest 9 version + artifact: 'rockylinux' + - os: windows-latest artifact: 'windows' @@ -29,7 +33,13 @@ jobs: run: | apt update apt -y install git make pbzip2 binutils bzip2 zstd gnupg - + + - name: Install RockyLinux packages + if: matrix.container == 'rockylinux:9' + run: | + dnf groupinstall -y "Development Tools" "RPM Development Tools" + dnf install -y zstd binutils binutils-devel gnupg2 pbzip2 + - name: Install Alpine packages if: matrix.container == 'alpine:latest' run: apk add --no-cache bash git make libarchive-tools gnupg coreutils binutils bzip2 zstd @@ -39,14 +49,14 @@ jobs: run: brew install pbzip2 coreutils zstd - name: Checkout Makeself - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: 'true' - name: Build release run: make - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: build-${{ matrix.artifact }} path: release @@ -56,13 +66,13 @@ jobs: test-freebsd: needs: test - runs-on: macos-12 + runs-on: ubuntu-latest name: Test Makeself on FreeBSD steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 - name: Test on FreeBSD - uses: vmactions/freebsd-vm@v0 + uses: vmactions/freebsd-vm@v1 with: usesh: true prepare: pkg install -y pbzip2 @@ -72,45 +82,45 @@ jobs: test-openbsd: needs: test - runs-on: macos-12 + runs-on: ubuntu-latest name: Test Makeself on OpenBSD steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 - name: Test on OpenBSD - uses: vmactions/openbsd-vm@v0 + uses: vmactions/openbsd-vm@v1 with: usesh: true - prepare: pkg_add pbzip2 + prepare: /usr/sbin/pkg_add pbzip2 run: | pwd sh ./test/run-makeself.sh test-netbsd: needs: test - runs-on: macos-12 + runs-on: ubuntu-latest name: Test Makeself on NetBSD steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 - name: Test on NetBSD - uses: vmactions/netbsd-vm@v0 + uses: vmactions/netbsd-vm@v1 with: usesh: true - prepare: pkg_add pbzip2 + prepare: /usr/sbin/pkg_add pbzip2 run: | pwd sh ./test/run-makeself.sh test-solaris: needs: test - runs-on: macos-12 + runs-on: ubuntu-latest name: Test Makeself on Solaris steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 - name: Test on Solaris - uses: vmactions/solaris-vm@v0 + uses: vmactions/solaris-vm@v1 with: mem: 2048 prepare: pkgutil -y -i pbzip2 @@ -124,8 +134,8 @@ jobs: runs-on: ubuntu-latest container: alpine:latest steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 - name: Test on Alpine run: sh ./test/run-makeself.sh @@ -137,8 +147,8 @@ jobs: IMAGE_NAME: mcr.microsoft.com/windows/nanoserver:ltsc2022-amd64 steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 - name: pull windows container ${{ env.IMAGE_NAME }} shell: cmd @@ -159,7 +169,7 @@ jobs: steps: - name: Checkout Makeself - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Run ShellCheck uses: megastep/shell-linter@develop with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0ceb269..7df58d4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: run: sudo env DEBIAN_FRONTEND=noninteractive apt-get -qq -y install pbzip2 - name: Checkout Makeself - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build release run: | diff --git a/makeself-header.sh b/makeself-header.sh index 1664465..9464d02 100755 --- a/makeself-header.sh +++ b/makeself-header.sh @@ -68,7 +68,7 @@ MS_PrintLicense() if test x"\$licensetxt" != x; then PAGER_PATH=\`exec <&- 2>&-; which \$PAGER || command -v \$PAGER || type \$PAGER\` if test -x "\$PAGER_PATH" && test x"\$accept" != xy; then - echo "\$licensetxt" | \$PAGER + echo "\$licensetxt" | \$PAGER -e else echo "\$licensetxt" fi @@ -191,6 +191,10 @@ Makeself version $MS_VERSION --cleanup-args args Arguments to the cleanup script. Wrap in quotes to provide multiple arguments. -- Following arguments will be passed to the embedded script\${helpheader} + + ENVIRONMENT + SETUP_NOCHECK + If set to 1, then checksum validation will be skipped. EOH } diff --git a/makeself.1 b/makeself.1 index 392384e..be84973 100644 --- a/makeself.1 +++ b/makeself.1 @@ -140,7 +140,10 @@ Append a license file. .TP .B --packaging-date date Use provided string as the packaging date instead of the current date. +.SH "ENVIRONMENT" .TP +.B SETUP_NOCHECK +If set to 1, then checksum validation will be skipped. .SH "EXAMPLES" Here is an example, assuming the user has a package image stored in a /home/joe/mysoft, and he wants to generate a self-extracting package named mysoft.sh, which will launch diff --git a/makeself.sh b/makeself.sh index aa55dc0..0efcef8 100755 --- a/makeself.sh +++ b/makeself.sh @@ -110,6 +110,10 @@ MS_Usage() echo " --keep-umask : Keep the umask set to shell default, rather than overriding when executing self-extracting archive." echo " --export-conf : Export configuration variables to startup_script" echo + echo "ENVIRONMENT" + echo " SETUP_NOCHECK" + echo " If set to 1, then checksum validation will be skipped." + echo echo "Do not forget to give a fully qualified startup script name" echo "(i.e. with a ./ prefix if inside the archive)." exit 1 @@ -542,8 +546,8 @@ if test x"$ENCRYPT" = x"openssl"; then echo "Appending to existing archive is not compatible with OpenSSL encryption." >&2 fi - ENCRYPT_CMD="openssl enc -aes-256-cbc -salt" - DECRYPT_CMD="openssl enc -aes-256-cbc -d" + ENCRYPT_CMD="openssl enc -aes-256-cbc -salt -pbkdf2" + DECRYPT_CMD="openssl enc -aes-256-cbc -d -salt -pbkdf2" if test x"$OPENSSL_NO_MD" != x"y"; then ENCRYPT_CMD="$ENCRYPT_CMD -md sha256" diff --git a/test/nochecktest b/test/nochecktest new file mode 100755 index 0000000..dd826a7 --- /dev/null +++ b/test/nochecktest @@ -0,0 +1,42 @@ +#!/bin/bash +set -eu +THIS="$(readlink -f "$0")" +THISDIR="$(dirname "${THIS}")" +SUT="$(dirname "${THISDIR}")/makeself.sh" + +testNoCheck() { + # Create a directory with a simple payload. + local archive_dir + archive_dir="$(mktemp -dt archive_dir.XXXXXX)" + ( + cd "${archive_dir}" + touch foo.txt bar.txt qux.txt + ) + + # Create a self-extracting archive. + local file_name + file_name="$(mktemp -t file_name.XXXXXX)" + "${SUT}" --nox11 --sha256 "${archive_dir}" "${file_name}" "no check test" true + assertEquals "$?" 0 + + printf '\nArchive verification enabled:\n' >&2 + sync + "${file_name}" 2>&1 + assertEquals "$?" 0 + + "${file_name}" 2>&1 | grep -qF 'Verifying archive integrity...' + assertEquals "$?" 0 + + printf '\nArchive verification disabled:\n' >&2 + SETUP_NOCHECK=1 "${file_name}" 2>&1 + assertEquals "$?" 0 + + SETUP_NOCHECK=1 "${file_name}" 2>&1 | grep -qFv 'Verifying archive integrity...' + assertEquals "$?" 0 + + # Clean up. + rm -rf "${archive_dir}" "${file_name}" +} + +# Load and run shUnit2. +source "./shunit2/shunit2"