From b7d6e969b02cddc0b87152a9da743aceec652008 Mon Sep 17 00:00:00 2001 From: Paul Mabileau Date: Tue, 17 Sep 2024 11:38:00 +0200 Subject: [PATCH 1/3] Feat(apple): Add LOCAL_PEERTOKEN Taken from `sys/un.h`. Signed-off-by: Paul Mabileau --- src/unix/bsd/apple/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 9a5dc357fd038..24691a0b324d4 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -4159,6 +4159,7 @@ pub const LOCAL_PEERPID: ::c_int = 0x002; pub const LOCAL_PEEREPID: ::c_int = 0x003; pub const LOCAL_PEERUUID: ::c_int = 0x004; pub const LOCAL_PEEREUUID: ::c_int = 0x005; +pub const LOCAL_PEERTOKEN: ::c_int = 0x006; pub const SOL_SOCKET: ::c_int = 0xffff; From 540ce2ae0e7221a3868a102fdaf7877e20064a8e Mon Sep 17 00:00:00 2001 From: Paul Mabileau Date: Tue, 17 Sep 2024 11:51:10 +0200 Subject: [PATCH 2/3] Docs(apple): Add description for LOCAL_PEER* socket options Signed-off-by: Paul Mabileau --- src/unix/bsd/apple/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 24691a0b324d4..d991e379ba79a 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -4154,11 +4154,17 @@ pub const TCP_CONNECTION_INFO: ::c_int = 0x106; pub const SOL_LOCAL: ::c_int = 0; +/// Retrieve peer credentials. pub const LOCAL_PEERCRED: ::c_int = 0x001; +/// Retrieve peer PID. pub const LOCAL_PEERPID: ::c_int = 0x002; +/// Retrieve effective peer PID. pub const LOCAL_PEEREPID: ::c_int = 0x003; +/// Retrieve peer UUID. pub const LOCAL_PEERUUID: ::c_int = 0x004; +/// Retrieve effective peer UUID. pub const LOCAL_PEEREUUID: ::c_int = 0x005; +/// Retrieve peer audit token. pub const LOCAL_PEERTOKEN: ::c_int = 0x006; pub const SOL_SOCKET: ::c_int = 0xffff; From 45a95f8963796f5f5312411795648f60114fe8dc Mon Sep 17 00:00:00 2001 From: Paul Mabileau Date: Tue, 17 Sep 2024 11:54:45 +0200 Subject: [PATCH 3/3] Chore(test/apple): Add the LOCAL_PEERTOKEN symbol Signed-off-by: Paul Mabileau --- libc-test/semver/apple.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt index 832182dd117b3..f022a006de401 100644 --- a/libc-test/semver/apple.txt +++ b/libc-test/semver/apple.txt @@ -849,6 +849,7 @@ LOCAL_PEEREPID LOCAL_PEEREUUID LOCAL_PEERPID LOCAL_PEERUUID +LOCAL_PEERTOKEN LOGIN_PROCESS LOG_AUTHPRIV LOG_CRON