Skip to content

Commit 1faf396

Browse files
committed
refactor: update nix
1 parent f34d00d commit 1faf396

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,32 @@ jobs:
4444
- name: before_cache_script
4545
run: rm -rf $CARGO_HOME/registry/index
4646

47+
macos-aarch64:
48+
runs-on: macos-14
49+
env:
50+
TARGET: aarch64-apple-darwin
51+
steps:
52+
- name: checkout
53+
uses: actions/checkout@v4
54+
55+
- name: setup Rust
56+
uses: dtolnay/rust-toolchain@master
57+
with:
58+
toolchain: '${{ env.MSRV }}'
59+
components: clippy
60+
61+
- name: build
62+
uses: ./.github/actions/build
63+
with:
64+
TARGET: "${{ env.TARGET }}"
65+
66+
- name: test
67+
uses: ./.github/actions/test
68+
with:
69+
TARGET: "${{ env.TARGET }}"
70+
71+
- name: before_cache_script
72+
run: rm -rf $CARGO_HOME/registry/index
4773

4874
# Use cross for QEMU-based testing
4975
# cross needs to execute Docker, GitHub Action already has it installed

changelog/2311.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed `::unistd::Group::members` using read_unaligned to avoid crash on misaligned pointers

test/test_unistd.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,3 +1372,26 @@ fn test_eaccess_file_exists() {
13721372
eaccess(&path, AccessFlags::R_OK | AccessFlags::W_OK)
13731373
.expect("assertion failed");
13741374
}
1375+
1376+
#[test]
1377+
#[cfg(bsd)]
1378+
fn test_group_from() {
1379+
let group = Group::from_name("wheel").unwrap().unwrap();
1380+
let group = Group::from_name("daemon").unwrap().unwrap();
1381+
let group = Group::from_name("kmem").unwrap().unwrap();
1382+
let group = Group::from_name("sys").unwrap().unwrap();
1383+
let group = Group::from_name("tty").unwrap().unwrap();
1384+
let group = Group::from_name("operator").unwrap().unwrap();
1385+
let group = Group::from_name("procview").unwrap().unwrap();
1386+
let group = Group::from_name("procmod").unwrap().unwrap();
1387+
let group = Group::from_name("everyone").unwrap().unwrap();
1388+
let group = Group::from_name("staff").unwrap().unwrap();
1389+
let group = Group::from_name("certusers").unwrap().unwrap();
1390+
let group = Group::from_name("localaccounts").unwrap().unwrap();
1391+
let group = Group::from_name("admin").unwrap().unwrap();
1392+
assert!(group.name == "everyone");
1393+
let group_id = group.gid;
1394+
let group = Group::from_gid(group_id).unwrap().unwrap();
1395+
assert_eq!(group.gid, group_id);
1396+
assert_eq!(group.name, "everyone");
1397+
}

0 commit comments

Comments
 (0)