[SCM] Priv Wrapper Repository - branch main updated

Andreas Schneider asn at samba.org
Fri Oct 21 08:44:22 UTC 2022


The branch, main has been updated
       via  143d857 Update manpage for pledge()
       via  bd66658 Add pledge() unit test
       via  e08c01b Add pledge() wrapper for OpenBSD
       via  5cf450a Fix failing test on OpenBSD
       via  e454230 gitlab-ci: Enable freebsd runner
       via  9923ce2 tests: Fix test_chroot on FreeBSD
       via  c549133 tests: Fix test_setrlimit fsize on FreeBSD
       via  54c6411 tests: Fix test_setrlimit combination test on FreeBSD
       via  802b34f tests: Only add prctl test if we have support for it
       via  fadc2aa pwrap: Fix setrlmit() on FreeBSD
       via  459e70f cmake: Check setrlimit() prototype
       via  890afc2 tests: Fix linking with cmocka
       via  1894547 Fix 'doc/priv_wrapper.1' and use 'asciidoctor -b manpage doc/priv_wrapper.1.txt' to generate the manpage
       via  56361ed Fix install dirs to use CMAKE_INSTALL
       via  2744c79 DO_NOT_SANITIZE_ADDRESS_ATTRIBUTE
       via  776eb25 Add pwrap_bind_symbol_all()
       via  f77e532 Uncomment: "-Wcast-qual" SUPPORTED_COMPILER_FLAGS
       via  6cbd674 add_library(defaults INTERFACE) instead of DEFAULT_C_COMPILE_FLAGS
       via  1d0b4e8 Add PRIV_WRAPPER_DISABLE_DEEPBIND
       via  4a311a1 Sync with socket_wrapper: tests/CMakeLists.txt
       via  60d109b DefineInstallationPaths -> GNUInstallDirs
       via  ca8968c Sync with socket_wrapper: CompilerChecks.cmake
       via  71c6267 GitLab CI: limit commit history: ~20 -> ~10
       via  bccc0d2 Add gitlab CI
       via  c5f9448 Add test_setrlimit
       via  f32f546 Add test_prctl
       via  44d5961 Add test_chroot
       via  4b7d444 Howto: Steps to run unit tests
       via  178390f Add comments explaining the behavior of some prctl options
       via  ebf1e48 doc: Update manpage source priv_wrapper.1.txt and generate the manpage via "a2x --format manpage doc/priv_wrapper.1.txt"
       via  d15f812 Update date in priv_wrapper.1*
       via  0999243 AUTHORS
       via  7be9bd1 Add editorconfig
       via  6cab6b4 Fix initial commit: Remove priv_handle
       via  d4b267e Fix initial commit: !priv_wrapper_enabled() in privwrap_setrlimit()
       via  752fcb0 Fix initial commit: s/HAVE_PRCTL/HAVE_SETRLIMIT/
       via  b3f924d Fix initial commit: Rename various 'socket' based names to 'priv'.
      from  136d774 Big bang!

https://git.samba.org/?p=priv_wrapper.git;a=shortlog;h=main


- Log -----------------------------------------------------------------
commit 143d857043c2e37553267bf3b0cbd2200f561fd5
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Wed Sep 14 11:50:05 2022 +0200

    Update manpage for pledge()
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit bd66658e70faf3f06df7e98a6d64fe234c9a48f9
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Wed Sep 14 11:40:47 2022 +0200

    Add pledge() unit test
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit e08c01b7dacc45a89ccccd5475497d09c36a9480
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Wed Sep 14 09:16:57 2022 +0200

    Add pledge() wrapper for OpenBSD
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 5cf450afd33748eb8fbbff325271aa40ca6be641
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Wed Sep 14 09:21:55 2022 +0200

    Fix failing test on OpenBSD
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit e4542305d402d19fca3b0fb246fef5b4a815e388
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Sep 12 08:44:24 2022 +0200

    gitlab-ci: Enable freebsd runner
    
    Signed-off-by: Andreas Schneider <asn at cryptomilk.org>
    Reviewed-by: Pavel Filipenský <pfilipensky at samba.org>

commit 9923ce23bc4022b4aec0cafe420ea7082aeaa88b
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Sep 12 10:02:36 2022 +0200

    tests: Fix test_chroot on FreeBSD
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Pavel Filipenský <pfilipensky at samba.org>

commit c5491333d6800d84765e27277a55b7837e354dd5
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Sep 12 10:06:25 2022 +0200

    tests: Fix test_setrlimit fsize on FreeBSD
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Pavel Filipenský <pfilipensky at samba.org>

commit 54c64112ad55e32d7210ed51253b1e8dc3f03f8c
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Sep 12 09:09:33 2022 +0200

    tests: Fix test_setrlimit combination test on FreeBSD
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Pavel Filipenský <pfilipensky at samba.org>

commit 802b34f6f4c7f053c52f8cc0015ee4c4eb05ff4f
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Sep 12 09:03:14 2022 +0200

    tests: Only add prctl test if we have support for it
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Pavel Filipenský <pfilipensky at samba.org>

commit fadc2aa43d23c6594da2e92b034bf8edf6829595
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Sep 12 08:43:53 2022 +0200

    pwrap: Fix setrlmit() on FreeBSD
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Pavel Filipenský <pfilipensky at samba.org>

commit 459e70fca6d752641b2b8bd592a74a7ea03b91d0
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Sep 12 08:43:46 2022 +0200

    cmake: Check setrlimit() prototype
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Pavel Filipenský <pfilipensky at samba.org>

commit 890afc2b484bab2b04b0a6100b74c03f646466b0
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Sep 12 09:12:58 2022 +0200

    tests: Fix linking with cmocka
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Pavel Filipenský <pfilipensky at samba.org>

commit 18945473cc5925238e889a5d5fd5d6de008ebacc
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Mon Sep 12 11:52:10 2022 +0200

    Fix 'doc/priv_wrapper.1' and use 'asciidoctor -b manpage doc/priv_wrapper.1.txt' to generate the manpage
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 56361ed560815cbbc60e067a11c8ca5b8627e3af
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Mon Sep 12 11:41:05 2022 +0200

    Fix install dirs to use CMAKE_INSTALL
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 2744c79d45e6d37c8f3f604124ae55dfba22896f
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Fri Sep 9 10:57:02 2022 +0200

    DO_NOT_SANITIZE_ADDRESS_ATTRIBUTE
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 776eb25057dd661d13efc518164d035860f0e809
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Fri Sep 9 14:48:51 2022 +0200

    Add pwrap_bind_symbol_all()
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit f77e53203ef2b71f9fffe7bbdf23f50908f3c01c
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Fri Sep 9 11:38:00 2022 +0200

    Uncomment: "-Wcast-qual" SUPPORTED_COMPILER_FLAGS
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 6cbd674e4de82b65a30a20dcfb860b149bf26a12
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Fri Sep 9 10:43:25 2022 +0200

    add_library(defaults INTERFACE) instead of DEFAULT_C_COMPILE_FLAGS
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 1d0b4e8e572eede733f8d63a7cef5555383a3766
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Fri Sep 9 11:04:18 2022 +0200

    Add PRIV_WRAPPER_DISABLE_DEEPBIND
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 4a311a16dde695e1b848efd942908f97aa508602
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Wed Sep 7 10:15:54 2022 +0200

    Sync with socket_wrapper: tests/CMakeLists.txt
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 60d109b8281d37690bc85cec8099458737bae36f
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Wed Sep 7 08:27:16 2022 +0200

    DefineInstallationPaths -> GNUInstallDirs
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit ca8968c6671472c8a71269d2adbce8baf38c0497
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Wed Sep 7 10:09:06 2022 +0200

    Sync with socket_wrapper: CompilerChecks.cmake
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 71c62671a12774fd49d08e2445fac00b8c539701
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Fri Sep 9 09:37:50 2022 +0200

    GitLab CI: limit commit history: ~20 -> ~10
    
    Fix fedora/csbuild:
    /usr/bin/csbuild: fatal error: pathspec 'f1dea519a459b21e1616fb1d2c620c72f8c07714~20' did not match any file(s) known to git
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit bccc0d26f949f6b4807f28dac1c0368ea2ece82a
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Mon Sep 5 13:45:19 2022 +0200

    Add gitlab CI
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit c5f9448cd0e04f4881c882a2bc8e47cbce4c7dca
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Thu Sep 1 12:59:57 2022 +0200

    Add test_setrlimit
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit f32f546c15e49ad2fd94404b519a39b840879690
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Wed Aug 31 15:41:57 2022 +0200

    Add test_prctl
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 44d5961d202f4dbb661d1904569ad9d6116ab617
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Wed Aug 31 13:35:05 2022 +0200

    Add test_chroot
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 4b7d44485785aacc881aef0ee1bc4cba66048f98
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Wed Aug 31 16:56:34 2022 +0200

    Howto: Steps to run unit tests
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 178390f4f66bab4afc9c96d343d9ee18485e98d9
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Thu Sep 1 14:53:22 2022 +0200

    Add comments explaining the behavior of some prctl options
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit ebf1e48eb05ca01c6046ed500cb82ec32e7ee1d0
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Fri Sep 2 15:09:28 2022 +0200

    doc: Update manpage source priv_wrapper.1.txt and generate the manpage via "a2x --format manpage doc/priv_wrapper.1.txt"
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit d15f81256be5314b09ff242f6cba685ea990f319
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Mon Sep 5 13:59:39 2022 +0200

    Update date in priv_wrapper.1*
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 0999243f03ec6ea9796d541c41814813aca4c70c
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Wed Sep 7 10:09:06 2022 +0200

    AUTHORS
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 7be9bd143dd00cb45783e90c2148bc0dd6ec11b8
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Wed Aug 31 15:06:29 2022 +0200

    Add editorconfig
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 6cab6b410331d7f4447ff2353c3b34d0c236fe72
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Fri Sep 9 11:03:40 2022 +0200

    Fix initial commit: Remove priv_handle
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit d4b267ed81a08ea80f9c763ee7a0b3219d6e2da1
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Thu Sep 1 12:59:57 2022 +0200

    Fix initial commit: !priv_wrapper_enabled() in privwrap_setrlimit()
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 752fcb0d16ce52f3f34402f3535ba536573d34a0
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Wed Aug 31 21:46:24 2022 +0200

    Fix initial commit: s/HAVE_PRCTL/HAVE_SETRLIMIT/
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit b3f924d3aeef5af3f564bc0bb740c9cb60c59685
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Mon Aug 29 14:34:30 2022 +0200

    Fix initial commit: Rename various 'socket' based names to 'priv'.
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 .editorconfig                               |  23 +++
 .gitlab-ci.yml                              | 266 ++++++++++++++++++++++++++++
 AUTHORS                                     |   1 +
 CMakeLists.txt                              |  25 +--
 CTestConfig.cmake                           |   2 +-
 CompilerChecks.cmake                        |  47 ++---
 ConfigureChecks.cmake                       |  17 +-
 README.install                              |   2 +-
 README.md                                   |  10 ++
 cmake/Modules/DefineInstallationPaths.cmake | 109 ------------
 config.h.cmake                              |  13 +-
 doc/CMakeLists.txt                          |   4 +-
 doc/priv_wrapper.1                          | 156 +++++++++-------
 doc/priv_wrapper.1.txt                      |  58 +++++-
 priv_wrapper-config.cmake.in                |   2 +-
 priv_wrapper.pc.cmake                       |   4 +-
 src/CMakeLists.txt                          |  26 ++-
 src/priv_wrapper.c                          | 120 +++++++++++--
 tests/CMakeLists.txt                        |  71 ++++++++
 tests/test_chroot.c                         |  57 ++++++
 tests/test_pledge.c                         |  59 ++++++
 tests/test_prctl.c                          | 138 +++++++++++++++
 tests/test_setrlimit.c                      | 164 +++++++++++++++++
 23 files changed, 1107 insertions(+), 267 deletions(-)
 create mode 100644 .editorconfig
 create mode 100644 .gitlab-ci.yml
 delete mode 100644 cmake/Modules/DefineInstallationPaths.cmake
 create mode 100644 tests/CMakeLists.txt
 create mode 100644 tests/test_chroot.c
 create mode 100644 tests/test_pledge.c
 create mode 100644 tests/test_prctl.c
 create mode 100644 tests/test_setrlimit.c


Changeset truncated at 500 lines:

diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..bbe1bd5
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,23 @@
+root = true
+
+[*]
+charset = utf-8
+max_line_length = 80
+end_of_line = lf
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[*.{c,h}]
+indent_style = tab
+indent_size = 8
+tab_width = 8
+
+[*.cmake]
+indent_style = space
+indent_size = 4
+tab_width = 4
+
+[CMake*]
+indent_style = space
+indent_size = 4
+tab_width = 4
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..50825de
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,266 @@
+---
+variables:
+  BUILD_IMAGES_PROJECT: cmocka/gitlab-build-images
+  FEDORA_BUILD: buildenv-fedora
+  CENTOS7_BUILD: buildenv-centos7
+  TUMBLEWEED_BUILD: buildenv-tumbleweed
+  MINGW_BUILD: buildenv-mingw
+  UBUNTU_BUILD: buildenv-ubuntu
+
+stages:
+  - build
+  - test
+  - analysis
+
+centos7/x86_64:
+  stage: test
+  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$CENTOS7_BUILD
+  script:
+    - mkdir -p obj && cd obj && cmake3
+      -DCMAKE_BUILD_TYPE=RelWithDebInfo
+      -DPICKY_DEVELOPER=ON
+      -DUNIT_TESTING=ON .. &&
+      make -j$(nproc) && ctest --output-on-failure
+  tags:
+    - shared
+  except:
+    - tags
+  artifacts:
+    expire_in: 1 week
+    when: on_failure
+    paths:
+      - obj/
+
+fedora/x86_64:
+  stage: test
+  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
+  script:
+    - mkdir -p obj && cd obj && cmake
+      -DCMAKE_BUILD_TYPE=RelWithDebInfo
+      -DPICKY_DEVELOPER=ON
+      -DUNIT_TESTING=ON .. &&
+      make -j$(nproc) && ctest --output-on-failure
+  tags:
+    - shared
+  except:
+    - tags
+  artifacts:
+    expire_in: 1 week
+    when: on_failure
+    paths:
+      - obj/
+
+fedora/address-sanitizer:
+  stage: build
+  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
+  script:
+    - mkdir -p obj && cd obj && cmake
+      -DCMAKE_BUILD_TYPE=AddressSanitizer
+      -DPICKY_DEVELOPER=ON
+      -DUNIT_TESTING=ON .. &&
+      make -j$(nproc) && ctest --output-on-failure
+  tags:
+    - shared
+  except:
+    - tags
+  artifacts:
+    expire_in: 1 week
+    when: on_failure
+    paths:
+      - obj/
+
+fedora/undefined-sanitizer:
+  stage: analysis
+  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
+  script:
+    - mkdir -p obj && cd obj && cmake
+      -DCMAKE_BUILD_TYPE=UndefinedSanitizer
+      -DUNIT_TESTING=ON ..
+      && make -j$(nproc) && ctest --output-on-failure
+  tags:
+    - shared
+  except:
+    - tags
+  artifacts:
+    expire_in: 1 week
+    when: on_failure
+    paths:
+      - obj/
+
+fedora/csbuild:
+  stage: analysis
+  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
+  script:
+    - |
+      if [[ -z "$CI_COMMIT_BEFORE_SHA" ]]; then
+          export CI_COMMIT_BEFORE_SHA=$(git rev-parse "${CI_COMMIT_SHA}~10")
+      fi
+
+      # Check if the commit exists in this branch
+      # This is not the case for a force push
+      git branch --contains $CI_COMMIT_BEFORE_SHA 2>/dev/null ||
+        export CI_COMMIT_BEFORE_SHA=$(git rev-parse "${CI_COMMIT_SHA}~10")
+
+      export CI_COMMIT_RANGE="$CI_COMMIT_BEFORE_SHA..$CI_COMMIT_SHA"
+
+    - csbuild
+      --build-dir=obj-csbuild
+      --prep-cmd="cmake -DCMAKE_BUILD_TYPE=Debug -DPICKY_DEVELOPER=ON -DUNIT_TESTING=ON @SRCDIR@"
+      --build-cmd "make clean && make -j$(nproc)"
+      --git-commit-range $CI_COMMIT_RANGE
+      --color
+      --print-current --print-fixed
+  tags:
+    - shared
+  except:
+    - tags
+  artifacts:
+    expire_in: 1 week
+    when: on_failure
+    paths:
+      - obj-csbuild/
+
+freebsd/x86_64:
+  stage: test
+  image:
+  script:
+    - mkdir -p obj && cd obj && cmake
+      -DCMAKE_BUILD_TYPE=RelWithDebInfo
+      -DPICKY_DEVELOPER=ON
+      -DUNIT_TESTING=ON .. &&
+      make && ctest --output-on-failure
+  tags:
+    - freebsd
+  except:
+    - tags
+  only:
+    - branches at cwrap/priv_wrapper
+    - branches at cryptomilk/priv_wrapper
+  artifacts:
+    expire_in: 1 week
+    when: on_failure
+    paths:
+      - obj/
+
+tumbleweed/x86_64/gcc:
+  stage: test
+  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$TUMBLEWEED_BUILD
+  script:
+    - mkdir -p obj && cd obj && cmake
+      -DCMAKE_BUILD_TYPE=RelWithDebInfo
+      -DPICKY_DEVELOPER=ON
+      -DUNIT_TESTING=ON .. &&
+      make -j$(nproc) && ctest --output-on-failure
+  tags:
+    - shared
+  except:
+    - tags
+  artifacts:
+    expire_in: 1 week
+    when: on_failure
+    paths:
+      - obj/
+
+tumbleweed/x86_64/gcc7:
+  stage: test
+  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$TUMBLEWEED_BUILD
+  script:
+    - mkdir -p obj && cd obj && cmake
+      -DCMAKE_C_COMPILER=gcc-7 -DCMAKE_CXX_COMPILER=g++-7
+      -DCMAKE_BUILD_TYPE=RelWithDebInfo
+      -DPICKY_DEVELOPER=ON
+      -DUNIT_TESTING=ON .. &&
+      make -j$(nproc) && ctest --output-on-failure
+  tags:
+    - shared
+  except:
+    - tags
+  artifacts:
+    expire_in: 1 week
+    when: on_failure
+    paths:
+      - obj/
+
+tumbleweed/x86_64/clang:
+  stage: test
+  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$TUMBLEWEED_BUILD
+  script:
+    - mkdir -p obj && cd obj && cmake
+      -DCMAKE_BUILD_TYPE=RelWithDebInfo
+      -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
+      -DPICKY_DEVELOPER=ON
+      -DUNIT_TESTING=ON .. &&
+      make -j$(nproc) && ctest --output-on-failure
+  tags:
+    - shared
+  except:
+    - tags
+  artifacts:
+    expire_in: 1 week
+    when: on_failure
+    paths:
+      - obj/
+
+tumbleweed/static-analysis:
+  stage: analysis
+  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$TUMBLEWEED_BUILD
+  script:
+    - export CCC_CC=clang
+    - export CCC_CXX=clang++
+    - mkdir -p obj && cd obj && scan-build cmake
+      -DCMAKE_BUILD_TYPE=Debug
+      -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
+      -DPICKY_DEVELOPER=ON
+      -DUNIT_TESTING=ON .. &&
+      scan-build --status-bugs -o scan make -j$(nproc)
+  tags:
+    - shared
+  except:
+    - tags
+  artifacts:
+    expire_in: 1 week
+    when: on_failure
+    paths:
+      - obj/scan
+
+tumbleweed/helgrind:
+  stage: analysis
+  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$TUMBLEWEED_BUILD
+  script:
+    - mkdir -p obj && cd obj && cmake
+      -DCMAKE_BUILD_TYPE=Debug
+      -DPICKY_DEVELOPER=ON
+      -DUNIT_TESTING=ON
+      -DHELGRIND_TESTING=ON .. &&
+      make -j$(nproc) && ctest --output-on-failure
+  tags:
+    - shared
+  except:
+    - tags
+  artifacts:
+    expire_in: 1 week
+    when: on_failure
+    paths:
+      - obj/
+  only:
+    variables:
+      - $VALGRIND_SUPPORTS_FORKED_MUTEXES == "yes"
+
+ubuntu/x86_64:
+  stage: test
+  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$UBUNTU_BUILD
+  script:
+    - mkdir -p obj && cd obj && cmake
+      -DCMAKE_BUILD_TYPE=RelWithDebInfo
+      -DPICKY_DEVELOPER=ON
+      -DUNIT_TESTING=ON .. &&
+      make -j$(nproc) && ctest --output-on-failure
+  tags:
+    - shared
+  except:
+    - tags
+  artifacts:
+    expire_in: 1 week
+    when: on_failure
+    paths:
+      - obj/
diff --git a/AUTHORS b/AUTHORS
index edb1a15..2b85b50 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,2 +1,3 @@
 Andreas Schneider <asn at samba.org>
 Nikos Mavrogiannopoulos
+Pavel Filipenský <pfilipensky at samba.org>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fb6217c..9f3cda0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,7 +2,7 @@
 cmake_minimum_required(VERSION 3.5.0)
 cmake_policy(SET CMP0048 NEW)
 
-# Specify search path for CMake modules to be loaded by include() 
+# Specify search path for CMake modules to be loaded by include()
 # and find_package()
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
 
@@ -11,27 +11,30 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
 include(DefineCMakeDefaults)
 include(DefineCompilerFlags)
 
-project(priv_wrapper VERSION 1.1.9 LANGUAGES C)
+project(priv_wrapper VERSION 0.0.0 LANGUAGES C)
 
 # global needed variables
 set(APPLICATION_NAME ${PROJECT_NAME})
 
-# SOVERSION scheme: CURRENT.AGE.REVISION
+# SOVERSION scheme: MAJOR.MINOR.PATCH
 #   If there was an incompatible interface change:
-#     Increment CURRENT. Set AGE and REVISION to 0
+#     Increment MAJOR. Set MINOR and PATCH to 0
 #   If there was a compatible interface change:
-#     Increment AGE. Set REVISION to 0
+#     Increment MINOR. Set PATCH to 0
 #   If the source code was changed, but there were no interface changes:
-#     Increment REVISION.
-set(LIBRARY_VERSION "0.1.9")
-set(LIBRARY_SOVERSION "0")
+#     Increment PATCH.
+set(LIBRARY_VERSION_MAJOR 0)
+set(LIBRARY_VERSION_MINOR 0)
+set(LIBRARY_VERSION_PATCH 0)
+set(LIBRARY_VERSION "${LIBRARY_VERSION_MAJOR}.${LIBRARY_VERSION_MINOR}.${LIBRARY_VERSION_PATCH}")
+set(LIBRARY_SOVERSION ${LIBRARY_VERSION_MAJOR})
 
 # add definitions
 include(DefinePlatformDefaults)
-include(DefineInstallationPaths)
 include(DefineOptions.cmake)
 include(CPackConfig.cmake)
 include(CompilerChecks.cmake)
+include(GNUInstallDirs)
 
 # disallow in-source build
 include(MacroEnsureOutOfSourceBuild)
@@ -63,7 +66,7 @@ install(
   FILES
     ${CMAKE_CURRENT_BINARY_DIR}/priv_wrapper.pc
   DESTINATION
-    ${LIB_INSTALL_DIR}/pkgconfig
+      ${CMAKE_INSTALL_LIBDIR}/pkgconfig
   COMPONENT
     pkgconfig
 )
@@ -76,7 +79,7 @@ install(
         ${CMAKE_CURRENT_BINARY_DIR}/priv_wrapper-config-version.cmake
         ${CMAKE_CURRENT_BINARY_DIR}/priv_wrapper-config.cmake
     DESTINATION
-        ${CMAKE_INSTALL_DIR}/priv_wrapper
+        ${CMAKE_INSTALL_LIBDIR}/cmake/priv_wrapper
     COMPONENT
         devel
 )
diff --git a/CTestConfig.cmake b/CTestConfig.cmake
index 0f4e9aa..92ad1b3 100644
--- a/CTestConfig.cmake
+++ b/CTestConfig.cmake
@@ -1,6 +1,6 @@
 set(UPDATE_TYPE "true")
 
-set(CTEST_PROJECT_NAME "socket_wrapper")
+set(CTEST_PROJECT_NAME "priv_wrapper")
 set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
 
 set(CTEST_DROP_METHOD "https")
diff --git a/CompilerChecks.cmake b/CompilerChecks.cmake
index f5a3c7f..7bc46f5 100644
--- a/CompilerChecks.cmake
+++ b/CompilerChecks.cmake
@@ -22,7 +22,7 @@ if (UNIX)
     add_c_compiler_flag("-Wshadow" SUPPORTED_COMPILER_FLAGS)
     add_c_compiler_flag("-Wmissing-prototypes" SUPPORTED_COMPILER_FLAGS)
     add_c_compiler_flag("-Wcast-align" SUPPORTED_COMPILER_FLAGS)
-    #add_c_compiler_flag("-Wcast-qual" SUPPORTED_COMPILER_FLAGS)
+    add_c_compiler_flag("-Wcast-qual" SUPPORTED_COMPILER_FLAGS)
     add_c_compiler_flag("-Werror=address" SUPPORTED_COMPILER_FLAGS)
     add_c_compiler_flag("-Wstrict-prototypes" SUPPORTED_COMPILER_FLAGS)
     add_c_compiler_flag("-Werror=strict-prototypes" SUPPORTED_COMPILER_FLAGS)
@@ -65,27 +65,29 @@ if (UNIX)
         endif()
     endif()
 
-    check_c_compiler_flag_ssp("-fstack-protector-strong" WITH_STACK_PROTECTOR_STRONG)
-    if (WITH_STACK_PROTECTOR_STRONG)
-        list(APPEND SUPPORTED_COMPILER_FLAGS "-fstack-protector-strong")
-        # This is needed as Solaris has a seperate libssp
-        if (SOLARIS)
-            list(APPEND SUPPORTED_LINKER_FLAGS "-fstack-protector-strong")
-        endif()
-    else (WITH_STACK_PROTECTOR_STRONG)
-        check_c_compiler_flag_ssp("-fstack-protector" WITH_STACK_PROTECTOR)
-        if (WITH_STACK_PROTECTOR)
-            list(APPEND SUPPORTED_COMPILER_FLAGS "-fstack-protector")
+    if (NOT SOLARIS)
+        check_c_compiler_flag_ssp("-fstack-protector-strong" WITH_STACK_PROTECTOR_STRONG)
+        if (WITH_STACK_PROTECTOR_STRONG)
+            list(APPEND SUPPORTED_COMPILER_FLAGS "-fstack-protector-strong")
             # This is needed as Solaris has a seperate libssp
             if (SOLARIS)
-                list(APPEND SUPPORTED_LINKER_FLAGS "-fstack-protector")
+                list(APPEND SUPPORTED_LINKER_FLAGS "-fstack-protector-strong")
             endif()
-        endif()
-    endif (WITH_STACK_PROTECTOR_STRONG)
+        else (WITH_STACK_PROTECTOR_STRONG)
+            check_c_compiler_flag_ssp("-fstack-protector" WITH_STACK_PROTECTOR)
+            if (WITH_STACK_PROTECTOR)
+                list(APPEND SUPPORTED_COMPILER_FLAGS "-fstack-protector")
+                # This is needed as Solaris has a seperate libssp
+                if (SOLARIS)
+                    list(APPEND SUPPORTED_LINKER_FLAGS "-fstack-protector")
+                endif()
+            endif()
+        endif (WITH_STACK_PROTECTOR_STRONG)
 
-    check_c_compiler_flag_ssp("-fstack-clash-protection" WITH_STACK_CLASH_PROTECTION)
-    if (WITH_STACK_CLASH_PROTECTION)
-        list(APPEND SUPPORTED_COMPILER_FLAGS "-fstack-clash-protection")
+        check_c_compiler_flag_ssp("-fstack-clash-protection" WITH_STACK_CLASH_PROTECTION)
+        if (WITH_STACK_CLASH_PROTECTION)
+            list(APPEND SUPPORTED_COMPILER_FLAGS "-fstack-clash-protection")
+        endif()
     endif()
 
     if (PICKY_DEVELOPER)
@@ -104,5 +106,10 @@ if (MSVC)
     add_c_compiler_flag("/D _CRT_SECURE_NO_WARNINGS=1" SUPPORTED_COMPILER_FLAGS)
 endif()
 
-set(DEFAULT_C_COMPILE_FLAGS ${SUPPORTED_COMPILER_FLAGS} CACHE INTERNAL "Default C Compiler Flags" FORCE)
-set(DEFAULT_LINK_FLAGS ${SUPPORTED_LINKER_FLAGS} CACHE INTERNAL "Default C Linker Flags" FORCE)
+add_library(defaults INTERFACE)
+if (SUPPORTED_COMPILER_FLAGS)
+    target_compile_options(defaults INTERFACE ${SUPPORTED_COMPILER_FLAGS})
+endif()
+if (SUPPORTED_LINKER_FLAGS)
+    target_link_options(defaults INTERFACE ${SUPPORTED_LINKER_FLAGS})
+endif()
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index a577c33..3d5eb5e 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -7,12 +7,8 @@ include(CheckStructHasMember)
 include(CheckPrototypeDefinition)
 include(TestBigEndian)
 
-set(PACKAGE ${PROJECT_NAME})
-set(VERSION ${PROJECT_VERSION})
-set(DATADIR ${DATA_INSTALL_DIR})
-set(LIBDIR ${LIB_INSTALL_DIR})
-set(PLUGINDIR "${PLUGIN_INSTALL_DIR}-${LIBRARY_SOVERSION}")
-set(SYSCONFDIR ${SYSCONF_INSTALL_DIR})
+set(PRIV_WRAPPER_PACKAGE ${PROJECT_NAME})
+set(PRIV_WRAPPER_VERSION ${PROJECT_VERSION})
 
 set(BINARYDIR ${CMAKE_BINARY_DIR})
 set(SOURCEDIR ${CMAKE_SOURCE_DIR})
@@ -57,11 +53,16 @@ check_function_exists(prctl HAVE_PRCTL)
 check_function_exists(pledge HAVE_PLEDGE)
 check_function_exists(setrlimit HAVE_SETRLIMIT)
 
+check_prototype_definition(setrlimit
+    "int setrlimit(__rlimit_resource_t resource, const struct rlimit *rlp)"
+    "-1"
+    "sys/resource.h"
+    HAVE_SETRLIMIT_RLIMIT_RESOURCE_T)
 
 if (UNIX)
     find_library(DLFCN_LIBRARY dl)
     if (DLFCN_LIBRARY)
-        string(APPEND _REQUIRED_LIBRARIES ${DLFCN_LIBRARY})
+        list(APPEND _REQUIRED_LIBRARIES ${DLFCN_LIBRARY})
     else()
         check_function_exists(dlopen HAVE_DLOPEN)


-- 
Priv Wrapper Repository



More information about the samba-cvs mailing list