summaryrefslogtreecommitdiffstats
path: root/lib/libutil/passwd.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use strtonum() instead of strtoul() when parsing uid/gid so we getmillert2015-04-241-49/+52
| | | | | | | consistent handling of negative ids on 32bit/64bit systems. The only negative uid/gid allowed is -1 which is special-cased so it can be preserved when writing the new master.passwd file instead of being written as an unsigned number. OK deraadt@
* Use O_CLOEXEC wherever we open a file and then call fcntl(F_SETFD, FD_CLOEXEC)guenther2014-08-151-10/+3
| | | | | | | on it, simplifying error checking, reducing system calls, and improving thread-safety for libraries. ok miod@
* Use %lld and cast to (long long) when printing time_t values and atoll()guenther2013-08-171-9/+10
| | | | | | | when parsing them. Add a couple [ug]id_t --> u_int casts for consistency with rest of code. Based on a diff from Nathanael Rensen (nathanael (at) polymorpheus.com)
* When writing a new record in pw_copy() print the uid and gid asmillert2013-08-061-2/+2
| | | | unsigned, just like we do the existing records. OK deraadt@
* use FD_CLOEXEC instead of 1; from David Hillokan2013-04-291-2/+2
| | | | ok otto
* Don't use err as labels or variables, especially since we includeray2006-12-201-7/+7
| | | | | | err.h. OK moritz@ and jaredy@.
* Always write errno on pw_lock failure so it can be relied on.ray2006-12-171-2/+4
| | | | | | Mention errno, pw_file, and pw_init in pw_lock man page. OK jmc@, otto@, millert@, and deraadt@.
* getting to the bottom of the issues. sprinkle a few casts that willderaadt2006-04-021-2/+2
| | | | | actually help us find bugs later (with lint, not cc), if they get introduced
* scrape $Id$ tags.espie2005-08-021-5/+1
| | | | okay deraadt@, millert@, krw@
* Treat EOF at prompt the same as 'n' instead of looping forever.millert2004-11-041-3/+10
| | | | Noticed by mepch@. OK pedro@ and deraadt@
* passwd.conf has been deprecated since login.conf was imported.millert2004-07-131-145/+2
| | | | Today it finally dies. Based on a diff from Gabriel Kihlman.
* Change pw_copy(3) to take a 3rd arguement, the existing passwd entry.millert2004-04-201-6/+31
| | | | | | | This allows an application to only update a password entry if it is in the state it expects. Additionally, if the old passwd struct is specified the new one may have a different pw_name field since matching is done on the original. Adapted from FreeBSD.
* ansi and protosderaadt2003-06-261-45/+24
|
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-7/+3
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* knfderaadt2003-04-021-3/+3
|
* Throw an error if the username field is empty; noticed by mpech@millert2003-04-011-3/+4
|
* more asprintf; millert okderaadt2003-03-301-5/+3
|
* asprintf; millert okderaadt2003-03-301-5/+4
|
* mark pw_error() __dead since it exitsmillert2002-07-311-3/+3
|
* %u for uid/gid; millert okderaadt2002-06-271-6/+7
|
* some -Wall and spaces cleanup, scsi.c left.fgsch2002-06-091-2/+2
| | | | some brave soul should look at it.
* strlcpy and KNFderaadt2002-05-241-29/+32
|
* Clean up after pw_file().mpech2002-04-101-3/+6
| | | | | millert@ ok deraadt@ ok to commit
* Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.millert2002-02-161-3/+3
|
* Use the volatile specifier to fix warnings about variables beingmillert2002-01-161-6/+4
| | | | clobbered by longjmp / vfork instead of the gcc "(void)&foo;" hack.
* save errno in signal handlerderaadt2001-11-141-2/+4
|
* Change the second arg to pw_mkdb() from a boolean flag to a set ofmillert2001-08-261-6/+6
| | | | | | | | | | | bit flags ORed together. Currently the only flags defined are _PASSWORD_SECUREONLY and _PASSWORD_OMITV7 but this is enough to cause pw_mkdb() to run pwd_mkdb with the options we want. With this change we no longer generate the old V7 passwd file when only the extra fields in master.passwd (or the encrypted password) have changed. There are other programs that could probably use the _PASSWORD_OMITV7 flag; they will be converted at a future date.
* Add new 'secureonly' arg to pw_mkdb() to correspond to pwd_mkdb's new -smillert2001-08-161-17/+29
| | | | flag and crank the library major due to the interface change.
* Plug memory leak in pw_copy(); millert@ okaaron2001-07-111-2/+3
|
* correct type on last arg to execl(); nordin@cse.ogi.eduderaadt2001-07-091-4/+4
|
* Fix a problem introduced by the printf format sweep. Passing a NULLmillert2001-01-021-4/+8
| | | | | pw_error() is prefectly legal but now we have to check for it explicity (it was handled implicitly before since warn(name) would become warn(NULL)).
* Add a username argument to pw_mkdb to match 'pwd_mkdb -u username'.millert2000-11-261-6/+12
| | | | Crank the shlib major number due to the interface change.
* close fd for pw_lck on exec, okay deraadt@provos2000-08-011-2/+6
|
* warnx?/errx? paranoia (use "%s" not a bare string unless it is amillert2000-06-301-3/+3
| | | | | | | | | constant). These are not security holes but it is worth fixing them anyway both for robustness and so folks looking for examples in the tree are not misled into doing something potentially dangerous. Furthermore, it is a bad idea to assume that pathnames will not include '%' in them and that error routines don't return strings with '%' in them (especially in light of the possibility of locales).
* preserve errno; christosderaadt1998-11-161-3/+6
|
* Use UID_MAX, not UINT_MAX. Rename remove_trailing_space() to trim_whitespace() since it trims from both ends, not just the rear.millert1998-08-031-16/+18
|
* add missing endusershell()millert1998-06-221-3/+5
|
* do not wait if vfork() failsderaadt1998-03-231-2/+4
|
* -Wallmillert1997-11-181-7/+11
|
* Go back to old file locking method, O_EXLOCK method has too many problemsmillert1997-11-171-9/+6
|
* pw_mkdb() now returns -1 if ptmp is size 0.millert1997-11-171-2/+11
|
* Work around bug in open(2) wrt O_TRUNC and O_SHLOCK|O_EXLOCK.millert1997-11-171-4/+7
|
* fix yes/no prompt code for EOF case; wosch@freebsdderaadt1997-09-291-7/+7
|
* Use O_EXLOCK option of open(2) to open /etc/ptmp with an exclusivemillert1997-06-221-5/+5
| | | | | lock. This fixes a DOS bug where a user could run passwd(1) and send it a SIGKILL, thus leaving /etc/ptmp in place.
* Add support to handle password files in directories other than /etcniklas1997-06-171-27/+91
|
* give only default values when asked for.provos1997-04-101-39/+33
|
* added password configuration access function, used to determineprovos1997-02-161-1/+143
| | | | password cipher type at the moment
* when using strsep you should be aware that the delimiter will be replacedprovos1997-02-151-3/+3
| | | | | by a nifty '0', so you cant check for a colon instead and dump some I am sorry, Dave. I can't do that.
* permit 32-bit uid/gid, help from millertderaadt1997-02-131-11/+21
|
* vfork w/ exit botchderaadt1996-12-061-2/+2
|