summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2012-09-12 09:50:17 +0000
committerglebius <glebius@FreeBSD.org>2012-09-12 09:50:17 +0000
commit78d32fb722160149b58efdea9e1bf8865786ee9f (patch)
treec85bc5c0fa292c47303a2499d61d7e7886b14cc8 /lib/libc/sys
parent9428c312c85831539a93248f10813cf842ae1525 (diff)
downloadFreeBSD-src-78d32fb722160149b58efdea9e1bf8865786ee9f.zip
FreeBSD-src-78d32fb722160149b58efdea9e1bf8865786ee9f.tar.gz
Describe in detail required conditions for receiving the SCM_CREDS
control message and suggest to use LOCAL_CREDS setsockopt() for reliability.
Diffstat (limited to 'lib/libc/sys')
-rw-r--r--lib/libc/sys/recv.222
1 files changed, 18 insertions, 4 deletions
diff --git a/lib/libc/sys/recv.2 b/lib/libc/sys/recv.2
index 66f311f..29ff747 100644
--- a/lib/libc/sys/recv.2
+++ b/lib/libc/sys/recv.2
@@ -28,7 +28,7 @@
.\" @(#)recv.2 8.3 (Berkeley) 2/21/94
.\" $FreeBSD$
.\"
-.Dd December 28, 2006
+.Dd September 12, 2012
.Dt RECV 2
.Os
.Sh NAME
@@ -252,8 +252,21 @@ struct cmsgcred {
};
.Ed
.Pp
-The kernel will fill in the credential information of the sending process
-and deliver it to the receiver.
+If a sender supplies ancillary data with enough space for the above struct
+tagged as
+.Dv SCM_CREDS
+control message type to the
+.Fn sendmsg
+system call, then kernel will fill in the credential information of the
+sending process and deliver it to the receiver.
+Since receiver usually has no control over a sender, this method of retrieving
+credential information isn't reliable.
+For reliable retrieval of remote side credentials it is advised to use the
+.Dv LOCAL_CREDS
+socket option on the receiving socket.
+See
+.Xr unix 4
+for details.
.Pp
The
.Fa msg_flags
@@ -322,7 +335,8 @@ address space.
.Xr getsockopt 2 ,
.Xr read 2 ,
.Xr select 2 ,
-.Xr socket 2
+.Xr socket 2 ,
+.Xr unix 4
.Sh HISTORY
The
.Fn recv
OpenPOWER on IntegriCloud