aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/pwd_mkdb
Commit message (Collapse)AuthorAgeFilesLines
* Uniformly refer to a file system as "file system".Ruslan Ermilov2002-12-121-1/+1
| | | | | | | Approved by: re Notes: svn path=/head/; revision=107788
* The .Nm utilityPhilippe Charnier2002-07-141-4/+6
| | | | Notes: svn path=/head/; revision=99968
* WARNS=4 cleanup, de-__P()Alfred Perlstein2002-07-112-12/+14
| | | | Notes: svn path=/head/; revision=99819
* Consistancy check: s/file system/filesystem/gTom Rhodes2002-05-161-1/+1
| | | | Notes: svn path=/head/; revision=96705
* When reporting that a line is too long, include the line number in theDima Dorfman2002-03-091-1/+5
| | | | | | | | | | | error message. While I'm here, add a note that the "line too long" message isn't always accurate. PR: 35395 Submitted by: andrew@ugh.net.au Notes: svn path=/head/; revision=91923
* Explicitly use int32_t for on-disk records for pw_change and pw_expire,Peter Wemm2001-10-271-8/+11
| | | | | | | | | since that is what we use now and this insulates us from any time_t tweaks here. We can define a record format that uses 64 bit times if/when we need to. Notes: svn path=/head/; revision=85572
* It's bad enough to capitalize the name of the executable at theDima Dorfman2001-08-041-1/+1
| | | | | | | | beginning of the sentence, but at the very least it shouldn't be done in the middle of a sentence! Notes: svn path=/head/; revision=81144
* Perform a major cleanup of the usr.sbin Makefiles.David E. O'Brien2001-07-201-4/+5
| | | | | | | | These are not perfectly in agreement with each other style-wise, but they are orders of orders of magnitude more consistent style-wise than before. Notes: svn path=/head/; revision=80029
* Remove whitespace at EOL.Dima Dorfman2001-07-151-2/+2
| | | | Notes: svn path=/head/; revision=79755
* - Backout botched attempt to introduce MANSECT feature.Ruslan Ermilov2001-03-261-0/+1
| | | | | | | - MAN[1-9] -> MAN. Notes: svn path=/head/; revision=74816
* Set the default manual section for usr.sbin/ to 8.Ruslan Ermilov2001-03-201-1/+0
| | | | Notes: svn path=/head/; revision=74532
* mdoc(7) police: use the new features of the Nm macro.Ruslan Ermilov2000-11-201-4/+4
| | | | Notes: svn path=/head/; revision=68965
* Add nsswitch support. By creating an /etc/nsswitch.conf file, you canJacques Vidrine2000-09-064-215/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | configure FreeBSD so that various databases such as passwd and group can be looked up using flat files, NIS, or Hesiod. = Hesiod has been added to libc (see hesiod(3)). = A library routine for parsing nsswitch.conf and invoking callback functions as specified has been added to libc (see nsdispatch(3)). = The following C library functions have been modified to use nsdispatch: . getgrent, getgrnam, getgrgid . getpwent, getpwnam, getpwuid . getusershell . getaddrinfo . gethostbyname, gethostbyname2, gethostbyaddr . getnetbyname, getnetbyaddr . getipnodebyname, getipnodebyaddr, getnodebyname, getnodebyaddr = host.conf has been removed from src/etc. rc.network has been modified to warn that host.conf is no longer used at boot time. In addition, if there is a host.conf but no nsswitch.conf, the latter is created at boot time from the former. Obtained from: NetBSD Notes: svn path=/head/; revision=65532
* Fix various unsigned vs signed errors that caused problems with uidsPaul Richards2000-03-092-11/+20
| | | | | | | | | | and gids bigger than 16 bits. Added checks for uids and gids that are bigger than 32 bits. Approved by: jkh (partly, this fix is bigger than I first intended) Notes: svn path=/head/; revision=57868
* Remove single-space hard sentence breaks. These degrade the qualitySheldon Hearn2000-03-011-1/+2
| | | | | | | | of the typeset output, tend to make diffs harder to read and provide bad examples for new-comers to mdoc. Notes: svn path=/head/; revision=57673
* Replace the -q option to pwd_mkdb with a test for PW_SCAN_BIG_IDS inSheldon Hearn1999-12-023-12/+18
| | | | | | | | | | | | | | the environment. This allows big ID warnings to be suppressed for vipw and chpass as well. Since the environment variable test is only performed for callers of pw_scan() that do not set pw_big_ids_warning, the test can still be overriden. Currently, chpass and pwd_mkdb are the only users of pw_scan() and neither of them overrides the environment variable test. Notes: svn path=/head/; revision=54034
* Allow empty UIDs if we are processing NIS records. I am not entirelyEivind Eklund1999-11-221-2/+4
| | | | | | | | | | | happy with how this end up and will re-visit the entire empty field problem, but this patch solves the NIS problem for now. Submitted by: Dan Nelson <dan@emsphone.com> PR: 14865,14984 Notes: svn path=/head/; revision=53581
* Add to pwd_mkdb a -q option to silence warnings about large IDs. Add aSheldon Hearn1999-11-154-5/+26
| | | | | | | | | | | | suitably ominous warning in the manual page. The diff applied is not the one provided in the attributed PR. PR: 13344 Reviewed by: bde Notes: svn path=/head/; revision=53183
* Flag empty UID entries as errors (to stop typos from turning intoEivind Eklund1999-11-061-1/+6
| | | | | | | alternate root accounts). Notes: svn path=/head/; revision=52921
* Unifdef -DPASSWD_IGNORE_COMMENTS. This wasn't really optional andPeter Wemm1999-09-062-7/+2
| | | | | | | we have enough pseudo-options already. Notes: svn path=/head/; revision=51025
* Back out previous commit. I mistook passing commentary from bde forSheldon Hearn1999-08-312-17/+6
| | | | | | | | | review. Requested by: bde Notes: svn path=/head/; revision=50700
* Only issue a warning for the first occurrence of a UID > USHRT_MAX andSheldon Hearn1999-08-302-6/+17
| | | | | | | | | | the first occurrence of a GID > USHRT_MAX. PR: 13344 Reviewed by: bde Notes: svn path=/head/; revision=50644
* $Id$ -> $FreeBSD$Peter Wemm1999-08-283-3/+3
| | | | Notes: svn path=/head/; revision=50479
* Add $Id$, to make it simpler for members of the translation teams toNik Clayton1999-07-121-0/+1
| | | | | | | | | | | | | | | | | | | | track. The Id line is normally at the bottom of the main comment block in the man page, separated from the rest of the manpage by an empty comment, like so; .\" $Id$ .\" If the immediately preceding comment is a @(#) format ID marker than the the $Id$ will line up underneath it with no intervening blank lines. Otherwise, an additional blank line is inserted. Approved by: bde Notes: svn path=/head/; revision=48791
* Enable source file locking in pwd_mkdb by including the proper letterBill Fumerola1999-01-011-3/+3
| | | | | | | | | | | | | in getopt(). The code was there, the means to use it wasn't. Also update the usage() statment to reflect reality. PR: bin/9248 Submitted by: Jos Backus <jbackus@plex.nl> Forgotten By: dillon Notes: svn path=/head/; revision=42241
* PR: bin/3478Matthew Dillon1998-12-132-6/+43
| | | | | | | | | | | | | | | | | Have pwd_mkdb lock the source file while rebuilding the database. When called by programs such as vipw, the source file is a temporary file and this does not conflict with the lock on /etc/master.passwd already held by vipw. When run manually, however, master.passwd is typically specified as the argument and the locking prevents other programs from messing with master.passwd during the database rebuild. Also pwd_mkdb uses a blocking exclusive lock as it may be called from a script. The -N option was added to cause pwd_mkdb to get the lock non-blocking and exit with an error if the attempt fails, again useful for scripts. Notes: svn path=/head/; revision=41712
* Close PR bin/8753 pwd_mkdb problem when having comments in passwd fileFoxfair Hu1998-12-121-1/+5
| | | | | | | Submitted by Chia-liang Kao clkao@CirX.ORG . Notes: svn path=/head/; revision=41697
* Rename a static variable, so it will not shadowed by a local variable.Dmitrij Tejblum1998-09-291-7/+7
| | | | | | | | | Now comments will be ignored, rather than put junk in the password database. Broken in: rev. 1.21 Notes: svn path=/head/; revision=39777
* Fix usage stringAndrey A. Chernov1998-06-091-2/+2
| | | | Notes: svn path=/head/; revision=36820
* Allow specification of cache-size to pwd_mkdbPoul-Henning Kamp1998-04-192-2/+14
| | | | | | | | | PR: 5193 Reviewed by: phk Submitted by: Nick Hilliard <nick@foobar.org> Notes: svn path=/head/; revision=35286
* Reenable building of /etc/passwd.Guido van Rooij1998-02-191-3/+3
| | | | | | | Pointed out by: "Julie M. Juracich" <julie@xaqti.com> Notes: svn path=/head/; revision=33614
* Apparently, if fprintf() fails, it can return any negative valueGuido van Rooij1998-02-161-3/+3
| | | | | | | Pointed out by: Bruce Notes: svn path=/head/; revision=33434
* Check return values of fprintf, fclose (this one is overdone I guess)Guido van Rooij1998-02-151-7/+12
| | | | | | | | | and pw_db->close. PR: 4202 (probably, I askd the submitter) Obtained from: OpenBSD Notes: svn path=/head/; revision=33413
* Rename the pwd_mkdb(8) option '-c' to '-C' for better compatiblityWolfram Schneider1998-01-102-9/+9
| | | | | | | with BSD/OS. Notes: svn path=/head/; revision=32397
* Staticize usage(). Cosmetics.Philippe Charnier1997-10-103-16/+24
| | | | Notes: svn path=/head/; revision=30260
* db close routine actually writes data out to disk; return value wasJonathan Lemon1997-08-181-2/+4
| | | | | | | | | not being checked. Change code to fail if db->close errors. PR: 4202 Notes: svn path=/head/; revision=28385
* Document the -u option.Mike Pritchard1997-04-041-1/+6
| | | | | | | Forgotten by: guido Notes: svn path=/head/; revision=24599
* compare return value from getopt against -1 rather than EOF, per the finalWarner Losh1997-03-311-1/+1
| | | | | | | posix standard on the topic. Notes: svn path=/head/; revision=24428
* Fix possible (not stack) overflow from -d <dir> commandline option.David Nugent1997-03-201-1/+1
| | | | Notes: svn path=/head/; revision=24059
* Allow comments in password database. The comments are copied fromWolfram Schneider1997-03-082-4/+26
| | | | | | | | | | | | | | | | the password file into /etc/master.passwd and optional (-p) into /etc/passwd. Enable this feature with the compile option -DPASSWD_IGNORE_COMMENTS. The character `#' introduces a comment. Leading spaces and tabs are ignored: '^[ \t]*#.*\n$' Count an empty line - only spaces, tabs or newline - also as a comment. An empty line at the bottom of /etc/master.passwd is a common novice error and increased my mail load: '^[ \t]*\n$' Notes: svn path=/head/; revision=23517
* Begin closing out PR #1519 (this requires a change to chpass too,Bill Paul1996-10-221-4/+12
| | | | | | | | | | | | | and both changes need to be pulled into the stable branch). The problem here is that when pwd_mkdb creates /etc/passwd, it turns empty UID and GID fields into zeroes. To fix this, we check the _PWF_UID and _PWF_GID bits in the pw_fields flag: if the bits are not set, we print an empty field instead of a zero. This way, you don't get zeroes in the UID or GID fields unless you explicit want them. Notes: svn path=/head/; revision=19085
* New option: [-c]Wolfram Schneider1996-08-192-3/+17
| | | | | | | | Check if the password file is in the correct format. Do not change, add, or remove any files. Notes: svn path=/head/; revision=17672
* Fixed brackets in usage message.Bruce Evans1996-07-121-8/+10
| | | | | | | Reformatted some of recent changes to KNF. Notes: svn path=/head/; revision=17125
* Check if username is a NULL pointer before dereferencing it.Martin Renters1996-07-031-1/+1
| | | | Notes: svn path=/head/; revision=16946
* Implement incremental passwd database updates. This is done by ading a '-u'Guido van Rooij1996-07-011-133/+218
| | | | | | | | | | | | | | | | | option to pwd_mkdb and adding this option to utilities invoking it. Further, the filling of both the secure and insecure databases has been merged into one loop giving also a performance improvemnet. Note that I did *not* change the adduser command. I don't read perl (it is a write only language anyway). The change will drastically improve performance for passwd and friends with large passwd files. Vipw's performance won't change. In order to do that some kind of diff should be made between the old and new master.passwd and depending the amount of changes, an incremental or complete update of the databases should be agreed upon. Notes: svn path=/head/; revision=16876
* Submitted by: archie@whistle.comJulian Elischer1996-06-201-2/+2
| | | | | | | | This program should COMPLAIN about uids > 65K but not abort.. they are after all legal, and some of us NEED them! Notes: svn path=/head/; revision=16552
* NIS cleanups and fixes, the next generation, continued.Bill Paul1996-04-161-56/+11
| | | | | | | | | | | | | | | | | | pwd_mkdb.c: - Don't save the PLUSCNT and MINUSCNT tokens: we don't need them anymore. - Count the + and - entires for NIS together instead of counting + and - entries seperately. Index all special NIS entries using new _PW_KEYYPBYNUM token. pwd.h: - Remove the PLUSBYNUM, MINUSBYNUM, PLUSCNT and MINUSCNT tokens and replace then with a single _PW_KEYYPBYNUM token. Notes: svn path=/head/; revision=15268
* Remove trailing whitespace.Rodney W. Grimes1995-05-302-3/+3
| | | | Notes: svn path=/head/; revision=8857
* Add what looks to be the right fix to this bogus code.Jordan K. Hubbard1995-03-241-1/+1
| | | | Notes: svn path=/head/; revision=7326
* Re-enable +::::::::: wildcards that I had previously disallowed.Bill Paul1995-03-231-5/+3
| | | | | | | | | | | | | Note: if you put +::0:0:::::: in /etc/master.passwd as your only NIS entry, it will cause all NIS uids and gids to be remapped to zero. This is *intentional*. That's the way it's supposed to work. Enabling NIS with no remapping at all is done with +:::::::::, not +::0:0::::::. Similarly, +:::::::::/bin/csh will remap the shells of all NIS users to /bin/csh. Or, you could do +wpaul:::::::::/bin/csh to remap NIS user wpaul's shell to /bin/csh but leave everyone else alone. Notes: svn path=/head/; revision=7291