Commit Graph

2726 Commits

Author SHA1 Message Date
Dag-Erling Smørgrav
2878b30827 Fix the "Unknown HTTP error" message.
Make compile_et generate prototypes.
1998-12-15 12:24:26 +00:00
Wes Peters
b1e12513fa Reviewed by: JKH
Submitted by:	Wes Peters

Added strtok_r (reentrant) function and man page.
1998-12-14 05:11:26 +00:00
Matthew Dillon
374fad8b17 Reviewed by: freebsd-current
Add bounds checking to netbios NS packet resolving code.  This should
    prevent natd from crashing on badly formed netbios packets (as might be
    heard when the machine is sitting on a cable modem or certain DSL
    networks), and also closes potential security holes that might have
    exploited the lack of bounds checking in the previous version of the
    code.
1998-12-14 02:25:32 +00:00
Steve Price
4c1a815f94 Commit out caveat about hardlinks to directories since they are
no longer possible.

PR:		8337
1998-12-13 23:35:01 +00:00
Matthew Dillon
9a0d08d599 PR: docs/9050
Add reference to required include file #include <stdlib.h> for
    getloadavg(3) function call.
1998-12-13 02:34:56 +00:00
Matthew Dillon
36058b68da Add required #include references to manual page 1998-12-13 02:32:59 +00:00
Matthew Dillon
0e31b6b580 oops. Fix indentation of the 'for' loop I just added. 1998-12-13 01:39:32 +00:00
Matthew Dillon
f16d2ab2d3 Handle the race condition where vipw may lock a password file which has
just been replaced.  After our lock succeeds we check if st_nlink is 0
    and if it is we close the descriptor and retry our open/lock sequence.
1998-12-13 01:36:45 +00:00
Doug Rabson
25b30a3ebb Add a simple library for accessing i/o ports and memory on the alpha.
This is only intended for use by the X server.
1998-12-12 18:05:06 +00:00
John Birrell
b6776b7488 CALL -> PCALL for sigaltstack for libc_r. 1998-12-10 20:36:24 +00:00
John Birrell
7897c2a418 Don't hide mknod, it doesn't need a wrapper and never has had one. 1998-12-10 20:27:52 +00:00
Steve Price
7b505024ed Add missing int to prototypes of mvaddstr and mvaddnstr.
PR:		8110
Submitted by:	Stephen J. Roznowski <sjr@home.net>
1998-12-10 02:35:24 +00:00
Bruce Evans
0fe8d9f3dd Removed unused include of <kvm.h>. It was alarming for libc to apparently
depend on libkvm.

Removed obsolete `#define _NEW_VFSCONF'.
1998-12-07 11:26:28 +00:00
Matthew Dillon
4bc34f94d6 Obtained from: "Jan B. Koum " <jkb@best.com>
Add a reference to pam(8) in the login(1) and login.access(5) manual
    pages.
1998-12-01 17:05:08 +00:00
Nate Williams
738006fa2c - Fix modulo bug that was masked by the correct code in libgcc.a which is
used in almost all programs unless a shared library specifically
  ignores libgcc.a.
1998-11-30 20:25:37 +00:00
Doug Rabson
3e0f4b28d6 On the alpha, sizeof(char*) != sizeof(int) which was assumed in
term_init().  This is the cause of /usr/bin/ftp faulting on the alpha.

Submitted by: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
1998-11-30 10:12:03 +00:00
Bruce Evans
d14e80a4d3 Fixed SUBDIR order. 1998-11-29 02:47:52 +00:00
Eivind Eklund
07bab7c6a4 Add support for pthread_mutexattr_settype(). As a side effect of
testing this, fix MUTEX_TYPE_COUNTING_FAST.  Recursive locks now work.
1998-11-28 23:52:58 +00:00
Joseph Koshy
2d08e623c1 Enable aio_read(2). 1998-11-24 08:15:08 +00:00
Joseph Koshy
5f67a9c8a1 Don't mention exit(3) in explanation; _exit(2) is a better choice. 1998-11-23 03:23:14 +00:00
John Polstra
c273f24b99 Install PAM modules into ${SHLIBDIR}, not ${LIBDIR}.
Noticed by:	bde
1998-11-22 19:33:27 +00:00
John Polstra
1fc5cffd7b Explicitly depend on libcrypt and libmd for a.out too. Fixes a PAM
related problem on a.out systems.
1998-11-22 19:26:39 +00:00
Jordan K. Hubbard
efbcb4ae03 Better document the file format, add in support for nested {}'s in multi-line
property values.
1998-11-22 13:20:09 +00:00
John Polstra
60da54eec3 Make sure libskey is built before libpam. It is required for one of
the PAM modules.

Fix the comments describing the PAM dependencies to be consistent
with other related comments.

Restructure the library-building loop slightly, per suggestion from
bde.
1998-11-20 02:03:45 +00:00
John Polstra
b2052ac8cf Fix a couple of typos. 1998-11-19 18:07:28 +00:00
Joseph Koshy
cbffe59841 Man page for aio_read(2).
Submitted by:	Terry Lambert <terry@whistle.com> on the -doc lists.
1998-11-19 04:07:55 +00:00
John Polstra
4820dc85d6 Enable the building of libpam. Move libradius and libtacplus up in
the list, because they are prerequisites for libpam.
1998-11-18 02:02:27 +00:00
John Polstra
9a10bb17e1 Build structure for contribified Linux-PAM, plus some home-grown
modules for FreeBSD's standard authentication methods.  Although
the Linux-PAM modules are present in the contrib tree, we don't
use any of them.

The main library "libpam" is composed of sources taken from three
places.  First are the standard Linux-PAM libpam sources from the
contrib tree.  Second are the Linux-PAM "libpam_misc" sources, also
from the contrib tree.  In Linux these form a separate library.
But as Mike Smith pointed out to me, that seems pointless, so I
have combined them into the libpam library.  Third are some additional
sources from the "src/lib/libpam" tree with some common functions
that make it easier to write modules.  Those I wrote myself.

This work has been donated to FreeBSD by Juniper Networks, Inc.
1998-11-18 01:44:37 +00:00
Jean-Marc Zucconi
9ba91dd44b Add an emply MAIN__() function. This avoid an unresolved reference error
during link phase when using fortran subroutines with non-fortran 'main()'.
1998-11-16 23:51:14 +00:00
Jacques Vidrine
90d1ac3b67 Update to reflect reality.
PR:		kern/8629
1998-11-16 03:49:39 +00:00
Kenneth D. Merry
b735c71405 Use snprintf to make sure we don't overflow a buffer. 1998-11-15 23:17:39 +00:00
Kenneth D. Merry
2327ec3a76 Fix an error message. (it was using an uninitialized variable)
Reported by:	dan@math.berkeley.edu (Dan Strick)
1998-11-15 23:12:42 +00:00
John Birrell
4896148e72 Interrupt threads waiting in select etc.
Submitted by: Alec Wolman <wolman@cs.washington.edu>
1998-11-15 10:01:34 +00:00
John Birrell
e7b7b3f3de Close a window between unlocking a spinlock and changing the thread state. 1998-11-15 09:58:26 +00:00
John Polstra
468662e864 Enable libradius and libtacplus. 1998-11-13 01:01:37 +00:00
John Polstra
2c195535b5 Initial import of TACACS+ client library donated by Juniper Networks, Inc. 1998-11-13 00:54:26 +00:00
John Polstra
082bfe6741 Initial import of RADIUS client library donated by Juniper Networks, Inc. 1998-11-13 00:53:01 +00:00
John Polstra
d3b89ae3a4 Build libmd shared for a.out too. Required for some PAM modules. 1998-11-12 04:08:10 +00:00
Dima Ruban
ac1b417f7c Cleanup. Make it compile on alpha. 1998-11-10 06:35:24 +00:00
Joseph Koshy
bee0365a4a Fix a .Nm -> .Fn fix that was missed in the previous commit.
Pointed-out-by:	Bruce Evans
1998-11-09 06:52:46 +00:00
Dag-Erling Smørgrav
08f9fcbfa8 fetch_err.h is a generated file, so don't look for it in ${.CURDIR}. 1998-11-07 08:59:38 +00:00
Dag-Erling Smørgrav
d8acd8dc5c Second of a series of cleanups to libfetch.
This commit introduces the following features:

 a) the fetchStat*() functions, which return meta-information for a
    document, such as size, modification time, etc.

 b) the use of the com_err(3) facilities to report errors.

It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.

Changed files, in alphabetical order:

 Makefile:
  Don't generate macros in {ftp,http}err.c.

  Generate category fields for the error message lists.

  Compile the error table.

  Install fetch_err.h along with fetch.h.

 common.c:
  Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
  error code in the _netdb_seterr() macro.

  Add categories to the _netdb_errlist table.

  Report errors through the Common Error library.

 common.h:
  Add the DEBUG macros.

  Add prototype for fetchConnect().

  Remove the prototype for _fetch_errstring(), which is local to common.c

  Add a categroy field to struct fetcherr, and define constants for
  error categories.

  Define macros for _{url,netdb,ftp,http}_seterr().

 errors.et: (new file)
  List error categories.

 fetch.3:
  Document the fetchStat*() functions.

  Move the "unimplemented functionality" comments from NOTES to BUGS.

  Document that applications which use libfetch must also use
  libcom_err, and list existing error codes.

  Undocument fetchLastErr{Code,String}.

  Remove the (empty) DIAGNOSTICS section.

  Mention Eugene Skepner in the AUTHORS section.

 fetch.c:
  Move the DEBUG macros to common.c

  Add fetchStat() and fetchStatURL().

  Generate error messages for URL parser errors, and fix a minor bug
  in the parser.

  Use 'struct url' instead of 'url_t'.

  Remove fetchLastErr{Code,String}.

 fetch.h:
  Use 'struct url' instead of 'url_t', and remove the typedef.

  Define struct url_stat (used by fetchStat()).

  Add prototypes for fetchStat*().

  Remove the declarations for fetchLastErr{Code,String}.

  Include fetch_err.h.

 fetch_err.et: (new file)
  Error table for libfetch.

 file.c:
  Add fetchStatFile().

  Use 'struct url' instead of 'url_t'.

 ftp.c:
  Add fetchStatFTP().

  Use 'struct url' instead of 'url_t'.

  Don't use fetchLastErrCode.

 ftp.errors:
  Add categories to all error messages.

 http.c:
  Add fetchStatHTTP().

  Use 'struct url' instead of 'url_t'.

  Don't use fetchLastErr{Code,Text}.

 http.errors:
  Add categories to all error messages.

Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
Dmitrij Tejblum
171a7528a8 Don't call pthread_mutex_lock with _SPINLOCK held.
Made pthread_cond_wait() more similar to pthread_cond_timedwait().

PR:		8375
1998-11-06 21:04:02 +00:00
David Greenman
adcac26551 Added info about non-blocking support. 1998-11-06 19:35:58 +00:00
Joseph Koshy
41a3e3b022 Update manual page to reflect changes in rev 1.12 of
"src/lib/libc/gen/popen.c" --- popen() in the child
now closes any copies of popen()'ed descriptors in the parent.
1998-11-06 07:09:22 +00:00
Dag-Erling Smørgrav
842a95cc23 First of a series of cleanups to libfetch. Changed files, in
alphabetical order:

 Makefile:
  Add common.c to SRCS.

  Make debugging easier by making 'CFLAGS += -DNDEBUG' conditional on DEBUG

  Don't declare struct {ftp,http}err in {ftp,http}err.c; use struct fetcherr
  instead.

 README:
  Remove the todo list, which is out of date anyway.

 common.c: (new file)
  Gather utility functions in this file.

  Merge the error reporting functions intp _fetch_errstring(),
  _fetch_seterr() and _fetch_syserr().

  Set fetchLastErrCode and fetchLastErrText appropriately when fetchConnect
  fails.

 common.h: (new file)
  Gather internal prototypes and structures in this files.

 fetch.3:
  Undocument fetchFreeURL().

  Document a few more known bugs.

  Document fetchLastErrCode and fetchLastErrText.

 fetch.c:
  Add descriptive comments to all functions that lacked them.

  Move fetchConnect() to common.c.

  Obviate the need for fetchFreeURL(), and remove it.

 fetch.h:
  Modify struct url_t so the document part is at the end.

 ftp.c:
  Remove code that is duplicated elsewhere.

 http.c:
  Remove code that is duplicated elsewhere.

Prompted by: jkh
1998-11-05 19:48:17 +00:00
David Greenman
eff8678df3 Added a manual page for sendfile(2). 1998-11-05 14:43:29 +00:00
Peter Wemm
49a35712aa Remove stray .endif from previous commit (I hope this is right) 1998-11-04 12:49:31 +00:00
Robert Nordier
8d2c3c32bd Include mergesort() in description of errors. 1998-11-04 09:27:03 +00:00
Robert Nordier
df5a1b840e Drop unused labels. 1998-11-04 09:22:07 +00:00
Robert Nordier
7fb5f2bae4 Handle a zero elements argument.
PR:		8566
Submitted by:	Archie Cobbs <archie@whistle.com>
1998-11-04 08:55:34 +00:00
Mike Smith
400a056059 Don't need this one anymore. 1998-11-04 07:40:05 +00:00
Mike Smith
b8ffd2a51c Well I never. Seems like _setjmp()/_longjmp() are just what the doctor
ordered.  This brings the Alpha back to parity, and should bring us
BootForth on both platforms.

Submitted by:	John Birrell (jb@freebsd.org)
1998-11-04 07:39:53 +00:00
Mike Smith
1add1a81da Improve the quality of isspace() to match expectations. This should make
the Ficl interpreter read its softwords array OK.
1998-11-04 07:04:00 +00:00
Mike Smith
797ed6379a Don't try to build (nonexistent) Alpha setjmp until we have one. 1998-11-04 00:32:08 +00:00
Mike Smith
25c3957dfd Move setjmp/longjmp implementations here from libc; no signal handling
in libstand, only for i386 until I locate an alpha setjmp/longjmp.

Minimal 64-bit gcc integer support for i386.  This is kinda nasty, and
should be revisited once we decide whether the bootblocks need
quad arithmetic.
1998-11-04 00:23:18 +00:00
Peter Wemm
86854f0360 A feeble attempt at kld compatability. The mount_* programs assume that
they cannot mount a filesystem that they cannot see in getvfsbyname().
Part 1 of this is a hack, make vfsisloadable() always return true - the
ultimate decider of whether it's loadable or not is kldload() or mount().
Part 2 of this is to have vfsload() call kldload(2) and return success if
it works.  This means that we will use a viable kld module in preference
to an LKM!
Ultimately, the thing to do is remove the hacks to do a vfsload in all the
mount_* commands and let the kernel do it by itself in mount(2).
1998-11-03 15:02:29 +00:00
Mike Smith
17bcf9c00a Add:
assert()
	setjmp()/longjmp()
	vsprintf()
1998-11-01 09:31:08 +00:00
Mike Smith
2baf3bb5a0 Add a new field to the devsw structure; dv_print, to print all valid units
etc. associated with the device entry.
Consider EOF an 'error' for fgetstr if we haven't read anything yet.

You *MUST* recompile and reinstall libstand before rebuilding the bootstrap.
1998-10-31 02:48:29 +00:00
Jean-Marc Zucconi
65f14a74bd Typo. 1998-10-30 23:50:48 +00:00
Mike Smith
ebed2088fe Prevent buffer overflow in getpwnam()
PR:		bin/8176
Submitted by:	Archie Cobbs <archie@whistle.com>
1998-10-29 23:16:24 +00:00
Robert Nordier
30af884929 Clarify processing of the string argument by psignal(). 1998-10-29 22:17:46 +00:00
Robert Nordier
4a3bc52a9c (Whoops: make it better instead of worse this time). Clarify
processing of the string argument by perror().
1998-10-29 22:08:59 +00:00
Robert Nordier
94cc971811 Clarify processing of the string argument by perror(). 1998-10-29 21:59:38 +00:00
Robert Nordier
e524a581b1 Check for a zero-length as well as a NULL string argument. 1998-10-29 14:40:20 +00:00
Robert Nordier
d223b5868e The man page implies that the string argument to psignal() may be
NULL, in line with perror(3).  However, the code presently checks only
for a zero-length string.  Check for both.
1998-10-29 11:39:39 +00:00
John Polstra
76a2643efb Handle ELF symbols better. This fixes "vmstat -i" for the case
where "/var/db/kvm_kernel.db" doesn't exist.
1998-10-28 06:37:49 +00:00
Mike Smith
f5ce88ded8 Fixes for handling 'wfd' (and any other disk with a non-2-character name)
Submitted by:	Some from Satoh Junichi (junichi@astec.co.jp)
1998-10-27 21:14:03 +00:00
Bill Fenner
551677729e ('): and ('); -> (:') and (;') 1998-10-26 19:36:38 +00:00
David E. O'Brien
af3212bd1d Bogon I somehow inserted between compiling and commiting... 1998-10-26 13:33:39 +00:00
David E. O'Brien
642201c23e Quiet many compiler warnings. Still fails -Wconversion in one case.
Required because:	-Werror is in Makefile
1998-10-26 11:54:36 +00:00
David E. O'Brien
2100aed918 Slight style police.
Add some content from objformat(1).
1998-10-25 13:29:57 +00:00
Andrey A. Chernov
a4beee718b fix unsigned overflow
PR: 8437
1998-10-25 05:06:42 +00:00
Dima Ruban
964b832929 Fix types. 1998-10-21 09:48:35 +00:00
Peter Wemm
ed1bbda829 Revert last change. mkstemp() wasn't to blame, it's nvi. However,
mkstemp() is not behaving as documented.
1998-10-20 15:33:21 +00:00
Peter Wemm
eb356f9af0 Stop mk*temp() from being pathologically stupid in the face of a umask(0);
There are other ways to fix this than wrapping _gettemp(), but this was
the most convenient.

Discovered by: bde
1998-10-20 12:36:36 +00:00
Dag-Erling Smørgrav
4da8edd59e Since vfork() was changed to fork(), we have to pass errno back from the
child to the parent somehow.

PR:		8353
Submitted by:	Andrew J. Korty <ajk@purdue.edu>
1998-10-20 11:34:11 +00:00
Doug Rabson
5a911c6263 Implement a hook to allow us to reclaim the memory used by the first stage
of the bootstrap (the bit which loads /boot/loader).
1998-10-19 09:08:40 +00:00
David E. O'Brien
d58fb9293a To clarify last commit, msmith says:
The reason the Alpha has less room than the i386 is because the bootstrap
is given a 256K mapping by the firmware; to add more requires extra work.
1998-10-17 22:20:06 +00:00
Mike Smith
95f5cf3349 Reduce the sbrk() increment from 64K to 4K. There's not much room on the
Alpha, and wasting potentially 64K-4 bytes of RAM just isn't an option.
1998-10-16 19:23:37 +00:00
Dag-Erling Smørgrav
af806462dc Fix style issues in execl(), and make execle() vfork()-safe.
Reviewed by:	bde
Approved by:	jkh
1998-10-15 17:14:15 +00:00
Mike Smith
26c51fb453 Conform to POSIX and close any copies of popen() descriptors inherited by a
popen()ed child.

PR:		misc/7810
Submitted by:	Wayne Scott <wscott@ichips.intel.com>
1998-10-15 01:47:40 +00:00
Kenneth D. Merry
17ee2b2055 Fix a couple of potential buffer overrun cases.
Submitted by:	imp
1998-10-14 23:28:26 +00:00
Dag-Erling Smørgrav
7ea577e550 Correct braino in previous commit. I get the pointy hat again. 1998-10-14 20:23:40 +00:00
Dag-Erling Smørgrav
dea625c872 Make execl() vfork()-safe. This should fix potential bugs in rcp,
telnet and tip, and probably a few other apps.

Reviewed by:	bde
Approved by:	jkh
1998-10-14 18:53:36 +00:00
Jordan K. Hubbard
eed80d041b correct prototype. 1998-10-14 11:04:36 +00:00
Kenneth D. Merry
01a4eb824c Add man pages for many of the functions in the CAM library. This covers
most of the open/close routines, and the buffer/cdb parsing routines
derived from the old scsi(3) library.

The cam_cdbparse(3) man page borrows from the old scsi(3) man page, so the
copyright and history section reflect that.

The many scsi_* functions and other functions that are pulled in from the
kernel aren't documented yet, but will be eventually.
1998-10-14 06:20:36 +00:00
Bruce Evans
47acf5563c Updated library order and comments about it. This fixes libm not
being built before libf2c and libmd not being built before libatm.
1998-10-13 16:48:43 +00:00
Dag-Erling Smørgrav
1fd98d7d88 Calls one or more of malloc(), warn(), err(), syslog(), execlp() or
execvp() in the child branch of a vfork(). Changed to use fork()
instead.

Some of these (mv, find, apply, xargs) might benefit greatly from
being rewritten to use vfork() properly.

PR:		Loosely related to bin/8252
Approved by:	jkh and bde
1998-10-13 14:52:33 +00:00
Kenneth D. Merry
621a60d46b Add a "dummy light" (actually two dummy lights) to catch people who don't
have the passthrough device configured in their kernel.

This will hopefully reduce the number of people complaining that they can't
get {camcontrol, xmcd, tosha, cdrecord, etc.} to work.

Reviewed by:	gibbs
1998-10-12 21:54:13 +00:00
Dag-Erling Smørgrav
b2d3d0f097 Avoid the "Cannot allocate memory" problem that appears on heavily
loaded systems by retrying the sysctl() with a larger buffer if it
fails with ENOMEM. For good measure, allocate 10% more memory than
sysctl() claims is necessary.

PR:		8275
Reviewed by:	David Greenman <dg@freebsd.org>
1998-10-12 20:36:33 +00:00
Kenneth D. Merry
13a5277c23 Fix a curses bug exposed by the ":numbers" display of systat -iostat.
This bug showed up when you had more than 3 devices displayed.  (thus
requiring a second line of display)

Here's a quote From the PR:

 When wrefresh() is called with a subwindow as argument, __set_subwin
 might be called with reversed arguments if wrefresh() decides to calls
 quickch().  This may cause use of negative array indexes, with a
 resulting segfault.

 Since quickch() manipulates the line structures belonging to curscr,
 it looks like all subwindows of curscr should be updated.

PR:		bin/8086
Submitted by:	Tor Egge <Tor.Egge@fast.no>
1998-10-12 16:32:32 +00:00
John Polstra
0651835dae Eliminate nested comment warning.
Submitted by:	lh@aus.org
1998-10-11 17:14:56 +00:00
Bruce Evans
a9d7016af5 Fixed removing of obsolete shared libraries:
- the directory was wrong if ${SHLIBDIR} != ${LIBDIR}.  It's still wrong
  if the installation of the obsolete library was done before /aout was
  appended to LIBDIR.
- the version would have become wrong when the default in ../Makefile.inc
  is changed from 2.0.
- the comment mostly described moving of libraries to /usr/lib/compat, but
  we don't do that.
1998-10-11 16:33:02 +00:00
Peter Wemm
0c372549f6 Avoid the need for calling functions that malloc after a vfork(). 1998-10-11 14:11:51 +00:00
Peter Wemm
b550818d8d libopie also depends on libmd. Programs using libopie shouldn't have to
know about libopie's internals in order to use it.
1998-10-11 04:45:50 +00:00
Peter Wemm
78c6a7e037 libf2c.so.* depends on libm.so. I'm not sure that this matters in this
case because I expect the f2c front-end should add the -lm automatically.
1998-10-11 04:44:12 +00:00
Peter Wemm
85a6383125 libatm uses libmd; add it to the dependency list so that programs using
libatm are not forced to know the internals of it's implementation.
1998-10-11 04:41:43 +00:00
Peter Wemm
5cc7d6a524 Deal with /usr/lib/compat/aout, and that we've been installing things
in the wrong places for a while.
Also, the the libtermlib.so -> libtermcap.so manually for elf, otherwise
the hard link follows the symlink and the result looks rather wierd.  The
*.a files are still hard linked under elf as before.
1998-10-11 04:39:56 +00:00
Peter Wemm
29b678437f Don't build elf libresolv.so*, no elf freebsd binaries have used it ever.
Also, the a.out compat version is supposed to go into /usr/lib/compat/aout.
Try and clean up the mess left behind in /usr/lib/compat.
1998-10-11 04:21:56 +00:00