summaryrefslogtreecommitdiffstats
path: root/usr.bin/chpass (follow)
Commit message (Collapse)AuthorAgeFilesLines
* correct some unveil(2) violations due to "login.conf.db" access (the .db versionsemarie2019-09-141-2/+2
| | | | | | | | | | of "login.conf"), and stat(2) on _PATH_MASTERPASSWD_LOCK (via pw_mkdb(3)). problem initially noted by myself for passwd(1) millert@ reported similar problem on chpass(1), su(1), doas(1) and encrypt(1) mestre@ noted chpass(1) too ok mestre@ millert@
* add unveil(2):mestre2019-04-301-3/+17
| | | | | | | | | | | | | | | | | | | | | | chpass(1) without parameters enters in edit mode by default, in here it will need to execute _PATH_BSHELL to spawn a new EDITOR, _PATH_SHELLS to check (read) if we are changing from/to a non-standard shell (in case we are not root) and read access to `tempname' to verify if the file has valid entries and create to unlink it. If -s is used to change a user's shell then it will need read access to _PATH_SHELLS by the same reason already mentioned above. Unconditionally we need to unveil _PATH_MASTERPASSWD_LOCK with write/create permissions, _PATH_MASTERPASSWD with read and _PATH_PWD_MKDB to execute pwd_mkdb(8). In the -a case I'm not unveiling /etc/spwd.db since we can get it through pledge "getpw", which can be added later for completeness of all code paths. Note also that the first pledges need "unveil" since we will call unveil(2) afterwards. "looks good" deraadt@
* add some missing "pp." to .%P macros;schwarze2019-04-231-3/+3
| | | | Fabio Scotoni <fabio at esse dot ch> reported it was missing in eqn(7)
* Convert snprintf+write into dprintf. It is simply easier to read, andderaadt2017-12-081-15/+3
| | | | | provides retry on short-write file descriptors. ok florian, previous versions seen by millert
* for some time now mandoc has not required MLINKS to functionjmc2016-03-301-2/+1
| | | | | | | | | | | | correctly - logically complete that now by removing MLINKS from base; authors need only to ensure there is an entry in NAME for any function/ util being added. MLINKS will still work, and remain for perl to ease upgrades; ok nicm (curses) bcook (ssl) ok schwarze, who provided a lot of feedback and assistance ok tb natano jung
* Delete YP password related code. As a result, these can also bederaadt2015-11-265-386/+28
| | | | | | pledged. Keep an eye out for regressions, because they could be uncomfortable. ok beck semarie
* needs _shadow so it can rewrite the master.passwd filetedu2015-11-181-4/+4
|
* Supply DEF_WEAK() macro to suppress warnings during compilation viaguenther2015-09-141-2/+3
| | | | | | reach-around into libc noted by daniel@
* tzfile.h is an internal header that should never have been installed.millert2015-03-151-2/+1
| | | | | | | | | What's worse, the tzfile.h that gets installed is over 20 years old and doesn't match the real tzfile.h in libc/time. This makes the tree safe for /usr/include/tzfile.h removal. The TM_YEAR_BASE define has been moved to time.h temporarily until its usage is replaced by 1900 in the tree. Actual removal of tzfile.h is pending a ports build. Based on a diff from deraadt@
* Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt2015-01-163-7/+5
| | | | | | | | | possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
* Reduce instances of `` '' in manuals.bentley2014-11-151-3/+5
| | | | | | | | | | | | troff displays these as typographic quotes, but nroff implementations almost always print them literally, which rarely has the intended effect with modern fonts, even in stock xterm. These uses of `` '' can be replaced either with more semantic alternatives or with Dq, which prints typographic quotes in a UTF-8 locale (but will automatically fall back to `` '' in an ASCII locale). improvements and ok schwarze@
* Prefer mkostemp(O_CLOEXEC) over mkstemp()+fcntl(F_SETFD)guenther2014-10-261-3/+3
| | | | | | Prefer fopen("re") over fopen("r")+fcntl(F_SETFD) ok otto@ millert@
* fix bibliographical references; from Jan Stary <hans at stare dot cz>schwarze2014-02-161-3/+8
| | | | feedback and ok jmc@
* unsigned char casts for ctypederaadt2013-11-262-6/+7
| | | | ok krw
* some Bx/Ox conversion;jmc2013-08-141-3/+5
| | | | From: Jan Stary
* - use FD_CLOEXEC instead of 1okan2013-04-181-4/+4
| | | | | | | | - use O_CLOEXEC with open() instead of open/fcntl from David Hill ok otto@
* Correct English just like jsing@ did it in passwd/local_passwd.c rev. 1.38schwarze2012-06-202-7/+5
| | | | | | on April 27, 2008. While here, fix a typo and drop an obsolete BUGS section. "my typo so OK millert@ :-)" and OK jmc@
* sync the descriptions of /etc/passwd;jmc2012-06-191-3/+3
| | | | | issue spotted by f5b help/ok schwarze
* rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt2009-10-276-59/+6
| | | | | | | unmaintainable). these days, people use source. these id's do not provide any benefit, and do hurt the small install media (the 33,000 line diff is essentially mechanical) ok with the idea millert, ok dms
* use the UNIX-related macros (.At and .Ux) where appropriate.sobrado2009-10-221-4/+5
| | | | ok jmc@
* fix previous, admin may again set non-standard shell; ok millert@jacekm2009-04-301-3/+4
|
* Call endusershell() at the end of ok_shell(), making a copy of themillert2009-03-054-19/+21
| | | | (possibly) expanded shell as needed. OK deraadt@
* in a secure YP context, a chpass would whack the user's password to *deraadt2009-02-151-22/+28
| | | | which is clearly not the intent. PR 4177, fix from schwarze@usta.de
* strptime() never sets tm_isdst, so set it to -1 before passing theguenther2008-12-161-2/+3
| | | | | | | struct tm to mktime() so that the calculation will follow the local DST rules ok millert@ otto@
* remove unused variablechl2008-10-091-3/+2
| | | | ok millert@ jsing@
* fix double "usage:"sobrado2008-07-081-4/+4
|
* fix compilation for !YP case; ok millert@djm2008-07-041-2/+3
|
* implement getpwnam_r() and getpwuid_r() -- very nearly a rewrite of thederaadt2008-06-241-2/+2
| | | | entire file. much help from kurt, and tested by many
* Moved the unset of TZ environment variable out of atot into main, removingtobias2008-06-192-11/+11
| | | | | | an unused static var and test out of atot. With input by jsing and millert, ok millert
* Use mtimespec instead of mtime when comparing the timestamp of the editedmillert2007-11-171-3/+3
| | | | file. OK miod@
* convert to new .Dd format;jmc2007-05-311-2/+2
|
* -a requires a separate synopsis;jmc2007-03-272-7/+11
| | | | | | from Daniel Polak via henning ok henning
* remove some bogus *p tests from charles longeautedu2007-03-201-3/+3
| | | | ok deraadt millert
* Fix -a when given an entry with an already existing user. Also, giveotto2007-01-151-4/+7
| | | | | error message if a user arg has been given with -a. Noted by Dan Brosemer. ok millert@ jaredy@
* tiny bits of lintderaadt2006-03-312-11/+7
|
* cast to uid_t where needed; ok deraadt@robert2006-03-301-4/+4
|
* use size_t where needed; ok deraadt@robert2006-03-301-3/+4
|
* ARGSUSED on signal handlerderaadt2005-12-121-2/+3
|
* use asprintfderaadt2005-11-141-18/+8
|
* move two snprintf out so easier to auditderaadt2005-04-111-5/+7
|
* Use strtonum() instead of assigning the value of strtoul() to a uid_t/gid_t.millert2004-07-051-16/+17
| | | | Fixes a warning on 64bit platforms and is less error-prone. OK otto@
* unbreak chsh, ok millertwilfried2004-05-101-10/+10
|
* Adapt to new pw_copy() API, closes PR 3698.millert2004-04-201-5/+12
|
* This is ISO C, use string concatenation, instead of bogus use of __CONCAT.espie2003-11-261-3/+3
| | | | | (hint: "a" and "b" can't be pasted as a valid C token...) okay millert@
* typos from Jared Yanovich;jmc2003-10-201-2/+2
|
* protosderaadt2003-07-021-2/+3
|
* update the table contents as well as the table widthavsm2003-07-011-2/+2
| | | | pointed out by Dr. Mdoc jmc@
* - no need for pathnames.h, just use <paths.h> insteadavsm2003-07-015-49/+11
| | | | | - bump mktemp randomness slightly from 8 -> 10 millert@ ok
* put in a protoderaadt2003-06-251-2/+3
|
* - section reorderjmc2003-06-101-26/+26
| | | | | | | | | - COMPATIBILITY merge - macro cleanup - kill whitespace at EOL - new sentence, new line ssh pages ok markus@