1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-21 07:15:49 +00:00
freebsd/lib/libsys
Mark Johnston bfd03046d1 unix: Add support for atomically setting the socket mode
With this patch, it is possible to call fchmod() on a unix socket prior
to binding it to the filesystem namespace, so that the mode is set
atomically.  Without this, one has to call chmod() after bind(), leaving
a window where threads can connect to the socket with the default mode.
After bind(), fchmod() reverts to failing with EINVAL.

This interface is copied from Linux.

The behaviour of fstat() is unmodified, i.e., it continues to return the
mode as set by soo_stat().

PR:		282393
Reviewed by:	kib
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D47361
2024-11-03 16:46:53 +00:00
..
aarch64
amd64
arm
i386
powerpc
powerpc64
powerpcspe
riscv
x86 Canonicalize the name of the FreeBSD Foundation 2024-10-24 05:03:07 +08:00
__error.c
__getosreldate.c
__vdso_gettimeofday.c
_exit.2
_libsys.h
_umtx_op_err.c
_umtx_op.2 Canonicalize the name of the FreeBSD Foundation 2024-10-24 05:03:07 +08:00
abort2.2
accept.2
access.2
acct.2
adjtime.2
aio_cancel.2
aio_error.2
aio_fsync.2
aio_mlock.2
aio_read.2
aio_return.2
aio_suspend.2
aio_waitcomplete.2
aio_write.2
auxv.3
auxv.c
bind.2
bindat.2
brk.2
cap_enter.2
cap_fcntls_limit.2
cap_ioctls_limit.2
cap_rights_limit.2
chdir.2
chflags.2
chmod.2 unix: Add support for atomically setting the socket mode 2024-11-03 16:46:53 +00:00
chown.2
chroot.2
clock_gettime.2
clock_gettime.c
close.2
closefrom.2
connect.2
connectat.2
copy_file_range.2
cpuset_getaffinity.2
cpuset_getdomain.2
cpuset.2
creat.2
dup.2
eventfd.2
execve.2
extattr_get_file.2
fcntl.2
ffclock.2
fhlink.2
fhopen.2
fhreadlink.2
flock.2
fork.2
fspacectl.2
fsync.2 Canonicalize the name of the FreeBSD Foundation 2024-10-24 05:03:07 +08:00
getdirentries.2
getdtablesize.2
getfh.2
getfsstat.2
getgid.2
getgroups.2
getitimer.2
getlogin.2
getloginclass.2
getpagesize.3
getpagesize.c
getpagesizes.3
getpagesizes.c
getpeername.2
getpgrp.2
getpid.2
getpriority.2
getrandom.2
getrlimit.2
getrlimitusage.2 Canonicalize the name of the FreeBSD Foundation 2024-10-24 05:03:07 +08:00
getrusage.2
getsid.2
getsockname.2
getsockopt.2
gettimeofday.2
gettimeofday.c
getuid.2
interposing_table.c
intro.2
ioctl.2
issetugid.2
jail.2
kcmp.2
kenv.2
kill.2
kldfind.2 linker: Make linker.h more self-contained 2024-10-26 14:05:56 +00:00
kldfirstmod.2 linker: Make linker.h more self-contained 2024-10-26 14:05:56 +00:00
kldload.2 linker: Make linker.h more self-contained 2024-10-26 14:05:56 +00:00
kldnext.2 linker: Make linker.h more self-contained 2024-10-26 14:05:56 +00:00
kldstat.2 linker: Make linker.h more self-contained 2024-10-26 14:05:56 +00:00
kldsym.2 linker: Make linker.h more self-contained 2024-10-26 14:05:56 +00:00
kldunload.2 linker: Make linker.h more self-contained 2024-10-26 14:05:56 +00:00
kqueue.2
ktrace.2
libc_stubs.c
libsys_sigwait.c
libsys.h
link.2
lio_listio.2
listen.2
lockf.3
lseek.2
madvise.2
Makefile
Makefile.depend
Makefile.sys libsys: remove yield special case 2024-11-01 15:45:04 +00:00
membarrier.2 membarrier: man page improvements 2024-10-19 16:18:18 -04:00
mincore.2
minherit.2
mkdir.2
mkfifo.2
mknod.2
mlock.2
mlockall.2
mmap.2
modfind.2
modnext.2
modstat.2
mount.2
mprotect.2
mq_close.2
mq_getattr.2
mq_notify.2
mq_open.2
mq_receive.2
mq_send.2
mq_setattr.2
mq_unlink.2
msgctl.2
msgget.2
msgrcv.2
msgsnd.2
msync.2
munmap.2
nanosleep.2
nfssvc.2
ntp_adjtime.2
open.2
pathconf.2
pdfork.2
pipe.2
poll.2
posix_fadvise.2
posix_fallocate.2
posix_openpt.2
procctl.2
profil.2
pselect.2
ptrace.2
ptrace.c
quotactl.2
rctl_add_rule.2
read.2
readlink.2
reboot.2
recv.2
recvmmsg.c
rename.2
revoke.2
rfork_thread.3
rfork.2
rmdir.2
rtprio.2
sched_get_priority_max.2
sched_getcpu_gen.c
sched_setparam.2
sched_setscheduler.2
sched_yield.2
sctp_generic_recvmsg.2
sctp_generic_sendmsg.2
sctp_peeloff.2
select.2
semctl.2
semget.2
semop.2
send.2
sendfile.2
sendmmsg.c
setfib.2
setgroups.2
setpgid.2
setregid.2
setresuid.2
setreuid.2
setsid.2
setuid.2
shm_open.2
shmat.2
shmctl.2
shmget.2
shutdown.2
sigaction.2
sigaltstack.2
sigfastblock.2 Canonicalize the name of the FreeBSD Foundation 2024-10-24 05:03:07 +08:00
sigpending.2
sigprocmask.2
sigqueue.2
sigreturn.2
sigstack.2
sigsuspend.2
sigwait.2
sigwaitinfo.2
sleep.3
socket.2
socketpair.2
stat.2
statfs.2
swapon.2
Symbol.map
Symbol.sys.map
Symbol.thr.map
symlink.2
sync.2
sysarch.2
syscall.2
syscalls.map
thr_exit.2 Canonicalize the name of the FreeBSD Foundation 2024-10-24 05:03:07 +08:00
thr_kill.2 Canonicalize the name of the FreeBSD Foundation 2024-10-24 05:03:07 +08:00
thr_new.2 Canonicalize the name of the FreeBSD Foundation 2024-10-24 05:03:07 +08:00
thr_self.2 Canonicalize the name of the FreeBSD Foundation 2024-10-24 05:03:07 +08:00
thr_set_name.2 Canonicalize the name of the FreeBSD Foundation 2024-10-24 05:03:07 +08:00
thr_suspend.2 Canonicalize the name of the FreeBSD Foundation 2024-10-24 05:03:07 +08:00
thr_wake.2 Canonicalize the name of the FreeBSD Foundation 2024-10-24 05:03:07 +08:00
timer_create.2
timer_delete.2
timer_settime.2
timerfd.2
truncate.2
umask.2
undelete.2
unlink.2
usleep.3
utimensat.2
utimes.2
utrace.2
uuidgen.2
vfork.2
wait.2
write.2