Skip to content

Commit

Permalink
issue-72 - Correct datatype, add test, originally reported by max-pri…
Browse files Browse the repository at this point in the history
…vatevoid
  • Loading branch information
morisja committed Oct 21, 2024
1 parent f6b4edd commit 734cbda
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ci/test_nsncd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ rc=0
# basic lookups
getent passwd nsncdtest || rc=1
getent group nsncdtest || rc=1

id bug72 | grep 2709991565 || rc=1
# we expect all of these to succeed
for i in $(seq 1 100); do
getent services 65000 || rc=1
Expand Down
2 changes: 2 additions & 0 deletions ci/test_nspawn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ sudo sed '$ a netgroup: files' -i /etc/nsswitch.conf
rc=0

sudo useradd nsncdtest
sudo groupadd bug72 --gid 2709991565
sudo useradd bug72 --gid 2709991565
cp /etc/services ./services

# simple service lookups
Expand Down
2 changes: 1 addition & 1 deletion src/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ fn serialize_initgroups(groups: Vec<Gid>) -> Result<Vec<u8>> {

result.extend_from_slice(header.as_slice());
for group in groups.iter() {
result.extend_from_slice(&i32::to_ne_bytes(group.as_raw().try_into()?));
result.extend_from_slice(&u32::to_ne_bytes(group.as_raw().try_into()?));

Check failure on line 952 in src/handlers.rs

View workflow job for this annotation

GitHub Actions / clippy

useless conversion to the same type: `u32`
}

Ok(result)
Expand Down

0 comments on commit 734cbda

Please sign in to comment.