diff options
author | Alan Somers <asomers@gmail.com> | 2019-12-01 16:08:54 -0700 |
---|---|---|
committer | Alan Somers <asomers@gmail.com> | 2019-12-01 17:26:23 -0700 |
commit | 6cc90b31e23b0b98bd9fa194fed041f4c413077d (patch) | |
tree | 3dafb4db2e7d6aeb10f5c598e5818276e57d3c50 /test/sys/test_socket.rs | |
parent | 0f7be3e1e52c104218b0b61ff34f0554924ec99d (diff) | |
download | nix-6cc90b31e23b0b98bd9fa194fed041f4c413077d.zip |
ScmCredentials now wraps UnixCredentials instead of libc::ucred
Diffstat (limited to 'test/sys/test_socket.rs')
-rw-r--r-- | test/sys/test_socket.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/sys/test_socket.rs b/test/sys/test_socket.rs index 13d7b6b0..bd5c373b 100644 --- a/test/sys/test_socket.rs +++ b/test/sys/test_socket.rs @@ -561,7 +561,7 @@ fn test_scm_credentials() { pid: getpid().as_raw(), uid: getuid().as_raw(), gid: getgid().as_raw(), - }; + }.into(); let cmsg = ControlMessage::ScmCredentials(&cred); assert_eq!(sendmsg(send, &iov, &[cmsg], MsgFlags::empty(), None).unwrap(), 5); close(send).unwrap(); @@ -577,9 +577,9 @@ fn test_scm_credentials() { for cmsg in msg.cmsgs() { if let ControlMessageOwned::ScmCredentials(cred) = cmsg { assert!(received_cred.is_none()); - assert_eq!(cred.pid, getpid().as_raw()); - assert_eq!(cred.uid, getuid().as_raw()); - assert_eq!(cred.gid, getgid().as_raw()); + assert_eq!(cred.pid(), getpid().as_raw()); + assert_eq!(cred.uid(), getuid().as_raw()); + assert_eq!(cred.gid(), getgid().as_raw()); received_cred = Some(cred); } else { panic!("unexpected cmsg"); @@ -641,7 +641,7 @@ fn test_impl_scm_credentials_and_rights(mut space: Vec<u8>) { pid: getpid().as_raw(), uid: getuid().as_raw(), gid: getgid().as_raw(), - }; + }.into(); let fds = [r]; let cmsgs = [ ControlMessage::ScmCredentials(&cred), @@ -669,9 +669,9 @@ fn test_impl_scm_credentials_and_rights(mut space: Vec<u8>) { } ControlMessageOwned::ScmCredentials(cred) => { assert!(received_cred.is_none()); - assert_eq!(cred.pid, getpid().as_raw()); - assert_eq!(cred.uid, getuid().as_raw()); - assert_eq!(cred.gid, getgid().as_raw()); + assert_eq!(cred.pid(), getpid().as_raw()); + assert_eq!(cred.uid(), getuid().as_raw()); + assert_eq!(cred.gid(), getgid().as_raw()); received_cred = Some(cred); } _ => panic!("unexpected cmsg"), |