History log of /freebsd-current/lib/libutil/login_cap.c
Revision Date Author Comments
# 90e914cd 20-Jun-2023 Olivier Certner <olce@FreeBSD.org>

New login_getcapenum(): Allows to read named enum values

Reviewed by: emaste
Approved by: emaste (mentor)
MFC after: 3 days
Sponsored by: Kumacom SAS
Differential Revision: https://reviews.freebsd.org/D40684


# a2f733ab 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

lib: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix


# b8c1aade 25-May-2023 Olivier Certner <olce.freebsd@certner.fr>

login_cap.c: Don't set errno to ERANGE on memory allocation failure

Modified functions: login_getcaptime(), login_getcapnum(),
login_getcapsize().

They all call cgetstr(), which returns -2 on such conditions and already
sets errno to ENOMEM, arguably the appropriate value for these functions
as well.

No in-tree consumer currently checks for errno on error reported by
these functions, so this change has no other code impact.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: Kumacom SAS
Differential Revision: https://reviews.freebsd.org/D40342


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 9df529b8 23-Jul-2023 Xin LI <delphij@FreeBSD.org>

login_getclassbyname(3): use calloc.


# f32db406 14-Jan-2023 Sean Eric Fagan <sef@FreeBSD.org>

Allow a comma-separated list in login class capabilities,
by adding a version of strcspn that allows quoting.


# efa8af7c 21-Apr-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

lib: initial use of reallocarray(3).

Make some use of reallocarray, attempting to limit it to cases where the
parameters are unsigned and there is some theoretical chance of overflow.

MFC afer: 2 weeks
Differential Revision: https://reviews.freebsd.org/D9980


# 872a3a62 18-May-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

libutil: minor spelling fixes.


# d1d4d952 28-Aug-2013 Jilles Tjoelker <jilles@FreeBSD.org>

libutil: Use O_CLOEXEC for internal file descriptors from open().


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# ea234e65 04-Nov-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

MFH (r184633, r184635): build at WARNS level 6


# b8a5cd86 04-Nov-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

Avoid assigning a const char * to a char *.

MFC after: 3 weeks


# 06927900 04-Nov-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

Committed to wrong branch.


# e37e92fe 04-Nov-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

Avoid assigning a const char * to a char *.

MFC after: 3 weeks


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# a7429823 14-Jun-2007 Yaroslav Tykhiy <ytykhiy@gmail.com>

Update some comments, mostly regarding LOGIN_MECLASS and ~/.login_conf.


# 043d661d 22-Apr-2005 Tom Rhodes <trhodes@FreeBSD.org>

Properly spell default in a comment.


# 94cf9da0 11-May-2004 Diomidis Spinellis <dds@FreeBSD.org>

Bring the description for login_getclassbyname in sync with the function's
arguments. The function has as a second argument a struct passwd * pointer,
not a directory name.

MFC after: 2 weeks


# 05bcd1d0 25-Oct-2003 Peter Wemm <peter@FreeBSD.org>

(mostly) Clean up some const warnings here. The code takes some liberties
because it is the originator of various const strings and knows that they
came from malloc.


# 547fa0d9 18-Oct-2003 Mark Murray <markm@FreeBSD.org>

ANSIfy, WARNSify, CONSTify. Bit of style(9)-ify.


# 0ebec5d3 14-Jun-2003 Mark Murray <markm@FreeBSD.org>

Tidy up. Sort headers.


# 7fed38d0 25-Aug-2002 Philippe Charnier <charnier@FreeBSD.org>

Replace various spelling with FALLTHROUGH which is lint()able


# b00ba4cc 08-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Const poisoning.


# 40e0f7de 06-Mar-2002 Dag-Erling Smørgrav <des@FreeBSD.org>

Remove a bogus cast.


# 8719c58f 30-Sep-2001 Matthew Dillon <dillon@FreeBSD.org>

Add __FBSDID()s to libutil


# e36b245c 25-Sep-2001 Andrey A. Chernov <ache@FreeBSD.org>

1) Back out ~/.login_conf disable
2) Pick only "me" class from ~/.login_conf as documented


# 35105a5f 16-Sep-2001 Robert Watson <rwatson@FreeBSD.org>

Disable per-user .login_conf support due to incorrect merging of local
and globaly settings. An alternative implementation will be developed.

Reported by: Przemyslaw Frasunek <venglin@freebsd.lublin.pl>


# 8df8b73f 15-Sep-2001 Robert Watson <rwatson@FreeBSD.org>

o Add a comment noting that the early setting of privileges for the purpose
of NFS home directory and root directory processing fails to include
additional groups. This doesn't impact the final credential, but does
mean that users may be denied login even when additional groups might
allow it.


# 9a01d32b 06-Feb-2001 Jeroen Ruigrok van der Werven <asmodai@FreeBSD.org>

Fix typo: seperate -> separate.

Seperate does not exist in the english language.

Submitted to look at by: kris


# c2534fa1 22-Aug-2000 Brian Feldman <green@FreeBSD.org>

Stick login_setcryptfmt() in its own file to make pulling in of
-lcrypt only happen if truly necessary.


# 04c9749f 21-Aug-2000 Brian Feldman <green@FreeBSD.org>

Add working and easy crypt(3)-switching. Yes, we need a whole new API
for crypt(3) by now. In any case:

Add crypt_set_format(3) + documentation to -lcrypt.
Add login_setcryptfmt(3) + documentation to -lutil.
Support for switching crypt formats in passwd(8).
Support for switching crypt formats in pw(8).

The simple synopsis is:
edit login.conf; add a passwd_format field set to "des" or "md5"; go nuts :)

Reviewed by: peter


# 3f81737f 20-May-2000 Tim Vanderhoek <hoek@FreeBSD.org>

Fix a memory leak with lc->lc_cap in login_close().

PR: bin/17084


# 7f3dea24 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# 8a2deaa1 24-Apr-1999 Andrey A. Chernov <ache@FreeBSD.org>

oops, add pwd!=NULL check to previous fix


# ae702574 24-Apr-1999 Andrey A. Chernov <ache@FreeBSD.org>

Switch to user UID/GID before checking/reading its ~/.login_conf
- some NFSes have root read access disabled


# c2043f40 13-Jun-1997 David Nugent <davidn@FreeBSD.org>

Add "break" inadvertently removed in previous update.
PR: 3820
Submitted by: Joseph Stein <joes@spiritone.com>


# 5f3a7367 11-May-1997 David Nugent <davidn@FreeBSD.org>

MF2.2: bugfix in arrayize().


# 56c04344 10-May-1997 David Nugent <davidn@FreeBSD.org>

Summary of login.conf support changes:

o Incorporated BSDI code and enhancements, better logging for error
checking (which has been shown to be a problem, and is therefore
justified, imho); also some minor things we were missing, including
better quad_t math, which checks for under/overflows.

o setusercontext() now allows user resource limit overrides, but
does this AFTER dropping root privs, to restrict the user to
droping hard limits and set soft limits within the kernel's
allowed user limits.

o umask() only set once, and only if requested.

o add _secure_path(), and use in login.conf to guard against
symlinks etc. and non-root owned or non-user owned files being
used. Derived from BSDI contributed code.

o revamped authentication code to BSDI's latest api, which
includes deleting authenticate() and adding auth_check()
and a few other functions. This is still marked as depecated
in BSDI, but is included for completeness. No other source
in the tree uses this anyway, so it is now bracketed with
#ifdef LOGIN_CAP_AUTH which is by default not defined. Only
auth_checknologin() and auth_cat() are actually used in
module login_auth.c.

o AUTH_NONE definition removed (collided with other includes
in the tree). [bde]

o BSDI's login_getclass() now accepts a char *classname
parameter rather than struct passwd *pwd. We now do likewise,
but added login_getpwclass() for (sort of) backwards
compatiblity, namely because we handle root as a special
case for the default class. This will require quite a few
changes elsewhere in the source tree.

o We no longer pretend to support rlim_t as a long type.

o Revised code formatting to be more bsd-ish style.


# 65f50b7f 26-Feb-1997 Andrey A. Chernov <ache@FreeBSD.org>

"infinity" check was missed from login_getcapsize(), add it

One manifestation of this bug: all networking users have coredumpsize=0


# 7e546392 22-Feb-1997 Peter Wemm <peter@FreeBSD.org>

Revert $FreeBSD$ to $Id$


# 2955fda4 29-Jan-1997 David Nugent <davidn@FreeBSD.org>

Fix free()ing block twice, remove unused function.


# f01e3989 28-Jan-1997 David Nugent <davidn@FreeBSD.org>

Fix typo .->, for default separators in login_getcaplist().


# f9074e29 28-Jan-1997 David Nugent <davidn@FreeBSD.org>

Completed fixes with login_getcapsize().


# 51706563 28-Jan-1997 David Nugent <davidn@FreeBSD.org>

1) Fixed bug in free()ing internal string/array where
allocated size not reset to 0 causing NULL dereference
on call after login_close().
2) Modify login_capsize() behaviour to match manpage, allow
concatenated sizes; ie. 10m500k


# 1130b656 14-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 1c594de5 07-Jan-1997 David Nugent <davidn@FreeBSD.org>

Various bugfixes.


# 65fa0ae1 07-Jan-1997 David Nugent <davidn@FreeBSD.org>

Commit the right version this time. :-)


# 2dc7d862 07-Jan-1997 David Nugent <davidn@FreeBSD.org>

Fix for login_getclass(NULL) case.


# 68bbf3ad 04-Jan-1997 David Nugent <davidn@FreeBSD.org>

Library functions relating to the login class capabilities database,
including manpages.
See also login_cap.h.