freebsd-src/lib
Olivier Certner e99c28e93b
setusercontext(): umask: Set it only once (in the common case)
Simplify the code and make it more coherent (umask was the only context
setting not modified by setlogincontext() directly).

Preserve the current behavior of not changing the umask if none is
specified in the login class capabilities database, but without the
superfluous umask() dance.  (The only exception to this is that
a special value no user is likely to input in the database now stands
for no specification.)

If some user has a 'umask' override in its '~/.login_conf', the umask
will still be set twice as before (as is the case for all other context
settings overriden in '~/.login_conf').

Log a warning in case of an invalid umask specification.

This change makes it apparent that the value of LOGIN_DEFUMASK doesn't
matter.  It will be removed in a subsequent commit.

PR:                     271747
Reviewed by:            emaste, kib (earlier version)
Approved by:            emaste
MFC after:              3 days
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40344
2024-01-29 22:57:58 +01:00
..
atf Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
clang Add libllvm and liblldb source files to enable WITH_ASAN build 2024-01-27 22:51:08 +01:00
csu lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
flua lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
geom lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
googletest Fix GoogleTest 1.14.0 import 2023-08-18 19:33:58 -07:00
lib9p dirdeps: Update Makefile.depend* files with empty contents 2023-10-29 17:01:04 -04:00
lib80211 Purge more stray embedded $FreeBSD$ strings 2023-09-25 07:54:56 -07:00
libalias Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libarchive Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libauditd Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libbe libbe: handle destroying/renaming temporary/bootonce boot environments 2024-01-29 10:07:49 -05:00
libbearssl libsecureboot: be more verbose about validation failures 2023-12-10 15:13:56 -05:00
libbegemot Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libblacklist Track upstream project rename in contrib/blocklistd 2023-11-03 16:53:04 -04:00
libblocksruntime Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libbluetooth Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
libbsddialog dirdeps: Update Makefile.depend* files with empty contents 2023-10-29 17:01:04 -04:00
libbsdstat Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libbsm Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libbsnmp Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libbz2 Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libc open(2): describe *at behavior for dirfd opened without O_SEARCH 2024-01-29 23:38:48 +02:00
libc++ Add missing /usr/include/c++/v1/__mdspan/mdspan.h header 2023-12-20 20:16:57 +01:00
libc++experimental Merge llvm-project main llvmorg-17-init-19304-gd0b54bb50e51 2023-12-08 18:34:50 +01:00
libc_nonshared Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libcalendar Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libcam lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libcapsicum Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libcasper libcasper: Fix typo (triple T) 2023-12-27 20:24:30 -07:00
libcbor Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libclang_rt Reorganize libclang_rt Makefile and make more lib/arch combos available 2023-12-28 13:57:41 +01:00
libcom_err Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libcompat lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libcompiler_rt Merge commit 4bb2416d42eb from llvm-project (by Jessica Clarke): 2023-09-04 09:33:27 +01:00
libcrypt lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libcuse Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
libcxxrt Merge libcxxrt master 03c83f5a57be8c5b1a29a68de5638744f17d28ba 2024-01-25 18:43:23 +01:00
libdevctl lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libdevdctl libdevdctl: Fix typo (triple S) 2023-12-27 20:24:30 -07:00
libdevinfo lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libdevstat lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libdl Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libdpv lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libdwarf Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libedit lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
libefivar lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libelf Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libelftc Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libevent1 Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libexecinfo lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libexpat Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libfetch lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libfido2 libfido2: update to 1.13.0 2023-09-19 13:06:12 -04:00
libfigpar lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libgcc_eh Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libgcc_s dirdeps: Update/fix Makefile.depend* for toolchain 2023-11-26 20:50:13 -05:00
libgeom lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libgpio libgpio: Fix type mismatch for gpio_pin_[gs]et 2023-11-14 18:34:21 -08:00
libgssapi Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libiconv_modules lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libifconfig libifconfig: Fix bridge status member list 2023-12-21 16:50:27 +01:00
libipsec lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libipt Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libiscsiutil lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libjail lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libkiconv Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libkvm lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libldns Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
liblua dirdeps: Remove $FreeBSD$ 2023-11-26 15:47:54 -05:00
liblutok Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
liblzma dirdeps: Update/fix Makefile.depend* for toolchain 2023-11-26 20:50:13 -05:00
libmagic Disable byteswap.h for now. 2023-09-11 23:24:08 -07:00
libmd lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libmemstat lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libmilter Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libmixer dirdeps: Update Makefile.depend* files with empty contents 2023-10-29 17:01:04 -04:00
libmp Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libmt lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libnetbsd lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libnetgraph lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libnetmap libnetmap: remove interface name validation 2023-12-21 14:43:57 +00:00
libnv lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libomp Merge llvm-project main llvmorg-17-init-19304-gd0b54bb50e51 2023-12-08 18:34:50 +01:00
libopenbsd lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libopencsd Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libpam lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libpathconv Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libpcap dirdeps: Fix libpcap Makefile.depend.options 2023-11-17 11:34:57 -05:00
libpe Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libpfctl libpfctl: introduce a handle-enabled variant of pfctl_add_rule() 2024-01-04 23:10:44 +01:00
libpjdlog lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libpmc jevents: fix bootstrapping on Linux with Clang 16 2023-12-11 21:14:56 -08:00
libpmcstat lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libproc lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libprocstat lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libradius lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libregex dirdeps: Update Makefile.depend* files with empty contents 2023-10-29 17:01:04 -04:00
librpcsec_gss Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
librpcsvc lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
librss lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
librt lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
librtld_db lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libsbuf lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libsdp Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
libsecureboot libsecureboot: be more verbose about validation failures 2023-12-10 15:13:56 -05:00
libsm Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libsmb Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libsmdb Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libsmutil Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libsqlite3 Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libssp lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libssp_nonshared Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libstats dirdeps: Update Makefile.depend* files with empty contents 2023-10-29 17:01:04 -04:00
libstdbuf Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libstdthreads Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libsysdecode lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libtacplus lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libtelnet lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
libthr pthread_attr_get_np(): Use malloc(), report ENOMEM, don't tamper on error 2024-01-10 18:50:19 +01:00
libthread_db lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libucl Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libufs lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libugidfw Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libulog lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libunbound Unbound: Manually update version strings 2023-11-13 16:46:12 -08:00
libusb Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libusbhid lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libutil setusercontext(): umask: Set it only once (in the common case) 2024-01-29 22:57:58 +01:00
libveriexec lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libvgl lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libvmmapi lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libwrap Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libxo dirdeps: Update Makefile.depend* files with empty contents 2023-10-29 17:01:04 -04:00
liby lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
libypclnt Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libz dirdeps: Update/fix Makefile.depend* for toolchain 2023-11-26 20:50:13 -05:00
libzstd libzstd: Explicitly define ZSTD_DISABLE_ASM 2023-08-22 21:01:03 +01:00
msun lib/msun: Cleanup after $FreeBSD$ removal 2024-01-28 17:00:23 +02:00
ncurses ncurses: serialize the tinfo build a little bit 2024-01-23 23:00:36 -06:00
nss_tacplus nss_tacplus: Provide dummy setpwent(), getpwent_r(), endpwent(). 2023-08-31 07:49:57 +00:00
ofed Trim various $FreeBSD$ 2023-10-10 10:34:43 -07:00
tests Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
Makefile.inc Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00