Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename README.md to Write #855

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
564 commits
Select commit Hold shift + click to select a range
c4b54f2
centralize default passwd setting
japaric Jul 28, 2023
036f5e9
bump CI timeout
japaric Jul 28, 2023
7a2de41
Merge pull request #722 from memorysafety/bump-ci-timeout
rnijveld Jul 28, 2023
d32e6e5
Merge pull request #699 from memorysafety/upd-proof
rnijveld Jul 28, 2023
b5e96e8
Merge pull request #720 from memorysafety/impl-sudo-lister
pvdrz Jul 28, 2023
eee473e
expand Cmnd_Alias in sudo --list output
japaric Jul 28, 2023
dd857bc
test negated Cmnd_Alias
japaric Jul 28, 2023
5234a90
fix parsing of "!ALIAS " in Cmnd_Spec position
japaric Jul 28, 2023
02d2a32
add long format tests
japaric Jul 28, 2023
7b77cf7
implement sudo -l -l
japaric Jul 28, 2023
d9a08d7
appease clippy
japaric Jul 28, 2023
bcb07e0
unignore passing test
japaric Jul 28, 2023
eee46be
move some code into Qualified methods
japaric Jul 31, 2023
844670b
matches! -> !=
japaric Jul 31, 2023
fe318cd
fix nightly build
japaric Jul 31, 2023
be4876f
Merge pull request #721 from memorysafety/impl-sudo-listest
japaric Jul 31, 2023
b8b94f5
ast: change Tag.passwd into an enum
japaric Jul 31, 2023
ee9a1f8
rename var from passwd to authenticate
japaric Jul 31, 2023
92b8926
make tests compile
japaric Jul 31, 2023
30633b2
impliment suggestions
oneElectron Aug 1, 2023
6eeda02
fix formating
oneElectron Aug 1, 2023
c1bba46
Merge pull request #717 from oneElectron/626-truncate-syslog
rnijveld Aug 8, 2023
38c8c12
Merge pull request #725 from memorysafety/passwd-enum
rnijveld Aug 8, 2023
8f1f8ba
Set and test lower minimal dependencies and test MSRV
rnijveld Aug 8, 2023
e0fe7da
Quote versions as strings
rnijveld Aug 8, 2023
60d8951
Added resolve_path to EDITOR and fix resolve_path test
oneElectron Aug 8, 2023
a0fe3fc
Merge pull request #729 from memorysafety/minimal-and-msrv
pvdrz Aug 8, 2023
90bd785
Fix test using stderr with Docker `--tty` (#622)
xy2i Aug 13, 2023
e5f517f
Move `Authorization::Allowed` fields to its own type
xy2i Aug 14, 2023
7a21ab4
add failing test case
squell Aug 16, 2023
8c03c8c
propagate arg0 to exec module
squell Aug 16, 2023
5fe4a41
Merge pull request #733 from xy2i/714-allowed-fields
squell Aug 16, 2023
81fe097
Merge pull request #732 from xy2i/gh622
squell Aug 16, 2023
7d80ee5
add symlink tests for native binaries
squell Aug 17, 2023
c4ee38c
pass the correct filename also to scripts; allow sudoer-policy to ope…
squell Aug 17, 2023
312a0c7
add unit test
squell Aug 18, 2023
ca14c76
Merge branch 'memorysafety:main' into 724-resolve-editor-path
oneElectron Aug 19, 2023
e83fc61
Merge pull request #736 from memorysafety/arg0-symlink
rnijveld Aug 19, 2023
da27f00
test that IO errors when printing do not trigger a panic
japaric Aug 22, 2023
325b465
switch from print! macros to write!
japaric Aug 22, 2023
d750220
refactor: DRY Sudoers::check_permission
japaric Aug 24, 2023
b7c1b2a
run updated rustfmt on code
squell Aug 28, 2023
8f442e8
appears clippy in the test framework
squell Aug 28, 2023
4cb92cf
Merge pull request #743 from memorysafety/nit-fmt
rnijveld Aug 28, 2023
297c1a2
responsible disclosure -> coordinated vulnerability disclosure; remov…
squell Aug 28, 2023
8d64836
touch up README
squell Aug 28, 2023
f97d593
add minimum supported Linux kernel version
squell Aug 28, 2023
d5ae3d3
Merge pull request #739 from memorysafety/refactor-check
squell Aug 28, 2023
db1930c
Merge pull request #742 from memorysafety/upd-readme
rnijveld Aug 28, 2023
c4b1f51
Add su doc, add machinery for releasing
rnijveld Aug 29, 2023
81aff9a
Merge pull request #744 from memorysafety/release-pre
squell Aug 29, 2023
58568f0
Release 0.2.0
rnijveld Aug 29, 2023
f82a8bf
turn panic! into compiler_error!
japaric Aug 29, 2023
9a7f38f
Merge pull request #738 from memorysafety/gh737
japaric Aug 29, 2023
af45280
sudoers/@include: error out when encountering `%h`
xy2i Aug 24, 2023
cfc735f
sudoers: test null byte terminated username
japaric Sep 4, 2023
04af81e
fill in GH issue number
japaric Sep 4, 2023
587b739
WIP
japaric Sep 4, 2023
0ac6fa8
Merge pull request #750 from memorysafety/test-sudoers-null-byte-term…
rnijveld Sep 5, 2023
792d5e3
unignore tests
squell Sep 5, 2023
d0c641c
propagate errors from accept_escaped properly
squell Sep 5, 2023
53ad6f5
hardening: parse error is now the correct 'expected ... got \0'
squell Sep 5, 2023
aaf4b7d
change funtion type of 'accept_if' to prevent confusion in the future
squell Sep 5, 2023
436d3f1
use safe libstd API instead of unsafe libc API
japaric Sep 5, 2023
7ba72d7
Merge pull request #751 from memorysafety/fix-null-chars
rnijveld Sep 5, 2023
1f2c635
use env::set_current_dir instead of libc::chdir
japaric Sep 5, 2023
700a6ee
Add static lifetime to get rid of some compiler warnings
rnijveld Sep 5, 2023
0af2988
Merge pull request #752 from memorysafety/ja-rm-unsafe
rnijveld Sep 5, 2023
9b9a7e4
Merge pull request #753 from memorysafety/ja-rm-chdir
rnijveld Sep 5, 2023
4118c89
Merge pull request #754 from memorysafety/add-static-lifetime
japaric Sep 5, 2023
deffb82
Merge pull request #740 from xy2i/676-percent-h-unsupported
rnijveld Sep 5, 2023
348a012
replace cstr! with const constructor
japaric Sep 5, 2023
f7ee9bd
Merge pull request #756 from memorysafety/ja-refactor-cstr
squell Sep 5, 2023
cff697e
pam/securemem: handle null pointer case
japaric Sep 5, 2023
6d40763
Merge pull request #757 from memorysafety/ja-nonnull-calloc
squell Sep 5, 2023
39bd798
Binary serialization over pipes
xy2i Aug 25, 2023
5ed2069
refactor: use NonNull to deal with pam_getenvlist
japaric Sep 7, 2023
5165038
Merge pull request #741 from xy2i/471-bin-pipes
pvdrz Sep 7, 2023
d077e90
Merge pull request #758 from memorysafety/getenvlist-nonnull
pvdrz Sep 7, 2023
79a8aae
a username instead of an username
ianchanning Sep 8, 2023
aca9451
Update src/su/cli.rs
ianchanning Sep 8, 2023
b5eb2c6
Merge pull request #759 from ianchanning/patch-1
squell Sep 8, 2023
a5e958a
add ackno's
squell Sep 12, 2023
dc17cac
Fail CI on Clippy warnings
pohlm01 Sep 15, 2023
80d10d2
Add mitigations against Rowhammer attacks
pohlm01 Sep 15, 2023
6d72783
Merge pull request #761 from memorysafety/ackno
rnijveld Sep 19, 2023
fbfbabd
Merge pull request #730 from oneElectron/724-resolve-editor-path
squell Sep 19, 2023
f2d1128
Only add set_nonblocking method when building with debug_assertions, …
rnijveld Sep 19, 2023
84c00d1
visudo-rs: Improve the error message
sylvestre Sep 19, 2023
34fa76e
change signature of `chown` to not accept `Option`s
japaric Sep 19, 2023
45e841d
Merge pull request #764 from pohlm01/main
rnijveld Sep 19, 2023
d358128
fix return type
japaric Sep 19, 2023
0b9207b
test sudo with long username
japaric Sep 19, 2023
2f7924f
ignore failing test
japaric Sep 19, 2023
6495e7e
Merge pull request #768 from memorysafety/some-chown-changes
pvdrz Sep 19, 2023
d106c4e
Merge pull request #767 from sylvestre/patch-1
pvdrz Sep 19, 2023
dfed67e
Merge pull request #766 from memorysafety/cfg-fix
pvdrz Sep 19, 2023
e2edeca
Merge pull request #770 from memorysafety/test-long-username
pvdrz Sep 19, 2023
e3a6392
Skip self_check when executed as root
r-vdp Aug 30, 2023
e01c5f1
Test that we skip the self_check when executed as root
r-vdp Aug 30, 2023
722ecf8
simplify self_check function
japaric Sep 20, 2023
466d9f8
fix warnings that show up with nightly toolchain
japaric Sep 20, 2023
691022b
fix warnings
japaric Sep 20, 2023
4c177bc
Merge pull request #772 from memorysafety/self-check
squell Sep 20, 2023
62aa93d
Merge pull request #765 from pohlm01/rowhammer
squell Sep 20, 2023
72ba436
Merge pull request #773 from memorysafety/add-tick-static
rnijveld Sep 20, 2023
7b78ace
remove LoggerWrite trait
japaric Sep 20, 2023
7bf365e
remove allocation from Syslog logger
japaric Sep 20, 2023
9f269f6
Merge pull request #776 from memorysafety/rm-logger-write
rnijveld Sep 20, 2023
6ce50df
Use uid instead of username for storing session files
rnijveld Sep 11, 2023
147add6
Strip symbols from release binaries
rnijveld Sep 20, 2023
ef7c188
remove track dependencies from CI
squell Sep 20, 2023
68871c6
Merge pull request #778 from memorysafety/strip-symbols-patch
pvdrz Sep 20, 2023
6748b1c
Merge pull request #777 from memorysafety/strip-symbols
squell Sep 21, 2023
df877ef
add sentence about globbing not being supported
squell Sep 20, 2023
9098406
Merge pull request #775 from memorysafety/readme-nitpick
rnijveld Sep 21, 2023
9ab83cd
replace unsafe CStr construction with a macro that
japaric Sep 21, 2023
bfdbda2
Merge pull request from GHSA-2r3c-m6v7-9354
rnijveld Sep 21, 2023
4e3166f
tweak impl to work on 1.70
japaric Sep 21, 2023
195d6f8
Release 0.2.1
rnijveld Sep 21, 2023
d91d47e
Merge pull request #779 from memorysafety/cstr-macro
pvdrz Sep 21, 2023
4aeaf38
refactor: add SudoString and SudoPath
japaric Sep 19, 2023
f66a241
refactor common code into resolve_from_name_or_id
japaric Sep 26, 2023
142aeca
Fix typos in the doc & man
sylvestre Oct 1, 2023
5cf4857
Merge pull request #786 from sylvestre/typo
pvdrz Oct 2, 2023
405d0b9
test that --login works with --chdir
japaric Oct 26, 2023
5d27f1d
sudo: respect `--login` regardless of the presence of `--chdir`
japaric Oct 26, 2023
7c1c0ca
appease clippy
japaric Oct 26, 2023
e97c519
refactor sudoers tests for readability
japaric Oct 27, 2023
a7f0693
appease clippy
japaric Oct 27, 2023
63ea087
fix clippy warnings
japaric Nov 2, 2023
440e097
Merge pull request #797 from memorysafety/appease-clippy
japaric Nov 2, 2023
28d0d94
Merge pull request #795 from memorysafety/refactor-sudoers-tests
japaric Nov 2, 2023
724ed34
Merge pull request #794 from memorysafety/fix-chdir-login
japaric Nov 2, 2023
870d15b
Merge pull request #784 from memorysafety/string-refactor
japaric Nov 2, 2023
d7c1d93
match -> if-else to remove an unwrap
japaric Sep 26, 2023
e72c2b9
use split/strip API to avoid slicing
japaric Oct 17, 2023
f93546e
refactor try_to_env_var for readability
japaric Oct 17, 2023
a383b54
refactor CLI validation
japaric Oct 17, 2023
a28d654
add some compliance tests
japaric Oct 20, 2023
35ecd25
update usage message
japaric Oct 20, 2023
58b466d
move crate::cli into crate::sudo
japaric Oct 20, 2023
f1a49d7
fix tests in release mode
japaric Oct 20, 2023
fbe5474
stop accepting unimplemented flags
japaric Oct 24, 2023
a926ce6
rename sudo CLI structs
japaric Oct 24, 2023
b35b05a
emit a warning when env var list or --preserve-env is used
japaric Oct 24, 2023
84b165b
emit an error when the unimplemented --edit flag is used
japaric Oct 24, 2023
e0a515f
fix parsing of --preserve-env
japaric Oct 24, 2023
9d04eb6
Run rustfmt
pvdrz Nov 2, 2023
36ccd28
use strip/split API to avoid panicky slicing
japaric Oct 23, 2023
05f0d9f
su: parse "-g " as "--group= "
japaric Oct 23, 2023
4e1da0b
turn OptionSetter into a function pointer
japaric Oct 23, 2023
558e888
su: test positional arguments
japaric Oct 23, 2023
d3fb01f
fix a typo
japaric Oct 23, 2023
2f76cce
su: flags may appear after positional arguments
japaric Oct 23, 2023
33aeaf4
su: handle --
japaric Oct 23, 2023
4aa086e
su: reject repeated boolean flags
japaric Oct 23, 2023
f06a5c7
Merge pull request #789 from memorysafety/refactor-cli-validation
pvdrz Nov 2, 2023
301504c
su: more strict CLI validation
japaric Oct 24, 2023
7408fe6
ignore some compliance tests
japaric Oct 24, 2023
7aa03d0
appease clippy
japaric Oct 24, 2023
bde50e8
appease compliance-tests-lint
japaric Oct 24, 2023
d5c66f0
Merge pull request #792 from memorysafety/refactor-su-cli
pvdrz Nov 2, 2023
533fd30
Adds security audit report.
BriocheBerlin Nov 3, 2023
55c6d61
Move report into docs/audit.
BriocheBerlin Nov 3, 2023
507cceb
Merge pull request #799 from ferrous-systems/audit-report
japaric Nov 3, 2023
9be0806
fixes in SECURITY.md
dd-dreams Nov 6, 2023
e1a5852
Update README.md to fix a typo
sweetliquid Nov 7, 2023
328be1e
Merge pull request #803 from sweetliquid/patch-1
rnijveld Nov 7, 2023
44485b0
Add commad for PAM installation
allaboutevemirolive Nov 7, 2023
8f4a58a
Run cargo minify
Tortoaster Nov 30, 2023
5b25cb0
Merge pull request #808 from Tortoaster/cargo-minify
squell Nov 30, 2023
6c6b70c
fix: off-by-one in syslog.rs
CertainLach Dec 4, 2023
7f82d3a
Merge pull request #810 from CertainLach/fix/syslog-off-by-one
squell Dec 8, 2023
6e98ce2
To add a `SAFETY` comment to the now function
ZhangHanDong Dec 28, 2023
ec6d41a
fixed fmt
ZhangHanDong Dec 28, 2023
d8d8927
updates to pass 1.75 version of clippy
squell Jan 8, 2024
e5cf58e
Merge pull request #813 from memorysafety/clippy-update
squell Jan 8, 2024
2fa9234
Merge pull request #811 from ZhangHanDong/patch-1
squell Jan 8, 2024
58dd8fb
Merge pull request #801 from dd-dreams/securitymd
squell Jan 9, 2024
3c9756b
Rename `buffer` to `internal`
pvdrz Jan 9, 2024
e544180
improve pty error
squell Nov 28, 2023
a392c00
include source file in syntax error struct
squell Jan 10, 2024
fb2b79f
Merge pull request #804 from allaboutevemirolive/v2_README
japaric Jan 11, 2024
079569c
Merge pull request #807 from memorysafety/improve-pty-error
squell Jan 11, 2024
c4f34fe
turn hostname string into a newtype
japaric Oct 27, 2023
cd3be41
turn current User into a newtype
japaric Oct 27, 2023
2c9b476
Merge pull request #816 from memorysafety/revert-revert-pr796
japaric Jan 15, 2024
c6ea0c1
Use a ring buffer to pipe data between IO objects
pvdrz Jan 16, 2024
1695b9a
remove unused definition from c bindings
squell Jan 19, 2024
aa2f245
correct the type used by things that are #define'd in C; i.e. which w…
squell Jan 19, 2024
5fe779f
appease cargo fmt
squell Jan 19, 2024
5fd130d
make tests portable
squell Jan 19, 2024
3260252
nit-pick: don't allow anybody to create pam_handle_t out of thin air
squell Jan 19, 2024
23e8b0b
Merge pull request #822 from memorysafety/portable-c-binding
pvdrz Jan 19, 2024
db10b63
Box the internal storage of `RingBuffer`
pvdrz Jan 23, 2024
98b4a23
Fix typo
pvdrz Jan 23, 2024
4ce0ef9
Use better wording when talking about the sections of the buffer with…
pvdrz Jan 23, 2024
eb086c4
Move ring buffer to its own module
pvdrz Jan 23, 2024
6547452
Add debug assertions for the `start` and `len` invariants
pvdrz Jan 23, 2024
d2fad50
Add assertions about the inner fields of `RingBuffer`
pvdrz Jan 23, 2024
208a25b
Merge pull request #819 from memorysafety/pvdrz-ring-buffer
pvdrz Jan 23, 2024
a7fd516
Fix #824 panic in SysLogWriter
marlonbaeten Jan 30, 2024
adffb1e
Format use statements in tests syslog.rs
marlonbaeten Jan 30, 2024
90e516b
Merge pull request #825 from memorysafety/824-syslog-writer-panic
japaric Jan 30, 2024
c136211
Merge pull request #815 from memorysafety/improve-diagnostic
rnijveld Feb 4, 2024
f317145
Release 0.2.2
rnijveld Feb 3, 2024
558598f
Fix dead link in CODE_OF_CONDUCT.md
Feb 12, 2024
a614fc8
Merge pull request #826 from memorysafety/release/0.2.2
squell Feb 12, 2024
4fa3217
Merge pull request #828 from just-an-engineer/main
squell Feb 12, 2024
8691594
change sigaction from literal initialization to a member-for-member a…
squell Feb 20, 2024
a6ad4ee
Refactor zeroed sigaction into a separate function
rnijveld Feb 23, 2024
bd0f626
Merge pull request #830 from memorysafety/portability-sigaction
squell Feb 23, 2024
fca01f5
update README with clearer installation instructions
squell Feb 23, 2024
ebd3e60
Merge pull request #831 from memorysafety/upd-readme
japaric Feb 26, 2024
0c6ee2d
appease clippy warnings originating from rust 1.77
squell Apr 8, 2024
266d07c
appease clippy --tests (indeed the zeroed_sigaction was in the wrong …
squell Apr 8, 2024
cd8644d
Merge pull request #840 from memorysafety/fix-clippy
squell Apr 8, 2024
9cd3b8e
Update README.md to include Fedora install instructions
shellheim Apr 5, 2024
9e7a4c4
Merge pull request #839 from shellheim/patch-1
squell Apr 8, 2024
e5c1fbb
Fix CI Detection Errors
taotieren May 10, 2024
62d12fa
remove empty doc comments
squell May 10, 2024
a818329
remove unused SetLength trait
squell May 10, 2024
76a0a44
run cargo minify again + remove related test cases
squell May 10, 2024
94119b0
Merge pull request #844 from memorysafety/fix-ci
squell May 10, 2024
6836c37
Add Arch Linux
taotieren May 11, 2024
90e2385
Merge pull request #838 from taotieren/arch
pvdrz May 11, 2024
5e03d02
truncate sudoers file after editing
squell May 9, 2024
b5d4b22
add ignore declarations for vacuous clippy complaints
squell Jun 20, 2024
97e9c28
remove unneeded info from Group structure
squell Jun 20, 2024
1e1f1a6
remove group_id and process_name from Process struct
squell Jun 20, 2024
bff8131
exercise CreateResult code more
squell Jun 20, 2024
e0f35f3
remove non-local impl block
squell Jun 20, 2024
a748057
fix indentation
squell Jun 20, 2024
13e7dcc
display locations of errors in visudo
squell Jun 20, 2024
3b09b4c
Merge pull request #843 from memorysafety/visudo-trunc
pvdrz Jun 25, 2024
bf8c47c
patch by @AppleSheeple, fixing high cpu usage
squell Jun 21, 2024
107ffba
Move tty check to `ParentClosure`
pvdrz Jun 25, 2024
137f633
Add wrapper for `tcgetsid`
pvdrz Jun 25, 2024
4e6e916
Run rustfmt
pvdrz Jun 25, 2024
13527c1
Merge pull request #845 from memorysafety/cpu
pvdrz Jun 25, 2024
04e804e
change copyright attribution
squell Jun 20, 2024
cb99720
Merge pull request #849 from memorysafety/copyright-transfer
rnijveld Jul 8, 2024
7ac9d4b
change URLs to new repository location
squell Jul 8, 2024
227327b
use straight clippy instead of action-rs
squell Jul 8, 2024
948363f
Merge pull request #850 from trifectatechfoundation/url-change
squell Jul 8, 2024
41aed0a
Add a check of the kernel version
sylvestre Jul 8, 2024
b3b90d2
release 0.2.3 (#848)
squell Jul 11, 2024
2ac8cbb
Merge pull request #854 from sylvestre/kernel
pvdrz Jul 15, 2024
6baa3a4
Rename README.md to Write
Patrickstory15 Aug 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A clear and concise description of what the bug is. Please check the issue track
**To Reproduce**
Steps to reproduce the behavior:
1. Compile 'sudo-rs' '....'
2. Write the following contents to `/etc/sudoers.test` '....'
2. Write the following contents to `/etc/sudoers-rs` '....'
3. Run the following command '....'
4. See error

Expand Down
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
A clear and concise description of the changes done by your pull request.

**Pull Request Checklist**
- [] I have read and accepted the [code of conduct](https://github.com/memorysafety/sudo-rs/blob/master/CODE_OF_CONDUCT.md) for this project.
- [] I have read and accepted the [code of conduct](https://github.com/trifectatechfoundation/sudo-rs/blob/master/CODE_OF_CONDUCT.md) for this project.
- [] I have tested, formatted and ran clippy over my changes.
- [] I have commented and documented my changes.
- [] This pull request will fix issue https://github.com/memorysafety/sudo-rs/issues/<#issue> where a proper discussion about a solution has taken place.
- [] This pull request will fix issue https://github.com/trifectatechfoundation/sudo-rs/issues/<#issue> where a proper discussion about a solution has taken place.
220 changes: 140 additions & 80 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,47 @@ on:
- main

jobs:
e2e-tests:
runs-on: ubuntu-latest
env:
SUDO_UNDER_TEST: ours
SUDO_TEST_VERBOSE_DOCKER_BUILD: 1
CI: true
steps:
- uses: actions/checkout@v2

- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: set up docker buildx
run: docker buildx create --name builder --use

- name: cache docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: docker-buildx-rs-${{ github.sha }}
restore-keys: docker-buildx-rs-

- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "compliance-tests"
workspaces: |
test-framework

- name: Run all E2E tests
working-directory: test-framework
run: cargo test -p e2e-tests

- name: prevent the cache from growing too large
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

compliance-tests-og:
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -39,7 +80,7 @@ jobs:
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: 'compliance-tests'
shared-key: "compliance-tests"
workspaces: |
test-framework

Expand All @@ -58,7 +99,7 @@ jobs:

compliance-tests:
runs-on: ubuntu-latest
timeout-minutes: 15
timeout-minutes: 20
env:
SUDO_TEST_PROFRAW_DIR: /tmp/profraw
SUDO_TEST_VERBOSE_DOCKER_BUILD: 1
Expand All @@ -85,7 +126,7 @@ jobs:
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: 'compliance-tests'
shared-key: "compliance-tests"
workspaces: |
test-framework

Expand All @@ -95,14 +136,6 @@ jobs:
SUDO_UNDER_TEST: ours
run: cargo test -p sudo-compliance-tests

- name: Prepare code coverage data
run: ./make-lcov-info.bash

- name: Upload code coverage
uses: codecov/codecov-action@v3
with:
files: lcov.info

- name: Check that we didn't forget to gate a passing compliance test
working-directory: test-framework
env:
Expand Down Expand Up @@ -132,24 +165,23 @@ jobs:
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: 'compliance-tests'
shared-key: "compliance-tests"
workspaces: |
test-framework

- name: clippy sudo-test
working-directory: test-framework
run: cargo clippy -p sudo-test --no-deps -- --deny clippy::all
run: cargo clippy -p sudo-test --no-deps -- --deny warnings

- name: clippy compliance-tests
working-directory: test-framework
run: cargo clippy -p sudo-compliance-tests --tests --no-deps -- --deny clippy::all
run: cargo clippy -p sudo-compliance-tests --tests --no-deps -- --deny warnings

- name: Check that all ignored tests are linked to a GH issue
working-directory: test-framework/sudo-compliance-tests
run: |
grep -r '#\[ignore' ./src | grep -v -e '"gh' -e '"wontfix"' && echo 'found ignored tests not linked to a GitHub issue. please like them using the format #[ignore = "gh123"]' && exit 1; true


build-and-test:
runs-on: ubuntu-latest

Expand All @@ -172,12 +204,12 @@ jobs:
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libpam0g-dev
version: 1.0
version: "1.0"

- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: 'stable'
shared-key: "stable"

- name: Build
uses: actions-rs/cargo@v1
Expand All @@ -196,6 +228,86 @@ jobs:
with:
files: lcov.info

build-and-test-minimal:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set rust nightly version
run: echo "NIGHTLY_VERSION=$(curl https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/rustc)" >> $GITHUB_ENV

- name: Install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-${{ env.NIGHTLY_VERSION }}
override: true

- name: Install dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libpam0g-dev
version: "1.0"

- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "nightly"

- name: Update to minimal direct dependencies
uses: actions-rs/cargo@v1
with:
command: update
args: -Zdirect-minimal-versions

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --workspace --all-targets --all-features --release

- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --all-features --all-targets --release

build-and-test-msrv:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: "1.70"
override: true

- name: Install dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libpam0g-dev
version: "1.0"

- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "msrv"

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --workspace --all-targets --all-features --release

- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --all-features --all-targets --release

miri:
needs: build-and-test
runs-on: ubuntu-latest
Expand All @@ -218,7 +330,7 @@ jobs:
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libpam0g-dev
version: 1.0
version: "1.0"

- name: Rust Cache
uses: Swatinem/rust-cache@v2
Expand All @@ -234,7 +346,7 @@ jobs:
format:
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: '-D warnings'
RUSTDOCFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v2

Expand All @@ -249,7 +361,7 @@ jobs:
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: 'stable'
shared-key: "stable"

- name: Run rustfmt
uses: actions-rs/cargo@v1
Expand All @@ -261,7 +373,7 @@ jobs:
needs: format
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: '-D warnings'
RUSTDOCFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v2

Expand All @@ -277,25 +389,21 @@ jobs:
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libpam0g-dev
version: 1.0
version: "1.0"

- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: 'stable'
shared-key: "stable"

- name: Run clippy
uses: actions-rs/clippy-check@v1
with:
name: clippy-result
token: ${{ secrets.GITHUB_TOKEN }}
args: --no-deps
run: cargo clippy --no-deps --all-targets --all-features -- --deny warnings

docs:
needs: clippy
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: '-D warnings'
RUSTDOCFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v2

Expand All @@ -310,67 +418,19 @@ jobs:
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libpam0g-dev
version: 1.0
version: "1.0"

- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: 'stable'
shared-key: "stable"

- name: Build docs
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps --document-private-items --all-features

track-dependencies:
needs: clippy
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v2

- name: Set rust nightly version
run: echo "NIGHTLY_VERSION=$(curl https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/rustc)" >> $GITHUB_ENV

- name: Install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-${{ env.NIGHTLY_VERSION }}
override: true

- name: Install cargo-udeps
uses: taiki-e/install-action@v2
with:
tool: cargo-udeps

- name: Install dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libpam0g-dev
version: 1.0

- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: deps

- name: Check udeps
uses: actions-rs/cargo@v1
with:
command: udeps
args: --workspace --all-targets

- uses: tweedegolf/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
bin: sudo
mainBranchName: main

audit:
needs: clippy
runs-on: ubuntu-latest
Expand All @@ -392,7 +452,7 @@ jobs:
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: 'audit'
shared-key: "audit"

- name: Run audit
uses: actions-rs/cargo@v1
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,11 @@

# Code coverage in lcov format
/lcov.info

# Generated man pages
/docs/man/*.1
/docs/man/*.1.gz
/docs/man/*.5
/docs/man/*.5.gz
/docs/man/*.8
/docs/man/*.8.gz
Loading
Loading