File tree 4 files changed +41
-4
lines changed
4 files changed +41
-4
lines changed Original file line number Diff line number Diff line change 44
44
- name : before_cache_script
45
45
run : rm -rf $CARGO_HOME/registry/index
46
46
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
47
73
48
74
# Use cross for QEMU-based testing
49
75
# cross needs to execute Docker, GitHub Action already has it installed
Original file line number Diff line number Diff line change
1
+ Fixed ` ::unistd::Group::members ` using read_unaligned to avoid crash on misaligned pointers
Original file line number Diff line number Diff line change @@ -3476,18 +3476,17 @@ impl Group {
3476
3476
let mut ret = Vec :: new( ) ;
3477
3477
3478
3478
for i in 0 .. {
3479
- let u = unsafe { mem. offset( i) } ;
3480
- if unsafe { ( * u ) . is_null( ) } {
3479
+ let u = unsafe { mem. offset( i) . read_unaligned ( ) } ;
3480
+ if u . is_null( ) {
3481
3481
break ;
3482
3482
} else {
3483
- let s = unsafe { CStr :: from_ptr( * u) . to_string_lossy( ) . into_owned( ) } ;
3483
+ let s = unsafe { CStr :: from_ptr( u) . to_string_lossy( ) . into_owned( ) } ;
3484
3484
ret. push( s) ;
3485
3485
}
3486
3486
}
3487
3487
3488
3488
ret
3489
3489
}
3490
-
3491
3490
/// # Safety
3492
3491
///
3493
3492
/// If `f` writes to its `*mut *mut libc::group` parameter, then it must
Original file line number Diff line number Diff line change @@ -1372,3 +1372,14 @@ fn test_eaccess_file_exists() {
1372
1372
eaccess ( & path, AccessFlags :: R_OK | AccessFlags :: W_OK )
1373
1373
. expect ( "assertion failed" ) ;
1374
1374
}
1375
+
1376
+ #[ test]
1377
+ #[ cfg( bsd) ]
1378
+ fn test_group_from ( ) {
1379
+ let group = Group :: from_name ( "wheel" ) . unwrap ( ) . unwrap ( ) ;
1380
+ assert ! ( group. name == "wheel" ) ;
1381
+ let group_id = group. gid ;
1382
+ let group = Group :: from_gid ( group_id) . unwrap ( ) . unwrap ( ) ;
1383
+ assert_eq ! ( group. gid, group_id) ;
1384
+ assert_eq ! ( group. name, "wheel" ) ;
1385
+ }
You can’t perform that action at this time.
0 commit comments