Mike Barcroft [Wed, 21 Aug 2002 16:20:02 +0000 (16:20 +0000)]
o Merge <machine/ansi.h> and <machine/types.h> into a new header
called <machine/_types.h>.
o <machine/ansi.h> will continue to live so it can define MD clock
macros, which are only MD because of gratuitous differences between
architectures.
o Change all headers to make use of this. This mainly involves
changing:
#ifdef _BSD_FOO_T_
typedef _BSD_FOO_T_ foo_t;
#undef _BSD_FOO_T_
#endif
to:
#ifndef _FOO_T_DECLARED
typedef __foo_t foo_t;
#define _FOO_T_DECLARED
#endif
Fix a few typos, among them s/builtin/built-in/ (except for the ref
to the builtin(1) man page.) This is for consistency with the spelling
both proposed by ispell as well as IEEE Std 1003.1-2001.
Robert Drehmel [Wed, 21 Aug 2002 12:45:36 +0000 (12:45 +0000)]
- Define the macro _KERNEL to pretend we are compiling a kernel.
This is required by recent changes to <sys/pcpu.h>, which uses
the #error preprocessor directive to keep non-kernel
applications from using it.
_KERNEL is defined below the #include <stand.h>, because <stand.h>
removes the definition of _KERNEL.
- Move the inclusion of <sys/queue.h> above the inclusion of
<sys/linker.h> to avoid syntax errors.
Don Lewis [Wed, 21 Aug 2002 11:57:12 +0000 (11:57 +0000)]
Create new functions in_sockaddr(), in6_sockaddr(), and
in6_v4mapsin6_sockaddr() which allocate the appropriate sockaddr_in*
structure and initialize it with the address and port information passed
as arguments. Use calls to these new functions to replace code that is
replicated multiple times in in_setsockaddr(), in_setpeeraddr(),
in6_setsockaddr(), in6_setpeeraddr(), in6_mapped_sockaddr(), and
in6_mapped_peeraddr(). Inline COMMON_END in tcp_usr_accept() so that
we can call in_sockaddr() with temporary copies of the address and port
after the PCB is unlocked.
Fix the lock violation in tcp6_usr_accept() (caused by calling MALLOC()
inside in6_mapped_peeraddr() while the PCB is locked) by changing
the implementation of tcp6_usr_accept() to match tcp_usr_accept().
Jeff Roberson [Wed, 21 Aug 2002 08:34:48 +0000 (08:34 +0000)]
- Document two cases, one in vget and the other in vn_lock, where the state
of interlock on exit is not consistent. There are probably several bugs
relating to this.
Jeff Roberson [Wed, 21 Aug 2002 06:40:34 +0000 (06:40 +0000)]
- If vn_lock fails with the LK_INTERLOCK flag set, interlock will not be
released. vcanrecycle() failed to unlock interlock under this condition.
- Remove an extra VOP_UNLOCK from a failure case in vcanrecycle().
Jeff Roberson [Wed, 21 Aug 2002 06:19:29 +0000 (06:19 +0000)]
- Add two new debugging macros: ASSERT_VI_LOCKED and ASSERT_VI_UNLOCKED
- Use the new VI asserts in place of the old mtx_assert checks.
- Add the VI asserts to the automated lock checking in the VOP calls. The
interlock should not be held across vops with a few exceptions.
- Add the vop_(un)lock_{pre,post} functions to assert that interlock is held
when LK_INTERLOCK is set.
Warner Losh [Wed, 21 Aug 2002 05:31:04 +0000 (05:31 +0000)]
Treat IBSS the same as ADHOC in wi_get_cur_ssid. This makes ifconfig
work better, but might not make ibss actually work on the prism2 cards
that I have (this is the first time I've tried ibss in a long time).
Archie Cobbs [Tue, 20 Aug 2002 18:57:11 +0000 (18:57 +0000)]
When declaring local variables in macros, always use "_name" instead
of "name" to avoid ugly problems when the containing code already has
a variable named "name".
Hajimu UMEMOTO [Tue, 20 Aug 2002 16:38:05 +0000 (16:38 +0000)]
Previous commit of adding ut to xterm entry broke kterm-color entry.
3 bytes (ut:) seems too long for kterm-color. There is a limitation
of buffer size within 1024 bytes in our ncurses.
Submitted by: mistral@imasy.or.jp
Reviewed by: matusita
MFC after: 1 day
Yaroslav Tykhiy [Tue, 20 Aug 2002 14:56:06 +0000 (14:56 +0000)]
Clean up hostname and hostinfo handling in inithosts():
o check getaddrinfo(3) return value, not result pointer
o getaddrinfo(3) returns int, not pointer
o don't leak memory allocated for hostnames and hostinfo structures
o initialize pointers that will be checked for NULL somewhere
Be consistent about quoting things.
Be (somewhat) prepared for things to change size under us.
Recognize a empty attribute name as magic and print the list of attributes.
Use <err.h> for code clarity.
Deal with zero length returns.
Marcel Moolenaar [Tue, 20 Aug 2002 00:24:33 +0000 (00:24 +0000)]
Add support for the R_IA64_IPLTLSB relocation in non-PLT context.
This relocation creates a function descriptor at the specified
address and is commonly used for C++ to create virtual function
tables.
Peter Wemm [Mon, 19 Aug 2002 23:58:37 +0000 (23:58 +0000)]
de-count atkbdc. I have more extensive patches to make properly dynamic,
but since pc hardware only allows one AT-style keyboard controller, this
doesn't seem particularly urgent. (I do not know what the old sunriver
remote keyboard/mouse/vga cards do, that might be an exception).
Peter Wemm [Mon, 19 Aug 2002 23:56:01 +0000 (23:56 +0000)]
de-count schistory.c. The handling of NSC was rather bogus here and was
little more than a place holder, because nothing actually counted the
number of 'sc' units to compare it against NSC. A bit more work here
is needed so that the scaling of SC_MAX_HISTORY_SIZE and extra_history_size
goes up when more sc units are added. But, it does not appear that we can
have more than one console yet, so it does not seem particularly urgent.
Warner Losh [Mon, 19 Aug 2002 20:54:00 +0000 (20:54 +0000)]
When login tries to do the chmod/chflags on a read only file system,
it complains that it can't do it because the filesystem is readonly.
Assume that when the user has a readonly /dev that they don't care if
login can't change the permissions/flags. While this does break a few
things like msgs, we'll assume that the user setting up the read only
system knows what they are doing.
All this change does is to stop the complaint when the file system is
read only. It also adds comments as to why EROFS and EOPNOTSUPP are
ignored.
This allows one to have a read-only / w/o a /dev MFS and have a
relatively warning-free existence. /etc/rc still complains when it
can't chown/chflags/chmod things, but that's easy to ignore/tweak.
Robert Watson [Mon, 19 Aug 2002 20:26:32 +0000 (20:26 +0000)]
Close a race in process label changing opened due to dropping the
proc locking when revoking access to mmaps. Instead, perform this
later once we've changed the process label (hold onto a reference
to the new cred so that we don't lose it when we release the
process lock if another thread changes the credential).
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
Robert Watson [Mon, 19 Aug 2002 19:04:53 +0000 (19:04 +0000)]
Pass active_cred and file_cred into the MAC framework explicitly
for mac_check_vnode_{poll,read,stat,write}(). Pass in fp->f_cred
when calling these checks with a struct file available. Otherwise,
pass NOCRED. All currently MAC policies use active_cred, but
could now offer the cached credential semantic used for the base
system security model.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
Robert Watson [Mon, 19 Aug 2002 17:59:48 +0000 (17:59 +0000)]
Provide an implementation of mac_syscall() so that security modules
can offer new services without reserving system call numbers, or
augmented versions of existing services. User code requests a
target policy by name, and specifies the policy-specific API plus
target. This is required in particular for our port of SELinux/FLASK
to the MAC framework since it offers additional security services.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
Robert Watson [Mon, 19 Aug 2002 16:59:37 +0000 (16:59 +0000)]
Break out mac_check_pipe_op() into component check entry points:
mac_check_pipe_poll(), mac_check_pipe_read(), mac_check_pipe_stat(),
and mac_check_pipe_write(). This is improves consistency with other
access control entry points and permits security modules to only
control the object methods that they are interested in, avoiding
switch statements.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs