text
stringlengths
0
234
a unique name in the abstract namespace will be generated automatically.
.ip
the value given as an argument to
.br setsockopt (2)
and returned as the result of
.br getsockopt (2)
is an integer boolean flag.
.tp
.b so_passsec
enables receiving of the selinux security label of the peer socket
in an ancillary message of type
.br scm_security
(see below).
.ip
the value given as an argument to
.br setsockopt (2)
and returned as the result of
.br getsockopt (2)
is an integer boolean flag.
.ip
the
.b so_passsec
option is supported for unix domain datagram sockets
.\" commit 877ce7c1b3afd69a9b1caeb1b9964c992641f52a
since linux 2.6.18;
support for unix domain stream sockets was added
.\" commit 37a9a8df8ce9de6ea73349c9ac8bdf6ba4ec4f70
in linux 4.2.
.tp
.br so_peek_off
see
.br socket (7).
.tp
.b so_peercred
this read-only socket option returns the
credentials of the peer process connected to this socket.
the returned credentials are those that were in effect at the time
of the call to
.br connect (2)
or
.br socketpair (2).
.ip
the argument to
.br getsockopt (2)
is a pointer to a
.i ucred
structure; define the
.b _gnu_source
feature test macro to obtain the definition of that structure from
.ir <sys/socket.h> .
.ip
the use of this option is possible only for connected
.b af_unix
stream sockets and for
.b af_unix
stream and datagram socket pairs created using
.br socketpair (2).
.tp
.b so_peersec
this read-only socket option returns the
security context of the peer socket connected to this socket.
by default, this will be the same as the security context of
the process that created the peer socket unless overridden
by the policy or by a process with the required permissions.
.ip
the argument to
.br getsockopt (2)
is a pointer to a buffer of the specified length in bytes
into which the security context string will be copied.
if the buffer length is less than the length of the security
context string, then
.br getsockopt (2)
returns \-1, sets
.i errno
to
.br erange ,
and returns the required length via
.ir optlen .
the caller should allocate at least
.br name_max
bytes for the buffer initially, although this is not guaranteed
to be sufficient.
resizing the buffer to the returned length
and retrying may be necessary.
.ip
the security context string may include a terminating null character
in the returned length, but is not guaranteed to do so: a security
context "foo" might be represented as either {'f','o','o'} of length 3
or {'f','o','o','\\0'} of length 4, which are considered to be
interchangeable.
the string is printable, does not contain non-terminating null characters,
and is in an unspecified encoding (in particular, it
is not guaranteed to be ascii or utf-8).
.ip
the use of this option for sockets in the
.b af_unix
address family is supported since linux 2.6.2 for connected stream sockets,
and since linux 4.18
.\" commit 0b811db2cb2aabc910e53d34ebb95a15997c33e7
also for stream and datagram socket pairs created using