summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* pw: add some basic testcases for groupshow and usershowEnji Cooper2017-05-283-1/+115
| | | | | | | | - groupshow: test out -a/-g/-n . - usershow: test out -a/-n/-u . MFC after: 1 week Sponsored by: Dell EMC Isilon
* Don't depend on assert(3) getting evaluatedAlan Somers2017-05-101-1/+3
| | | | | | | Reported by: imp MFC after: 3 weeks X-MFC-With: 318141, 318143 Sponsored by: Spectra Logic Corp
* strcpy => strlcpyAlan Somers2017-05-101-1/+3
| | | | | | | Reported by: Coverity CID: 1006715 MFC after: 3 weeks Sponsored by: Spectra Logic Corp
* Add a regression test for r31512 fixBaptiste Daroussin2017-03-251-0/+14
| | | | | PR: 217934 MFC after: 1 week
* Properly initialise with content of pw.conf(5) that was mistakenly ignored.Eugene Grosbein2017-03-241-2/+5
| | | | | | | | | | Also, respect "defaultgroup" if specified there. PR: 217934 Reported by: Victor Sudakov <vas@mpeks.tomsk.su> Reviewed by: bapt Approved by: bapt, vsevolod (mentor) MFC after: 1 week
* Rename tests from <foo> to <foo>_test to match the FreeBSD test suiteEnji Cooper2017-03-2311-10/+10
| | | | | | | | | | naming scheme usr.bin/diff/diff_test was renamed to usr.bin/diff/netbsd_diff_test to avoid collisions with the renamed FreeBSD test. MFC after: 1 week Sponsored by: Dell EMC Isilon
* Increase WARNS for pw testsAlan Somers2017-03-111-0/+1
| | | | | | | | | ATF tests have a default WARNS of 0, unlike other usermode programs. Reviewed by: ngie, julian MFC after: 3 weeks Sponsored by: Spectra Logic Corporation Differential Revision: https://reviews.freebsd.org/D9933
* Really restore the old behaviour for pw usermod -mBaptiste Daroussin2017-01-223-14/+25
| | | | | | | | It again reinstall missing skel files without overwriting changed one Add a regression test about it Reported by: ae MFC after: 3 days
* Readd a feature lost in pw(8) refactoringBaptiste Daroussin2017-01-221-0/+4
| | | | | | | | | | pw usermod foo -m It used to be able to (re)create the home directory if it didn't exists PR: 216224 Reported by: ae MFC after: 3 days
* Fix pkg groupshow <gid>Baptiste Daroussin2016-12-101-1/+1
| | | | | | PR: 204676 Submitted by: longwitz@incore.de MFC after: 2 days
* Speed up pw operations that edit /etc/group or /etc/passwdAlan Somers2016-11-183-0/+3
| | | | | | | | | | | | | | r285050 fixed a bug in pw that could lead to /etc/passwd or /etc/group corruption on power loss. However, it fixed it by opening those files with O_SYNC, which is very slow, especially on ZFS. This change replaces O_SYNC with appropriately placed fsync()s instead, which is much faster. Using a ZFS tmpdir, the time to run pw's kyua tests drops from 245s to 35s. Reviewed by: allanjude, bapt, vangyzen, garga Tested on pfSense by: garga MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D8319
* Close some file descriptor leaks in pwAlan Somers2016-10-213-0/+8
| | | | | | MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D8245
* Add another badly-needed simple example to the pw(8) man page.Warren Block2016-09-131-1/+6
|
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2016-08-311-0/+7
| | | | Sponsored by: EMC / Isilon Storage Division
* Fix up setgrent(3) to have a POSIX-compliant prototype.Ed Schouten2016-07-312-12/+3
| | | | | | | | | | | | | | | | | | | 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-302-2/+0
|
* Do not try to delete the home of the user if is is not a directory for exampleBaptiste Daroussin2016-07-232-0/+12
| | | | | | | | | "/dev/null" PR: 211195 Submitted by: rday <ryan@ryanday.net> Reported by: eniorm <eniorm@gmail.com> MFC after: 1 day
* pw should sanitize the argument of -w.Alan Somers2016-07-137-15/+177
| | | | | | | | | | | | | | | | | | | | | | | | Otherwise, it will silently disable the login for the selected account if the argument is unrecognizable. usr.sbin/pw/pw.h usr.sbin/pw/pw_conf.c usr.sbin/pw/pw_user.c Use separate rules to validate boolean parameters and passwd parameters. Error out if a password parameter cannot be parsed. usr.sbin/pw/tests/Makefile usr.sbin/pw/tests/crypt.c usr.sbin/pw/tests/pw_useradd.sh usr.sbin/pw/tests/pw_usermod.sh Add tests for the validation. Also, enhance existing password-related tests to actually validate that the correct hash is written to master.passwd. Reviewed by: bapt MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6840
* Fix typo preventing pw {user,group}next -C from working as expectedBaptiste Daroussin2016-06-042-2/+2
| | | | | Reported by: Mike Selnet via forums.freebsd.org MFC after: 3 days
* Fix CID 1006692 in /usr/sbin/pw pw_log() function and other fixesDon Lewis2016-05-241-21/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | The length of the name returned from the $LOGNAME and $USER can be very long and it was being concatenated to a fixed length buffer with no bounds checking. Fix this problem by limiting the length of the name copied. Additionally, this name is actually used to create a format string to be used in adding log file entries so embedded % characters in the name could confuse *printf(), and embedded whitespace could confuse a log file parser. Handle the former by escaping each % with an additional %, and handle the latter by simply stripping it out. Clean up the code by moving the variable declarations to the top of the function, formatting them to conform with style, and moving intialization elsewhere. Reduce code indentation by returning early in a couple of places. Reported by: Coverity CID: 1006692 Reviewed by: markj (previous version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6490
* Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedEnji Cooper2016-05-041-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after r298107 Summary of changes: - Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed - Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc - Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously. - Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk - Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk. - Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo - Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup) Document the proposed changes in share/examples/tests/tests/... via examples so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of replacing FILES. share/mk/bsd.README didn't seem like the appropriate method of communicating that info. MFC after: never probably X-MFC with: r298107 PR: 209114 Relnotes: yes Tested with: buildworld, installworld, checkworld; buildworld, packageworld Sponsored by: EMC / Isilon Storage Division
* Add a single example of adding a user that roughly corresponds with theWarren Block2016-04-231-1/+13
| | | | | | adduser example in the Handbook. MFC after: 1 week
* MFHGlen Barber2016-04-130-0/+0
|\ | | | | | | Sponsored by: The FreeBSD Foundation
* | MFHGlen Barber2016-04-130-0/+0
|\| | | | | | | Sponsored by: The FreeBSD Foundation
* | MFHGlen Barber2016-04-120-0/+0
|\| | | | | | | Sponsored by: The FreeBSD Foundation
* | MFHGlen Barber2016-04-110-0/+0
|\| | | | | | | Sponsored by: The FreeBSD Foundation
* | MFHGlen Barber2016-04-060-0/+0
|\| | | | | | | Sponsored by: The FreeBSD Foundation
* | MFHGlen Barber2016-04-045-18/+9
|\| | | | | | | Sponsored by: The FreeBSD Foundation
| * Adjust misleading wording of the -G option and simplify a fewWarren Block2016-03-281-11/+9
| | | | | | | | | | | | surrounding sentences. From a discussion on -ports. Reviewed by: David Wolfskill <david@catwhisker.org>
| * Remove some unneeded headersBaptiste Daroussin2016-03-264-7/+0
| | | | | | | | Found by 'include-what-you-use'
* | MFHGlen Barber2016-03-101-0/+11
|\| | | | | | | Sponsored by: The FreeBSD Foundation
| * DIRDEPS_BUILD: Connect MK_TESTS.Bryan Drewery2016-03-091-0/+11
| | | | | | | | Sponsored by: EMC / Isilon Storage Division
* | MFHGlen Barber2016-03-060-0/+0
|\| | | | | | | Sponsored by: The FreeBSD Foundation
* | MFHGlen Barber2016-03-020-0/+0
|\| | | | | | | Sponsored by: The FreeBSD Foundation
* | MFHGlen Barber2016-03-021-1/+1
|\| | | | | | | Sponsored by: The FreeBSD Foundation
| * Fix a typo that prevented pw(8) from setting a user's UID to 0.Mark Johnston2016-03-021-1/+1
| | | | | | | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* | MFHGlen Barber2016-02-230-0/+0
|\| | | | | | | Sponsored by: The FreeBSD Foundation
* | MFHGlen Barber2016-02-220-0/+0
|\| | | | | | | Sponsored by: The FreeBSD Foundation
* | MFHGlen Barber2016-02-150-0/+0
|\| | | | | | | Sponsored by: The FreeBSD Foundation
* | MFHGlen Barber2016-02-100-0/+0
|\| | | | | | | Sponsored by: The FreeBSD Foundation
* | MFHGlen Barber2016-02-080-0/+0
|\| | | | | | | Sponsored by: The FreeBSD Foundation
* | MFHGlen Barber2016-02-030-0/+0
|\| | | | | | | Sponsored by: The FreeBSD Foundation
* | MFHGlen Barber2016-02-020-0/+0
|\| | | | | | | Sponsored by: The FreeBSD Foundation
* | First pass to fix the 'tests' packages.Glen Barber2016-02-021-0/+4
| | | | | | | | Sponsored by: The FreeBSD Foundation
* | MFHGlen Barber2016-01-290-0/+0
|\| | | | | | | Sponsored by: The FreeBSD Foundation
* | MFHGlen Barber2016-01-270-0/+0
|\| | | | | | | Sponsored by: The FreeBSD Foundation
* | MFHGlen Barber2016-01-250-0/+0
|\| | | | | | | Sponsored by: The FreeBSD Foundation
* | MFHGlen Barber2016-01-200-0/+0
|\| | | | | | | Sponsored by: The FreeBSD Foundation
* | MFHGlen Barber2016-01-140-0/+0
|\| | | | | | | Sponsored by: The FreeBSD Foundation
* | MFHGlen Barber2016-01-130-0/+0
|\| | | | | | | Sponsored by: The FreeBSD Foundation