From 9cb6bfc3a4c21850bf3473fbdc7ee512c3412b2d Mon Sep 17 00:00:00 2001 From: Alexandre Quesnel <131881+aquesnel@users.noreply.github.com> Date: Tue, 17 Nov 2020 04:01:19 +0000 Subject: [PATCH 1/3] Fix SSL compiler warning --- common/ssl_calls.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/ssl_calls.c b/common/ssl_calls.c index d1003b8a..f86dc063 100644 --- a/common/ssl_calls.c +++ b/common/ssl_calls.c @@ -720,7 +720,10 @@ ssl_tls_accept(struct ssl_tls *self, long ssl_protocols, DH_free(dh); // ok to free, copied into ctx by SSL_CTX_set_tmp_dh() #if defined(SSL_CTX_set_ecdh_auto) - SSL_CTX_set_ecdh_auto(self->ctx, 1); + if(!SSL_CTX_set_ecdh_auto(self->ctx, 1)) + { + LOG(LOG_LEVEL_WARNING, "TLS ecdh auto failed to be enabled"); + } #endif if (g_strlen(tls_ciphers) > 1) From 353e11caba36b03b8df0160861a0a18dbb1e8781 Mon Sep 17 00:00:00 2001 From: Alexandre Quesnel <131881+aquesnel@users.noreply.github.com> Date: Tue, 17 Nov 2020 05:49:39 +0000 Subject: [PATCH 2/3] Adding CI build using github actions --- .github/workflows/build.yml | 138 ++++++++++++++++++ .../install_cppcheck_dependencies_with_apt.sh | 6 + ...nstall_xrdp_build_dependencies_with_apt.sh | 98 +++++++++++++ 3 files changed, 242 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100755 scripts/install_cppcheck_dependencies_with_apt.sh create mode 100755 scripts/install_xrdp_build_dependencies_with_apt.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..ca4d849b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,138 @@ +name: build and test +on: + push: + branches-ignore: + - "gh-pages" + tags-ignore: + - "v0.[0-8]**" + pull_request: + branches-ignore: + - "gh-pages" + +jobs: + build_and_test: + strategy: + fail-fast: false + matrix: + include: + + # Minimal 64-bit arch builds + - CC: gcc + feature_set: min + arch: amd64 + os: ubuntu-latest + + - CC: g++ + feature_set: min + arch: amd64 + os: ubuntu-latest + + - CC: clang + feature_set: min + arch: amd64 + os: ubuntu-latest + + # Maximal 64-bit arch builds + - CC: gcc + feature_set: max + arch: amd64 + os: ubuntu-latest + DISTCHECK: true + + - CC: g++ + feature_set: max + arch: amd64 + os: ubuntu-latest + DISTCHECK: true + + - CC: clang + feature_set: max + arch: amd64 + os: ubuntu-latest + DISTCHECK: true + + # Maximal debug 64-bit arch builds + - CC: gcc + feature_set: max + arch: amd64 + os: ubuntu-latest + name_extra: and DEBUG + CONF_FLAGS_EXTRA: "--enable-xrdpdebug" + + # Maximal 32-bit arch builds + - CC: gcc + feature_set: max + arch: i386 + os: ubuntu-16.04 + name_extra: for 32-bit arch (legacy OS) + + - CC: g++ + feature_set: max + arch: i386 + os: ubuntu-16.04 + name_extra: for 32-bit arch (legacy OS) + + - CC: clang + feature_set: max + arch: i386 + os: ubuntu-16.04 + name_extra: for 32-bit arch (legacy OS) + + name: ${{ matrix.feature_set }} features with ${{ matrix.CC }} ${{ matrix.name_extra }} + runs-on: ${{ matrix.os }} + env: + CC: ${{ matrix.CC }} + + # HACK (2020-11-16): github actions dosen't support YAML anchors/aliases to + # avoid repeating long config values. So instead the config values are defined + # as environment variables using a naming convention with fields that come from + # the job config. These environment variables are then referenced as regualr + # environment variables via the naming convention in the "define env" step to + # define the stardard environment variable used in the rest of the steps. + CONF_FLAGS_amd64_min: "--disable-ipv6 --disable-jpeg --disable-fuse --disable-mp3lame + --disable-fdkaac --disable-opus --disable-rfxcodec --disable-painter + --disable-pixman" + CONF_FLAGS_amd64_max: "--enable-ipv6 --enable-jpeg --enable-fuse --enable-mp3lame + --enable-fdkaac --enable-opus --enable-rfxcodec --enable-painter + --enable-pixman" + CONF_FLAGS_i386_max: "--enable-ipv6 --enable-jpeg --enable-fuse --enable-mp3lame + --enable-fdkaac --enable-opus --enable-rfxcodec --enable-painter + --disable-pixman --host=i686-linux" + + PKG_CONFIG_PATH_i386: "/usr/lib/i386-linux-gnu/pkgconfig" + CFLAGS_i386: "-m32" + LDFLAGS_i386: "-m32" + steps: + - name: Define feature and arch dependent environment variables + # Note: any "variable=value" written to the $GITHUB_ENV file will be + # defined as an environment variable for all future steps in this job + # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable + run: | + echo "CONF_FLAGS=$CONF_FLAGS_${{ matrix.arch }}_${{ matrix.feature_set }} ${{ matrix.CONF_FLAGS_EXTRA }}" >> $GITHUB_ENV + echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH_${{ matrix.arch }}" >> $GITHUB_ENV + echo "CFLAGS=$CFLAGS_${{ matrix.arch }}" >> $GITHUB_ENV + echo "LDFLAGS=$LDFLAGS_${{ matrix.arch }}" >> $GITHUB_ENV + - uses: actions/checkout@v2 + - run: sudo scripts/install_xrdp_build_dependencies_with_apt.sh ${{ matrix.feature_set }} ${{ matrix.arch }} --allow-downgrades --allow-remove-essential --allow-change-held-packages + - run: ./bootstrap + - run: ./configure $CONF_FLAGS + - run: make + - if: ${{ matrix.DISTCHECK }} + run: make distcheck + + cppcheck: + name: cppcheck + runs-on: ubuntu-latest + env: + CC: gcc + # This is required to use a version of cppcheck other than that + # suplied with the operating system + CPPCHECK_VER: 2.1 + CPPCHECK_REPO: https://github.com/danmar/cppcheck.git + steps: + - uses: actions/checkout@v2 + - run: sudo scripts/install_cppcheck_dependencies_with_apt.sh + - run: ./bootstrap + - run: scripts/install_cppcheck.sh $CPPCHECK_REPO $CPPCHECK_VER + - run: scripts/run_cppcheck.sh -v $CPPCHECK_VER + \ No newline at end of file diff --git a/scripts/install_cppcheck_dependencies_with_apt.sh b/scripts/install_cppcheck_dependencies_with_apt.sh new file mode 100755 index 00000000..4d91b5e9 --- /dev/null +++ b/scripts/install_cppcheck_dependencies_with_apt.sh @@ -0,0 +1,6 @@ +#!/bin/sh +set -eufx + +PACKAGES="libz3-dev z3" + +apt-get -yq --no-install-suggests --no-install-recommends install $PACKAGES diff --git a/scripts/install_xrdp_build_dependencies_with_apt.sh b/scripts/install_xrdp_build_dependencies_with_apt.sh new file mode 100755 index 00000000..62ba39b5 --- /dev/null +++ b/scripts/install_xrdp_build_dependencies_with_apt.sh @@ -0,0 +1,98 @@ +#!/bin/sh +set -eufx + +FEATURE_SET="$1" +ARCH="$2" +shift +shift +APT_EXTRA_ARGS="$@" + +if [ -z "$FEATURE_SET" ]; then + FEATURE_SET=min +fi + +if [ -z "$ARCH" ]; then + ARCH=amd64 +fi + + +# common build tools for all architectures and feature sets +PACKAGES=" \ + autoconf \ + automake \ + clang \ + gcc \ + g++ \ + libtool \ + make \ + nasm \ + pkg-config\ + " + +case "$ARCH" +in + amd64) + PACKAGES_AMD64_MIN=" \ + libpam0g-dev \ + libssl-dev \ + libx11-dev \ + libxrandr-dev \ + libxfixes-dev" + + case "$FEATURE_SET" + in + min) + PACKAGES="$PACKAGES $PACKAGES_AMD64_MIN" + ;; + max) + PACKAGES="$PACKAGES \ + $PACKAGES_AMD64_MIN + libfuse-dev \ + libjpeg-dev \ + libmp3lame-dev \ + libfdk-aac-dev \ + libopus-dev \ + libpixman-1-dev" + ;; + *) + echo "unsupported feature set: $FEATURE_SET" + exit 1; + ;; + esac + ;; + i386) + PACKAGES="$PACKAGES \ + g++-multilib \ + gcc-multilib \ + libgl1-mesa-dev:i386 \ + libglu1-mesa-dev:i386 \ + libjpeg-dev:i386 \ + libmp3lame-dev:i386 \ + libfdk-aac-dev:i386 \ + libopus-dev:i386 \ + libpam0g-dev:i386 \ + libssl-dev:i386 \ + libx11-dev:i386 \ + libxext-dev:i386 \ + libxfixes-dev:i386 \ + libxrandr-dev:i386 \ + libxrender-dev:i386 \ + openssl:i386 \ + libfuse-dev:i386" + + dpkg --add-architecture i386 + dpkg --print-architecture + dpkg --print-foreign-architectures + apt-get update + ;; + *) + echo "unsupported architecture: $ARCH" + exit 1; + ;; +esac + +apt-get -yq \ + --no-install-suggests \ + --no-install-recommends \ + $APT_EXTRA_ARGS \ + install $PACKAGES From a4cc8471ecf9bdd6d7662637cc2ee74ec2bb377b Mon Sep 17 00:00:00 2001 From: Alexandre Quesnel <131881+aquesnel@users.noreply.github.com> Date: Thu, 19 Nov 2020 15:21:42 +0000 Subject: [PATCH 3/3] Removing TravisCI builds --- .travis.yml | 172 ---------------------------------------------------- 1 file changed, 172 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1174c98b..00000000 --- a/.travis.yml +++ /dev/null @@ -1,172 +0,0 @@ -sudo: false # use new container -language: c -dist: focal - -branches: - except: /^(gh-pages|v0\.[0-8].*)/ - -addons: - apt: - packages: &common_deps - - nasm - -# This is required to use a version of cppcheck other than that -# suplied with the operating system -cppcheck_defs: &cppcheck_defs - - CPPCHECK_VER=2.1 - - CPPCHECK_REPO=https://github.com/danmar/cppcheck.git - -min_amd64_deps: &min_amd64_deps - - *common_deps - - libpam0g-dev - - libssl-dev - - libx11-dev - - libxrandr-dev - - libxfixes-dev - -min_amd64_conf: &min_amd64_conf - env: - - CONF_FLAGS="--disable-ipv6 --disable-jpeg --disable-fuse --disable-mp3lame - --disable-fdkaac --disable-opus --disable-rfxcodec --disable-painter - --disable-pixman" - addons: - apt: - packages: - - *min_amd64_deps - -max_amd64_deps: &max_amd64_deps - - *min_amd64_deps - - libfuse-dev - - libjpeg-dev - - libmp3lame-dev - - libfdk-aac-dev - - libopus-dev - - libpixman-1-dev - -max_amd64_conf: &max_amd64_conf - env: - - CONF_FLAGS="--enable-ipv6 --enable-jpeg --enable-fuse --enable-mp3lame - --enable-fdkaac --enable-opus --enable-rfxcodec --enable-painter - --enable-pixman" - - DISTCHECK=1 - addons: - apt: - packages: - - *max_amd64_deps - -max_debug_amd64_conf: &max_debug_amd64_conf - env: - - CONF_FLAGS="--enable-ipv6 --enable-jpeg --enable-fuse --enable-mp3lame - --enable-fdkaac --enable-opus --enable-rfxcodec --enable-painter - --enable-pixman --enable-xrdpdebug" - - DISTCHECK=1 - addons: - apt: - packages: - - *max_amd64_deps - -max_x86_deps: &max_x86_deps - - *common_deps - - g++-multilib - - gcc-multilib - - libgl1-mesa-dev:i386 - - libglu1-mesa-dev:i386 - - libjpeg-dev:i386 - - libmp3lame-dev:i386 - - libfdk-aac-dev:i386 - - libopus-dev:i386 - - libpam0g-dev:i386 - - libssl-dev:i386 - - libx11-dev:i386 - - libxext-dev:i386 - - libxfixes-dev:i386 - - libxrandr-dev:i386 - - libxrender-dev:i386 - - openssl:i386 - - libfuse-dev:i386 - -# No --enable-pixman to allow testing the replacement code -max_x86_conf: &max_x86_conf - env: - - CONF_FLAGS="--enable-ipv6 --enable-jpeg --enable-fuse --enable-mp3lame - --enable-fdkaac --enable-opus --enable-rfxcodec --enable-painter - --disable-pixman --host=i686-linux" - - PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig - - CFLAGS="-m32" - - LDFLAGS="-m32" - addons: - apt: - packages: - - *max_x86_deps - -# For cppcheck, we've got a custom script -cppcheck_conf: &cppcheck_conf - env: - - *cppcheck_defs - - addons: - apt: - packages: - - libz3-dev - - z3 - - script: - - ./bootstrap - - scripts/install_cppcheck.sh $CPPCHECK_REPO $CPPCHECK_VER - - scripts/run_cppcheck.sh -v $CPPCHECK_VER - - -matrix: - include: - - # Minimal 64-bit arch build - - name: Min features with GCC - compiler: gcc - << : *min_amd64_conf - - name: Min features with G++ - compiler: g++ - << : *min_amd64_conf - - name: Min features with Clang - compiler: clang - << : *min_amd64_conf - - # Maximal 64-bit arch build - - name: Max features with GCC - compiler: gcc - << : *max_amd64_conf - - name: Max features with G++ - compiler: g++ - << : *max_amd64_conf - - name: Max features with Clang - compiler: clang - << : *max_amd64_conf - - # Maximal debug 64-bit arch build - - name: Max debug feature with GCC - compiler: gcc - << : *max_debug_amd64_conf - - # Maximal 32-bit arch build - - name: Max features for 32-bit arch with GCC (legacy OS) - compiler: gcc - dist: xenial - << : *max_x86_conf - - name: Max features for 32-bit arch with G++ (legacy OS) - compiler: g++ - dist: xenial - << : *max_x86_conf - - name: Max features for 32-bit arch with Clang (legacy OS) - compiler: clang - dist: xenial - << : *max_x86_conf - - # cppcheck - - name: cppcheck - compiler: gcc - << : *cppcheck_conf - -script: - - ./bootstrap - - ./configure $CONF_FLAGS - - make - - test -z "$DISTCHECK" || make distcheck