summaryrefslogtreecommitdiffstats
path: root/pw/pw_vpw.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove some code that's no longer needed because it's now part of pw_scan(3).Ian Lepore2018-07-271-12/+0
| | | | | | | 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@
* Re-apply r336625 which was reverted with r336638, now that the underlyingIan Lepore2018-07-261-3/+29
| | | | | | | | | | | | | | | | 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.
* Revert r336625 until I figure out why it worked with simple testing butIan Lepore2018-07-231-29/+3
| | | | | | reportedly fails the kyua tests and causes other real-world problems. Reported by: cy@ asomers@
* Make pw(8) showuser work the same with or without -R <path> for non-rootIan Lepore2018-07-221-3/+29
| | | | | | | | | | | | 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.
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | 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.
* Fix up setgrent(3) to have a POSIX-compliant prototype.Ed Schouten2016-07-311-4/+1
| | | | | | | | | | | | | | | | | | | 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)
* Remove usage of _WITH_GETLINE from usr.sbinBaptiste Daroussin2016-07-301-1/+0
|
* Remove some unneeded headersBaptiste Daroussin2016-03-261-1/+0
| | | | Found by 'include-what-you-use'
* Remove useless assignement of linelenBaptiste Daroussin2015-12-291-2/+0
|
* pw: fail if an invalid entry is found while parsing master.passwd and groupBaptiste Daroussin2015-07-071-0/+7
| | | | | | PR: 198554 Reported by: diaran <fbsd@centraltech.co.uk> MFC after: 2 days
* Simplify vnextgrent and vnextpwent reusing pw_scan and gr_scan from libutil.Baptiste Daroussin2012-12-271-169/+67
|
* Teach pw(8) about how to use pw/gr API to reduce code duplicationBaptiste Daroussin2012-10-301-0/+302
| | | | MFC after: 2 months
* Create the altix project branch. The altix project will add supportMarcel Moolenaar2010-03-101-316/+0
| | | | | | | 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.
* Use strlcpy(3) to replace the idiomaticRobert Drehmel2004-06-171-4/+2
| | | | | | | strncpy(d, s, l); d[l - 1] = '\0'; statements.
* Portability fixes for other bsd4.4 derivatives.David Nugent2000-01-151-1/+3
|
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
|
* 1) Do not blindly ignore file update errors which may occur due to concurrentDavid Nugent1999-02-231-0/+316
updating 2) Add -V <etcdir>, which allows maintaining user/group database in alternate locations other than /etc.