Just to show that PAM can do almost anything from the ridiculous to the
obscene, or - as they say in New York - sophisticated, add pam_echo(8) and
pam_exec(8) to our ever-lengthening roster of PAM modules.
Mike Barcroft [Thu, 23 May 2002 18:48:27 +0000 (18:48 +0000)]
o Conditionalize sections for POSIX.1-2001 compatibility.
o Use POSIX spelling for types, where possible.
o Define size_t in the __BSD_VISIBLE case (this isn't really needed
for standards conformance, but follows the tradition of not
requiring <sys/types.h> as a prerequisite).
o Use _BYTE_ORDER and friends instead of BYTE_ORDER and friends, since
there may not be enough pollution in order for the latter to work.
o Add an XXX note about the missing IPPROTO_IPV6 macro.
Tony Finch [Thu, 23 May 2002 16:50:41 +0000 (16:50 +0000)]
Sync with upstream version:
* Ensure we work within the array bounds when parsing command-line options;
* Replace h0h0getopt with getopt(3);
* Use consistent whitespace style in the function declarations.
Juli Mallett [Thu, 23 May 2002 14:58:22 +0000 (14:58 +0000)]
Handle numeric keys by checking a "default" file. Handle number-less keys
by failing, since comparing up to the length of the key (0) against the
begin line for a key in the help file will always succeed, and print what
is wholly bogus output.
Ollivier Robert [Thu, 23 May 2002 13:16:30 +0000 (13:16 +0000)]
load_env(), the function that attempts to parse a crontab
line as an environment variable assignment, is broken
and not conformant to its description in the manual page.
I think it is worthwhile to have that fix in 4.6.
PR: bin/38374
Submitted by: Thomas Quinot <thomas@cuivre.fr.eu.org>
MFC after: 2 days
Juli Mallett [Wed, 22 May 2002 23:14:17 +0000 (23:14 +0000)]
Add my PD implementation of the SCCS help command, which prints help from
files in the format used by SCCS, given a key. It behaves exactly like the
``proper'' SCCS help command, from what testing I can do.
John Baldwin [Wed, 22 May 2002 20:32:39 +0000 (20:32 +0000)]
Rename pause() to ia32_pause() so it doesn't conflict with the pause()
function defined in <unistd.h>. I didn't #ifdef _KERNEL it because the
mutex implementation in libpthread will probably need this.
Add a warning regarding localhost-only listening daemons inside jails.
Apparently binding only to 127.0.0.1 inside of a jail actually binds
to the jail IP address as well (in effect, bind to all available
interfaces in the jail).
Submitted by: Helge Oldach <test-smtp@oldach.net>
MFC after: 1 day
pending RE approval
Juli Mallett [Wed, 22 May 2002 16:09:52 +0000 (16:09 +0000)]
Add a usage().
Print usage() if right before executing the specified command, it comes to be
that *argv is NULL (i.e. a flag was specified without a command being given).
Juli Mallett [Wed, 22 May 2002 15:44:29 +0000 (15:44 +0000)]
Use what(1) here, in /usr/bin/what. It doesn't print error 26 correctly, but
neither does the pd sccs(1) implementation I have around, so there's no loss
for now.
Jacques Vidrine [Wed, 22 May 2002 14:27:35 +0000 (14:27 +0000)]
Repair a bug where type AAAA answer records were not displayed.
Reference ISC BIND issue:
``1279. [bug] nslookup: partial coversion to similar style outputs
for both -type=aaaa and -type=a.''
Juli Mallett [Wed, 22 May 2002 13:41:08 +0000 (13:41 +0000)]
Make the guarded string functions take a const "from" addr, and make the
function that prints when a botched guarded string operation occurs take
two const arguments.
XXX Should we use strlcat/strlcpy instead and hope for the best?
John Baldwin [Wed, 22 May 2002 13:19:22 +0000 (13:19 +0000)]
Rename cpu_pause() to pause(). Originally I was going to make this an
MI API with empty cpu_pause() functions on other arch's, but this
functionality is definitely unique to IA-32, so I decided to leave it
as i386-only and wrap it in #ifdef's. I should have dropped the cpu_
prefix when I made that decision.
Juli Mallett [Wed, 22 May 2002 11:10:03 +0000 (11:10 +0000)]
Make sccs(1) compile cleanly by fixing syntax errors such as #endif followed
by a token, and by including headers to get prototypes for many things, and
also by spelling the type of structure readdir(3) returns as "dirent".
Juli Mallett [Wed, 22 May 2002 10:43:50 +0000 (10:43 +0000)]
Revive the SCCS front-end, sccs(1), back from the Attic, since it's something
SUS wants (they want the entire suite of SCCS commands, we don't have them,
but we *had* the frontend, so we can have it again, and now).
Add $FreeBSD$ where appropriate, don't revive PSD.doc/spell.ok.
Bruce Evans [Wed, 22 May 2002 08:50:18 +0000 (08:50 +0000)]
Quick fix for non-unique inode numbers for hard links. We use the
byte offset of the directory entry for the inode number for all types
of files except directories, although this breaks hard links for
non-directories even if it doesn't cause overflow. Just ignore this
broken inode number for stat() and readdir() and return a less broken
one (the block offset of the file), so that applications normally can't
see the brokenness.
This leaves at least the following brokenness:
- extra inodes, vnodes and caching for hard links.
- various overflow bugs. cd9660 supports 64-bit block numbers, but we
silently ignore the top 32 bits in isonum_733() and then drop another
10 bits for our broken inode numbers. We may also have sign extension
bugs from storing 32-bit extents in ints and longs even if ints are
32-bits. These bugs affect DVDs. mkisofs apparently limits them
by writing directory entries first.
Inode numbers were broken mainly in 4.4BSD-Lite2. FreeBSD-1.1.5 seems
to have a correct implementation modulo the overflow bugs. We need
to look up directory entries from inodes for symlinks only. FreeBSD-1.1.5
use separate fields (iso_parent_extent, iso_parent) to point to the
directory entry. 4.4BSD-Lite doesn't have these, and abuses i_ino to
point to the directory entry. Correct pointers are impossible for
hard links, but symlinks can't be hard links.
Tim J. Robbins [Wed, 22 May 2002 05:15:53 +0000 (05:15 +0000)]
Bring back the cd -L and -P options from revision 1.24, but try harder not
to fail when the logical current directory no longer exists. Allow changes
to absolute paths when logical cwd is invalid, fall back to physical cd
if logical cd fails.
Robert Watson [Tue, 21 May 2002 23:35:51 +0000 (23:35 +0000)]
Permit alternative break sequence to break to debugger in GENERIC. Breakage
of serial break on -CURRENT seems rampant for some reason, and I like
being able to get into ddb.
John Baldwin [Tue, 21 May 2002 22:26:35 +0000 (22:26 +0000)]
Add appropriate IA32 "pause" instructions to improve performanec on
Pentium 4's and newer IA32 processors. The "pause" instruction has been
verified by Intel to be a NOP on all currently existing IA32 processors
prior to the Pentium 4.
Andrew R. Reiter [Tue, 21 May 2002 21:30:44 +0000 (21:30 +0000)]
- td will never be NULL, so the call to soalloc() in socreate() will always
be passed a 1; we can, however, use M_NOWAIT to indicate this.
- Check so against NULL since it's a pointer to a structure.
Andrew R. Reiter [Tue, 21 May 2002 21:18:41 +0000 (21:18 +0000)]
- OR the flag variable with M_ZERO so that the uma_zalloc() handles the
zero'ing out of the allocated memory. Also removed the logical bzero
that followed.
John Baldwin [Tue, 21 May 2002 20:47:11 +0000 (20:47 +0000)]
Add code to make default mutexes adaptive if the ADAPTIVE_MUTEXES kernel
option is used (not on by default).
- In the case of trying to lock a mutex, if the MTX_CONTESTED flag is set,
then we can safely read the thread pointer from the mtx_lock member while
holding sched_lock. We then examine the thread to see if it is currently
executing on another CPU. If it is, then we keep looping instead of
blocking.
- In the case of trying to unlock a mutex, it is now possible for a mutex
to have MTX_CONTESTED set in mtx_lock but to not have any threads
actually blocked on it, so we need to handle that case. In that case,
we just release the lock as if MTX_CONTESTED was not set and return.
- We do not adaptively spin on Giant as Giant is held for long times and
it slows SMP systems down to a crawl (it was taking several minutes,
like 5-10 or so for my test alpha and sparc64 SMP boxes to boot up when
they adaptively spinned on Giant).
- We only compile in the code to do this for SMP kernels, it doesn't make
sense for UP kernels.
John Baldwin [Tue, 21 May 2002 20:34:28 +0000 (20:34 +0000)]
Optimize spin mutexes for UP kernels without debugging to just enter and
exit critical sections. We only contest on a spin mutex on an SMP kernel
running on an SMP machine.
Introduce the concept of "magic spaces", and implement them in most of
the relevant classes.
Some methods may implement various "magic spaces", this is reserved
or magic areas on the disk, set a side for various and sundry purposes.
A good example is the BSD disklabel and boot code on i386 which occupies
a total of four magic spaces: boot1, the disklabel, the padding behind
the disklabel and boot2. The reason we don't simply tell people to
write the appropriate stuff on the underlying device is that (some of)
the magic spaces might be real-time modifiable. It is for instance
possible to change a disklabel while partitions are open, provided
the open partitions do not get trampled in the process.