History log of /freebsd-current/usr.sbin/pw/pw_vpw.c
Revision Date Author Comments
# eba230af 25-Sep-2023 John Baldwin <jhb@FreeBSD.org>

Purge more stray embedded $FreeBSD$ strings

These do not use __FBSDID but instead use bare char arrays.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41957


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# 029a2d65 27-Jul-2018 Ian Lepore <ian@FreeBSD.org>

Remove some code that's no longer needed because it's now part of pw_scan(3).
It was also leading to segfaults; pw can be NULL when control reaches these
lines now, because of the way my previous change restructured the loops.

Reported by: lwhsu@


# 3196b508 26-Jul-2018 Ian Lepore <ian@FreeBSD.org>

Re-apply r336625 which was reverted with r336638, now that the underlying
pw_scan(3) has been fixed in a way that doesn't perturb other callers of
it or the getpwnam(3) family.

Make pw(8) showuser work the same with or without -R <path> for non-root
users. Without -R, pw(8) uses getpwnam(3), which will open master.passwd
for the root user or passwd for non-root users. With -R <path> pw(8) was
always opening <path>/master.passwd, which would fail for a non-root user,
then falsely claim the userid you're trying to show doesn't exist.

Now for a non-root user it opens <path>/passwd, and populates the fields in
the returned struct passwd which aren't present in that file with well-known
canonical values, which duplicates the behavior of getpwnam(3). The net
effect is that the showuser output is identical whether using -R or not.


# d05db9a4 23-Jul-2018 Ian Lepore <ian@FreeBSD.org>

Revert r336625 until I figure out why it worked with simple testing but
reportedly fails the kyua tests and causes other real-world problems.

Reported by: cy@ asomers@


# 1a61d993 22-Jul-2018 Ian Lepore <ian@FreeBSD.org>

Make pw(8) showuser work the same with or without -R <path> for non-root
users. Without -R, pw(8) uses getpwnam(3), which will open master.passwd
for the root user or passwd for non-root users. With -R <path> pw(8) was
always opening <path>/master.passwd, which would fail for a non-root user,
then falsely claim the userid you're trying to show doesn't exist.

Now for a non-root user it opens <path>/passwd and zeroes out the 3 fields
that aren't available in the passwd file, which duplicates the behavior of
getpwnam(3). The net effect is that the showuser output is identical
whether using -R or not.


# 1de7b4b8 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

various: general adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.


# 9c242913 31-Jul-2016 Ed Schouten <ed@FreeBSD.org>

Fix up setgrent(3) to have a POSIX-compliant prototype.

Just like with freelocale(3), I haven't been able to find any piece of
code that actually makes use of this function's return value, both in
base and in ports. The reason for this is that FreeBSD seems to be the
only operating system to have such a prototype. This is why I'm deciding
to not use symbol versioning for this.

It does seem that the pw(8) utility depends on the function's typing and
already had a switch in place to toggle between the FreeBSD and POSIX
variant of this function. Clean this up by always expecting the POSIX
variant.

There is also a single port that has a couple of local declarations of
setgrent(3) that need to be patched up. This is in the process of being
fixed.

PR: 211394 (exp-run)


# 7556d9b0 29-Jul-2016 Baptiste Daroussin <bapt@FreeBSD.org>

Remove usage of _WITH_GETLINE from usr.sbin


# 41328b44 26-Mar-2016 Baptiste Daroussin <bapt@FreeBSD.org>

Remove some unneeded headers

Found by 'include-what-you-use'


# 4fc9390e 28-Dec-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove useless assignement of linelen


# 59856c7d 07-Jul-2015 Baptiste Daroussin <bapt@FreeBSD.org>

pw: fail if an invalid entry is found while parsing master.passwd and group

PR: 198554
Reported by: diaran <fbsd@centraltech.co.uk>
MFC after: 2 days


# b3075010 27-Dec-2012 Baptiste Daroussin <bapt@FreeBSD.org>

Simplify vnextgrent and vnextpwent reusing pw_scan and gr_scan from libutil.


# fb2db031 30-Oct-2012 Baptiste Daroussin <bapt@FreeBSD.org>

Teach pw(8) about how to use pw/gr API to reduce code duplication

MFC after: 2 months


# 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.


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

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


# b8938b66 17-Jun-2004 Robert Drehmel <robert@FreeBSD.org>

Use strlcpy(3) to replace the idiomatic

strncpy(d, s, l);
d[l - 1] = '\0';

statements.


# 923dc0b2 14-Jan-2000 David Nugent <davidn@FreeBSD.org>

Portability fixes for other bsd4.4 derivatives.


# 97d92980 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# 5f12594a 23-Feb-1999 David Nugent <davidn@FreeBSD.org>

1) Do not blindly ignore file update errors which may occur due to concurrent
updating
2) Add -V <etcdir>, which allows maintaining user/group database in alternate
locations other than /etc.