Commit Graph

37 Commits

Author SHA1 Message Date
uebayasi 9281ce080c Make nbpwd_mkdb always generate version 1 by deciding version depending on
sizeof(pw_change).  No objection on tech-userlevel.
2009-02-02 04:24:18 +00:00
jmmv 9b08dc4841 Make sure that the database version is correct if we are updating a single
record; otherwise, bail out early to avoid leaving the database in an
inconsistent state (some old-format records, one new-format record).
2009-01-16 10:42:36 +00:00
christos 5f47ffa430 Oops, forgot to merge this. 2009-01-14 23:18:57 +00:00
lukem 9c1945664c Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 13:36:57 +00:00
wiz 09cb1d6f1c s/existance/existence/, from Zafer. 2006-11-24 22:52:16 +00:00
sketch e72d64c28d Resolve the second part of PR/19387 from Greg Woods: print error correctly. 2006-09-23 17:38:42 +00:00
sketch 4fea323db6 Add a -c flag to specify the size of cache to use. For very large databases,
increasing this value accordingly gives massive speed improvements.

Prompted by Greg Woods in PR/19387, although mostly taken from FreeBSD.
2006-09-23 17:17:04 +00:00
lukem 90b888928b appease gcc -Wuninitialized 2005-06-02 09:18:14 +00:00
jmc b2f782612f Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
2004-06-20 22:20:14 +00:00
lukem 171d653219 Overhaul how `build.sh tools' are used:
*	Rename "config.h" to "nbtool_config.h" and
	HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
	This makes in more obvious in the source when we're using
	tools/compat/config.h versus "standard autoconf" config.h

    *	Consistently move the inclusion of nbtool_config.h to before
    	<sys/cdefs.h> so that the former can provide __RCSID() (et al),
    	and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
	#if HAVE_NBTOOL_CONFIG_H
	#include "nbtool_config.h"
	#endif
to the top of the source files (for the general case).
2003-10-27 00:12:41 +00:00
agc 9f1aac5bb3 Move Jason Downs's code from a 4-clause to a 3-clause licence by
removing the advertising clause.  Diffs provided in PR 22410 by Joel
Baker, confirmed to the board by Jason Downs.

With additional thanks to Jason Thorpe.
2003-10-13 15:36:33 +00:00
agc 326b2259b7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22366, verified by myself.
2003-08-07 11:25:11 +00:00
itojun d0f8b66023 strncpy -> strlcpy 2003-05-17 19:18:59 +00:00
tv 9fbd88883c Roll in fixes to permit cross-compiling from non-NetBSD hosts. This
round has been tested on Solaris/x86 and Linux hosts.

* Add host tools cap_mkdb, ctags, m4, uudecode.
* Protect __RCSID() and __COPYRIGHT() better.
* Reduce the number of places that need to include "config.h", to keep
  sources closer to their "vanilla" versions.
* Add more compat #defines and autoconf-checked functions.
2002-01-31 22:43:33 +00:00
tv a328e34106 Make almost all tools compile and run properly on non-NetBSD hosts. (In
particular, most tools now run correctly on Solaris 7.)
2002-01-29 10:20:28 +00:00
ad e13d145336 Speed things up a bit. Parts dredged from OpenBSD/FreeBSD.
- Add -u option, to update one user's records only.
- Add -s option, to update the secure database only.
- Give us roughly 1MB of cache per 50kB of password file, but keep within
  a 2MB minimum and 8MB maximum.
- Tidy a little.
2001-08-18 19:29:31 +00:00
tron f8f9801395 Use empty string as default prefix so that e.g "/etc/spwd.db" is used
instead of "//etc/spwd.db".
2000-11-20 14:09:36 +00:00
ad 4ed69cc393 Remove extraneous M_32_SWAP(). 2000-08-08 12:08:17 +00:00
ad b11d8d3fbf - Move some duplicated code from main() into subroutines. In doing this,
fix -p (it was broken if used in conjunction with either -B or -L).
- const, KNF.
2000-08-07 13:19:27 +00:00
itojun bbef2fbaac errx?/warnx? audit. do not pass variable alone, use %s. idea from openbsd 2000-07-07 15:10:32 +00:00
mycroft c077907823 Add explicit endianness overrides. 2000-01-23 19:59:32 +00:00
mycroft 1f86e5830d const poisoning. 1998-07-27 00:52:00 +00:00
lukem c5b39b1d5a treat single "+" as "+:::::::::" (pw_scan() doesnt like former). minor KNF 1998-06-08 03:23:07 +00:00
lukem 77a05c5b00 clear flags before calling pw_scan() 1998-06-07 14:40:29 +00:00
fair c0ad440bd6 fix my boo-boo documented by PR#5293 1998-04-14 20:20:16 +00:00
fair c85ab8db8e A few more error message changes for better information. 1998-04-14 04:51:19 +00:00
fair dd15ee1ce0 Handle the problem cited in PR#1328 (no checking for I/O errors).
Improve some of the error messages to provide more accurate information.

Repaired a bug by inspection (function pointer reference through a
free'd DB structure!! How did this *ever* work?)
1998-04-13 23:12:45 +00:00
lukem 95ce1aeabe WARNSify, getopt returns -1 not EOF 1997-10-17 12:18:16 +00:00
thorpej a0e4cacd4c Print a warning to stderr if a YP inclusion (`+') specifies a value of
0 for uid or gid.  Based on a patch posted to tech-userlevel by
Paul Kranenburg <pk@NetBSD.ORG>.
1996-11-24 21:13:27 +00:00
lukem 9e8841e359 Implement '-d directory' option, to override the default of '/'.
Useful for building ~ftp/etc/pwd.db without using chroot or unionfs.
Inspired by FreeBSD, closes [bin/2566]
1996-11-22 05:37:29 +00:00
jtc a65aba5bdb Updated to use new password file functions in libutil.
From Greg Hudson <ghudson@MIT.EDU>.
1996-05-15 23:19:09 +00:00
phil 5354239906 Improvements to YP support from Jason Downs. 1995-07-28 07:13:04 +00:00
mycroft 9839fe449e Update to 4.4-Lite version. 1994-08-28 23:32:47 +00:00
cgd 506145e312 DTRT is a too-restricve umask is specified. Bug pointed out by Andrew Chernov. 1994-04-10 07:05:59 +00:00
mycroft e9d867ef50 Add RCS identifiers. 1993-08-01 17:54:45 +00:00
proven 76be010f7a Changed pwd_mkdb to use dbopen. 1993-04-21 07:54:40 +00:00
cgd 61f282557f initial import of 386bsd-0.1 sources 1993-03-21 09:45:37 +00:00