This code came originally from v7/32v and thence from 4.4BSD. It was
freed by Caldera. Todd Miller cleaned up and ANSIfied the code, and
then changed it to use the mmap/binary search algorithm for looking up
words in the dictionary that look(1) uses, replacing the hash based
lookups which were faster but broken by the size of the current
dictionary.
I've done a teeny bit of additional cleanup and replaced Todd's ksh
spell(1) script with a /bin/sh script, and re-structured the code to
follow the bsd makefile way, with one executable per directory.
I also added a TODO list recommending a bunch of kinds of cleanup.
The code is, frankly, awful. It was fine in the 1970s, a time of much
more limited resources and tastes, but the world has moved on a bunch
since then. The reason for pulling this in at all is that it will make
it much easier to check in-tree documentation for spelling errors
automatically.
The code came from 32v and then 4.4BSD. After the code was freed by
Caldera, it was cleaned up and ANSIfied by Todd Miller for OpenBSD.
I've added a TODO with several items on it, basically code cleanup and
adding support for mdoc. As it stands, this won't yet pass WARNS=1.
to document the behaviour that is currently in use (the "./obj" and
"/usr/obj/`pwd`" behaviour).
Hopefully the existing .OBJDIR behaviour is clearer now.
is rounded to the nearest kilobyte, megabyte, or gigabyte.
Implemented at lukem's request since some things can't deal with
overly large numbers when files are really large.
Have to do something like humanize_number(3), but that interface isn't
really what I'm looking for. I think. More examination required.
./obj.${MACHINE}
./obj
/usr/obj/${PWD}
The rules for the default .OBJDIR setting are now simplified to
(and documented as) trying the chdir to the following
(if the appropriate variable is defined):
${MAKEOBJDIRPREFIX}${.CURDIR}
${MAKEOBJDIR}
${.CURDIR}
.OBJDIR can be overridden in the makefile.
<bsd.obj.mk> uses this to provide the "culled" .OBJDIR semantics
for NetBSD's /usr/src builds.
MAKEOBJDIRPREFIX & MAKEOBJDIR still can only be provided
in the environment or on make(1)'s command line.
Per discussion on tech-toolchain.
This should reduce a lot of lossage people have experienced over
the years with various .OBJDIR setups.
mode, use the ignErr template for the command as shell doesn't like an empty
construct of the form { } || <something>. Fixes build breakage on cats
distrib where a command ends up expanding to nothing.
int getline(FILE *stream, char *buf, size_t buflen, const char **errormsg)
Read a line from the FILE stream into buf/buflen using fgets(), so up
to buflen-1 chars will be read and the result will be NUL terminated.
If the line has a trailing newline it will be removed.
If the line is too long, excess characters will be read until
newline/EOF/error.
Various -ve return values indicate different errors, and errormsg
will be changed to an error description if it's not NULL.
Convert to use getline() instead of fgets() whenever reading user input
to ensure that an overly long input line doesn't leave excess characters
for the next input operation to accidentally use as input.
Zero out the password & account after we've finished with it.
Consistently use getpass(3) (i.e, character echo suppressed) when
reading the account data. For some reason, historically the "login"
code suppressed echo for Account: yet the "user" command did not!
Display the hostname in the "getaddrinfo failed" warning.
Appease some -Wcast-qual warnings. Fixing all of these requires
significant code refactoring. (mmm, legacy code).
* Explicitly goto default_case for unknown chars encountered after
various : modifiers, rather than multiple FALLTHRUs.
* Appease gcc -Wuninitialized for sv_name and v_ctxt.
Discussed with sjg.
occurs in gtags parsing. For that matter, remove the unused 'tftp'
and 'echk' variable, as they're set but not used afterwards.
Detected with gcc -Wuninitialized.
realpath(3) on non-NetBSD systems may fail if the target filename doesn't
exist, so instead use realpath(3) on the parent directory of `file'.
Per discussion with Todd Eigenschink.
to create and metalog, rather than using the realpath(3) modified version.
Fixes a problem with -lr when -ddestdir contains a symlink.
Add some XXX comments reminding us that the `from_name' in a symlink may
point outside of destdir in the metalog, even though our build process
doesn't trigger this.
* every day of the year should have at least one entry
* all entries should have been fact-checked against reliable sources,
particularly for dates
* calendar should contain a fair balance of world history -- existing
calendar, being based on that shipped in 4.2BSD, was very northern
california-centric.
This commit meets these guidelines through March 13. I will continue to
update this as time permits.
While I am there:
- factor out the binary test to an inline function.
- use size_t where appropriate.
- check for <= 0 in gzread; it returns -1 on error.
signal if path_to_pid_file field is present.
Also mention that /var/run/syslogd.pid is used as the default
path_to_pid_file.
This was brought up on netbsd-help and Richard Braun suggested
this should be documented.
Reviewed by grant and wiz.
we don't specify an output filename, the database file we create will end
up being used during population as the database file to find entries quickly.
connect(2) in xconnect() by temporarily setting O_NONBLOCK
on the socket and using xpoll() to wait for the operation
to succeed.
The timeout used is the '-q quittime' argument (defaults to
60s for accept(2), and the system default for connect(2)).
Idea inspired by discussion with Chuck Cranor.
This may (indirectly) fix various problems with timeouts
in active mode through broken firewalls.
Implement xpoll() as a wrapper around poll(2), to make it
easier to replace on systems without a functional poll(2).
Unconditionally use xpoll() instead of conditionally using
select(2) or poll(2).
Since type_t is different between lint1.h and lint2.h include the
appropriate file depending on the pass. Make the argument mismatch
error print the type names of the types involved. Now that we have
a tyname() function we can fix the rest of the pass2 warnings to be
more explanatory, but not now.
XXX: needs more work.
1. code needs to be added in pam_group.so to handle indirect groups and
documented.
2. the indirect group description outside before the customization section
does not work with pam, but could be made to work once [1] is implemented.