From 6111cd6e1b4ce7060769143c029cb93d55b25a39 Mon Sep 17 00:00:00 2001 From: Jan Scheer Date: Tue, 13 Jul 2021 12:24:03 +0200 Subject: [PATCH] id: add note about conditional compiling to README section --- .github/workflows/CICD.yml | 5 +---- .github/workflows/GnuTests.yml | 9 +-------- Cargo.toml | 6 +++++- src/uu/id/src/id.rs | 11 ++++++++--- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 9abfcaa81..9fd08b26f 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -14,7 +14,7 @@ env: PROJECT_DESC: "Core universal (cross-platform) utilities" PROJECT_AUTH: "uutils" RUST_MIN_SRV: "1.51.0" ## MSRV v1.51.0 - RUST_COV_SRV: "2020-07-01" ## (~v1.47.0) supported rust version for code coverage; (date required/used by 'coverage') ## !maint: refactor when code coverage support is included in the stable channel + RUST_COV_SRV: "2020-08-01" ## (~v1.47.0) supported rust version for code coverage; (date required/used by 'coverage') ## !maint: refactor when code coverage support is included in the stable channel on: [push, pull_request] @@ -275,9 +275,6 @@ jobs: case '${{ matrix.job.os }}' in macos-latest) brew install coreutils ;; # needed for testing esac - case '${{ matrix.job.features }}' in - feat_selinux) sudo apt-get -y update ; sudo apt-get -y install libselinux1-dev ;; # TODO: is here the right place for this? - esac - name: Initialize workflow variables id: vars shell: bash diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index fb6ffc0ac..8bf6c091b 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -48,14 +48,7 @@ jobs: - name: Run GNU tests shell: bash run: | - # bash uutils/util/run-gnu-test.sh # TODO: revert after testing - bash uutils/util/run-gnu-test.sh tests/id/context.sh - bash uutils/util/run-gnu-test.sh tests/id/no-context.sh - bash uutils/util/run-gnu-test.sh tests/id/smack.sh - bash uutils/util/run-gnu-test.sh tests/id/uid.sh - bash uutils/util/run-gnu-test.sh tests/id/setgid.sh - bash uutils/util/run-gnu-test.sh tests/id/zero.sh - bash uutils/util/run-gnu-test.sh tests/id/gnu-zero-uids.sh + bash uutils/util/run-gnu-test.sh - name: Extract testing info shell: bash run: | diff --git a/Cargo.toml b/Cargo.toml index c588f735e..052e32c09 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -138,6 +138,11 @@ feat_os_unix_musl = [ # "feat_require_unix", ] +# "feat_selinux" == set of utilities providing support for SELinux Security Context if enabled with `--features feat_selinux`. +# NOTE: +# The selinux(-sys) crate requires `libselinux` headers and shared library to be accessible in the C toolchain at compile time. +# Running a uutils compiled with `feat_selinux` requires an SELinux enabled Kernel at run time. +feat_selinux = ["id/selinux", "selinux"] ## feature sets with requirements (restricting cross-platform availability) # # ** NOTE: these `feat_require_...` sets should be minimized as much as possible to encourage cross-platform availability of utilities @@ -146,7 +151,6 @@ feat_os_unix_musl = [ feat_require_crate_cpp = [ "stdbuf", ] -feat_selinux = ["id/selinux", "selinux"] # "feat_require_unix" == set of utilities requiring support which is only available on unix platforms (as of 2020-04-23) feat_require_unix = [ "chgrp", diff --git a/src/uu/id/src/id.rs b/src/uu/id/src/id.rs index 929b00dba..9f92a4561 100644 --- a/src/uu/id/src/id.rs +++ b/src/uu/id/src/id.rs @@ -5,7 +5,10 @@ // // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. -// + +// spell-checker:ignore (ToDO) asid auditid auditinfo auid cstr egid emod euid getaudit getlogin gflag nflag pline rflag termid uflag gsflag zflag cflag + +// README: // This was originally based on BSD's `id` // (noticeable in functionality, usage text, options text, etc.) // and synced with: @@ -25,8 +28,10 @@ // // * Help text based on BSD's `id` manpage and GNU's `id` manpage. // - -// spell-checker:ignore (ToDO) asid auditid auditinfo auid cstr egid emod euid getaudit getlogin gflag nflag pline rflag termid uflag gsflag zflag cflag +// * This passes GNU's coreutils Test suite (8.32) for "tests/id/context.sh" if compiled with +// `--features feat_selinux`. It should also pass "tests/id/no-context.sh", but that depends on +// `uu_ls -Z` being implemented and therefore fails at the moment +// #![allow(non_camel_case_types)] #![allow(dead_code)]