Commit Graph

10248 Commits

Author SHA1 Message Date
wiz 0fd61eded9 Fix pasto, noted by Marc Espie. 2005-06-27 14:18:36 +00:00
thorpej 1fc5e9b8c4 _nsdispatching needs to count, not just be 1 or 0. Also shuffle around
its use a little to eliminate some duplication.
2005-06-26 16:27:36 +00:00
thorpej 65412a2710 Implement expansion of special "magic" strings in symlinks into
system-specific values.  Submitted by Chris Demetriou in Nov 1995 (!)
in PR kern/1781, modified only slighly by me.

This is enabled on a per-mount basis with the MNT_MAGICLINKS mount
flag.  It can be enabled at mountroot() time by building the kernel
with the ROOTFS_MAGICLINKS option.

The following magic strings are supported by the implementation:

	@machine	value of MACHINE for the system
	@machine_arch	value of MACHINE_ARCH for the system
	@hostname	the system host name, as set with sethostname()
	@domainname	the system domain name, as set with setdomainname()
	@kernel_ident	the kernel config file name
	@osrelease	the releaes number of the OS
	@ostype		the name of the OS (always "NetBSD" for NetBSD)

Example usage:

	mkdir /arch/i386/bin
	mkdir /arch/sparc/bin
	ln -s /arch/@machine_arch/bin /bin
2005-06-23 00:30:28 +00:00
he 0ec45ddeab Fix the toolification of disklabel by using the nbinclude namespace
under HAVE_NBTOOL_CONFIG_H for disktab.h as well.  This means
disktab.h has to be installed in the nbinclude include directory.

(Failure mode: with TOOLDIR as a subdirectory of /usr, the host's disktab.h
got picked up, and not the in-tree copy.)

Reviewed by dyoung.
2005-06-22 21:35:28 +00:00
christos 07c1b4dc67 If the string to be printed is NULL substitute "(null)". Approved by core.
This is a workaround to make gcc's behavior consistent, since gcc can
transform:
    printf("%s\n", s) -> puts(s)
    fprintf(fp, "%s", s) -> fputs(s, fp)
as an optimization.
I've left the _DIAGASSERT's that make sure that s != NULL alone because we
should really still abort in a debugging environment.
2005-06-22 19:45:22 +00:00
christos 098f26dce7 Document that passing NULL to %s prints "(null)". 2005-06-21 18:43:17 +00:00
elad 0e4dfe1792 - Use more calls to veriexec_report() where possible.
- Change #ifdef VERIFIED_EXEC_VERBOSE to another verbose level, 2. Add
  sysctl(3) bits.

- Simplify access type conflict handling during load. This depends on
  the values of access type defines to be ordered from least to most
  'strict'.
2005-06-20 15:06:18 +00:00
lukem d249206e30 use "tempnam" instead of "tmpname" 2005-06-18 10:50:25 +00:00
peter d4cc3cce89 Create links for pthread_attr_setschedparam.3
and pthread_attr_getschedparam.3 to pthread_attr.3.

From Igor Sobrado in PR/29997.
2005-06-17 18:37:24 +00:00
wiz 52e496a68e New sentence, new line. 2005-06-17 18:26:53 +00:00
wiz 27d002e8de New sentence, new line.
Break much too long line.
2005-06-17 18:23:52 +00:00
peter a28acffec8 Don't create links to pthread_barierattr_init.3 and
pthread_barierattr_destroy.3 but to pthread_barrierattr_init.3
and pthread_barrierattr_destroy.3 (note the 2 rs in barrier).
2005-06-17 18:23:19 +00:00
wiz f076596bae New sentence, new line. 2005-06-17 18:19:39 +00:00
peter 9231683ec7 Fix some spelling errors.
From Igor Sobrado in PR/29997.
2005-06-17 18:08:00 +00:00
peter 568accb2c0 Fix various spelling errors.
From Igor Sobrado in PR/29997.
2005-06-17 18:07:06 +00:00
elad ad7b01f7d0 More veriexec changes:
- Better organize strict level. Now we have 4 levels:
  - Level 0, learning mode: Warnings only about anything that might've
      resulted in 'access denied' or similar in a higher strict level.

  - Level 1, IDS mode:
    - Deny access on fingerprint mismatch.
    - Deny modification of veriexec tables.

  - Level 2, IPS mode:
    - All implications of strict level 1.
    - Deny write access to monitored files.
    - Prevent removal of monitored files.
    - Enforce access type - 'direct', 'indirect', or 'file'.

  - Level 3, lockdown mode:
    - All implications of strict level 2.
    - Prevent creation of new files.
    - Deny access to non-monitored files.

- Update sysctl(3) man-page with above. (date bumped too :)

- Remove FINGERPRINT_INDIRECT from possible fp_status values; it's no
  longer needed.

- Simplify veriexec_removechk() in light of new strict level policies.

- Eliminate use of 'securelevel'; veriexec now behaves according to
  its strict level only.
2005-06-17 17:46:18 +00:00
enami cdc60944c2 Changes done in rev. 1.21 of getcap.3 (former name of this file) is
not correct since, as far as reading the source, it is impossible for
cgetset() to set such errno.  I guess `seq' is not a typo of `set' but
abbreviation of `sequen...'.
2005-06-17 02:10:45 +00:00
he 12d0c406c7 Initialize expsize to appease -Wuninitialized for sh3 and m68000.
Marked with XXXGCC -Wuninitialized [sh3,m68000].
2005-06-15 09:31:27 +00:00
peter 6c8b6ba99c - Correct the fields in the stat structure. From PR/18255.
- Document the st_birthtime field.

Reviewed by wiz.
2005-06-14 12:10:02 +00:00
dyoung a37289db57 Make disklabel(8) and fdisk(8) into "host tools " last step: build
and install ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-disklabel,
${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-fdisk by "reaching over" to
the sources in ${NETBSDSRCDIR}/sbin/{disklabel fdisk}/.

To avoid clashes with a build-host's header files, especially on
*BSD, the host-tools versions of fdisk and disklabel search for
#includes such as disklabel.h, disklabel_acorn.h, disklabel_gpt.h,
and bootinfo.h in a new #includes namespace, nbinclude/.  That is,
they #include <nbinclude/sys/disklabel.h>, <nbinclude/machine/disklabel.h>,
<nbinclude/sparc64/disklabel.h>, instead of <sys/disklabel.h> and
such.  I have also updated the system headers to #include from
nbinclude/-space when HAVE_NBTOOL_CONFIG_H is #defined.
2005-06-12 19:46:15 +00:00
christos 54e7bf907a make this useable from c++. 2005-06-12 06:58:21 +00:00
lukem 0f879c5d2a vfwprintf.c and vfwscanf.c now compile with -Wuninitialized 2005-06-12 05:49:12 +00:00
lukem ef7b3cd60b Appease gcc -Wuninitialized 2005-06-12 05:48:41 +00:00
lukem 81c4b0d591 Ensure nconv isn't used in __mbsconv() before being initialized.
Appease gcc -Wuninitialized elsewhere.
2005-06-12 05:45:38 +00:00
lukem aaf2af9078 Add missing __RCSID() 2005-06-12 05:34:34 +00:00
lukem 88c3eadbfa Add missing __RCSID() 2005-06-12 05:21:25 +00:00
christos 661bee744c unconst argument to swapctl(). 2005-06-12 02:57:58 +00:00
christos 19c38590ee PR/30500: Paul Shupak: Inconsistent definition of tilde_expand().
Provide a layer of indirection between the readline compatibility functions
and our internal implementation, so that we have the freedom to change the
function signature.
2005-06-11 18:18:59 +00:00
christos 3cfbfdb2ef Bug reported from Martin Dietze:
The place to change the completion_append_character is
    usually somewhere in the `rl_completion_entry_function'
    callback which is where one usually can distinguish between
    file- or dir-like entries to append a slash for dirs etc.

    This does no longer work since `fn_complete()' takes the
    `append_character' as argument before the callback is executed,
    so that changes to the variable `rl_completion_append_character'
    have in fact no effect for the current completion.

Fix by adding a function that returns the rl_completion_append_character,
when it gets passed in a filename in readline emulation.
2005-06-10 20:21:00 +00:00
christos 0320b64715 tilde expand should take a const argument. 2005-06-10 20:18:11 +00:00
dyoung 0ee313689a Fix bpf_open so that we can run tcpdump without write-access to
any of the /dev/bpf* device nodes.  In bpf_open, first try to open
each /dev/bpf* read-write; if that fails, try to open each read-only.
2005-06-10 19:00:09 +00:00
yamt 2d02304deb use malloc rather than mem_alloc (which is implemented using calloc)
for receive/send buffers to avoid unnecessarily anonymous memory bloat.
2005-06-09 22:13:17 +00:00
he 87292a6062 Initialize a variable to appease -Wuninitialized.
Marked with XXXGCC for dreamcast (found while compiling for it).

Reviewed by lukem.
2005-06-07 09:13:43 +00:00
chs 157d1a93e8 remove sigtramp version 1, we haven't used it in a long time. 2005-06-05 19:02:10 +00:00
chs bb7a930a0b fix function name in end-marker. 2005-06-05 19:01:04 +00:00
lukem e82ae39d67 Cosmetic tweak previous; IMHO we don't need the XXX comment in this
case, since I prefer to NULL initialize variables in this situation.
2005-06-05 01:15:29 +00:00
he 0d43148fcf Add an initialization to appease -Wuninitialized. Apparently the
sparc64 compiler gets this wrong.
2005-06-04 22:14:00 +00:00
dsl 217446d2aa Only advance 'p' once each time around the loop.... 2005-06-04 20:09:56 +00:00
wiz 2b67bf1d7d Bump date for previous. 2005-06-04 00:39:26 +00:00
wiz 649ba88889 Sort options. 2005-06-03 20:32:20 +00:00
christos 91168c6f92 Provide the minimum set of .WAIT barriers, adding explanatory comments.
From Patrick Welche, many thanks.
2005-06-03 14:28:07 +00:00
scw a14b1c10ef Nuke trailing whitespace. 2005-06-02 08:18:20 +00:00
lukem ac636bd17a Don't use non-standard uint or u_int. 2005-06-01 11:37:52 +00:00
lukem f9d230b4f6 appease gcc -Wuninitialized. some delint 2005-06-01 11:22:18 +00:00
lukem 9f3f3adf23 appease gcc -Wuninitialized 2005-06-01 11:08:57 +00:00
lukem 7fbaf47f83 Compile the following files with -Wno-uninitialized:
vfprintf.c	See rev 1.46 for why we can't fix this.
vfwprintf.c	Needs some effort
vfwscanf.c	Needs some effort
2005-06-01 11:06:01 +00:00
lukem 46af29904e appease gcc -Wuninitialized 2005-06-01 05:54:07 +00:00
lukem 3af3e6a479 appease gcc -Wuninitialized 2005-06-01 05:41:48 +00:00
lukem 63246b1ef4 Ensure dbp is initialized to NULL before trying to use it in an error codepath.
Detected with gcc -Wuninitialized.
(The bug was introduced in rev 1.13.  Hi Mycroft! :)
2005-06-01 05:39:17 +00:00
lukem d999a32485 Ensure that we don't try to free random memory when another malloc fails,
by initializing newprepare, newparent, and newchild to NULL.
Detected by gcc -Wuninitialized.
2005-06-01 05:30:54 +00:00