Commit Graph

466 Commits

Author SHA1 Message Date
Peter Wemm
9bb715b7fd I have not tested this to completion yet, but this appears to fix world.
Add nsswitch.h to the list of includes installed.
2000-09-07 00:10:02 +00:00
Jacques Vidrine
248aee623c Add nsswitch support. By creating an /etc/nsswitch.conf file, you can
configure FreeBSD so that various databases such as passwd and group can be
looked up using flat files, NIS, or Hesiod.

= Hesiod has been added to libc (see hesiod(3)).

= A library routine for parsing nsswitch.conf and invoking callback
  functions as specified has been added to libc (see nsdispatch(3)).

= The following C library functions have been modified to use nsdispatch:
    . getgrent, getgrnam, getgrgid
    . getpwent, getpwnam, getpwuid
    . getusershell
    . getaddrinfo
    . gethostbyname, gethostbyname2, gethostbyaddr
    . getnetbyname, getnetbyaddr
    . getipnodebyname, getipnodebyaddr, getnodebyname, getnodebyaddr

= host.conf has been removed from src/etc.  rc.network has been modified
  to warn that host.conf is no longer used at boot time.  In addition, if
  there is a host.conf but no nsswitch.conf, the latter is created at boot
  time from the former.

Obtained from:	NetBSD
2000-09-06 18:16:48 +00:00
Brian Somers
9feac5c218 Move setproctitle() from libutil to libc (after a repo-copy)
and bump __FreeBSD_version to 500012 to mark the occasion.

setproctitle() is prototyped in unistd.h as opposed to stdlib.h
where OpenBSD and NetBSD have it.

Reviewed by: peter
2000-09-02 01:51:36 +00:00
Dag-Erling Smørgrav
1250db8139 Import XPG4-compliant basename(3) and dirname(3) from OpenBSD.
The man pages need some adjustments.

PR:		12960, 12962
Submitted by:	James Howard <howardjp@wam.umd.edu>
Obtained from:	OpenBSD
2000-08-31 15:56:15 +00:00
Brian Feldman
04c9749ff0 Add working and easy crypt(3)-switching. Yes, we need a whole new API
for crypt(3) by now.  In any case:

Add crypt_set_format(3) + documentation to -lcrypt.
Add login_setcryptfmt(3) + documentation to -lutil.
Support for switching crypt formats in passwd(8).
Support for switching crypt formats in pw(8).

The simple synopsis is:
edit login.conf; add a passwd_format field set to "des" or "md5"; go nuts :)

Reviewed by:	peter
2000-08-22 02:15:54 +00:00
John Baldwin
0e8911b395 Revert gratuitous whitespace changes from revisions 1.111 and 1.112. 2000-08-17 07:51:48 +00:00
Peter Wemm
253fafca68 Add a prototype for rfork_thread().
pid_t rfork_thread(int forkflags, void *stack, int (*func)(void *arg),
                   void *arg);
A new process is created, presumably using RFMEM shared address space.
The child process switches to the supplied stack, which is set up with a
function call frame.  The function is called with the supplied arguement.
If the function returns, the return value will be used with _exit(2).
2000-07-29 11:53:35 +00:00
Marcel Moolenaar
11017a687b Backout addition of -L switch to mtree. Using -L breaks the
build process in too many cases. Adding mtree to bootstrap-tools
to solve this breaks the upgrade path because mtree needs a
libc that has strtofflags and fflagstostr.
2000-07-23 16:33:00 +00:00
Nick Sayer
e9e8de0698 Back out 1.15. It caused more harm than good. Something, however,
must be done to fix this situation.

Submitted by: bde
2000-07-21 14:49:09 +00:00
Andrey A. Chernov
043ada1051 Add -L to mtree 2000-07-16 08:19:49 +00:00
Alfred Perlstein
e31830e941 fix spelling errors.
Pointed out by: bde
2000-07-07 16:52:24 +00:00
Alfred Perlstein
55241422d6 cleanup the tsearch import.
remove (comment out) functions defined or depricated elsewhere:
  bsearch, lfind, lsearch, insque, remque

change hcreate to take a size_t rather than uint (essentially the same)

since hcreate/hdestroy are now in <search.h>, remove private search.h
in lib/libc/db/hash/

add $FreeBSD tags to hsearch.c
2000-07-06 20:04:34 +00:00
Jun-ichiro itojun Hagino
23ba01423e add getifaddrs(3) from bsdi. this is a magic function which lets you grab
interface addresses in a portable manner, without headache of SIOCGIFCONF
or sysctl.  it is in bsdi/openbsd/netbsd already.
from kame tree (actually, mandatory for latest kame tree).
2000-07-05 02:13:17 +00:00
Dan Moschuk
e63a7af508 Add URI encoding to the vis/unvis routines courtesy of VIS_HTTPSTYLE.
Since alex is a -doc committer, he can update his own manpage. :-)

Also add $FreeBSD$ while I'm here.

Submitted by: alex
2000-07-01 15:55:49 +00:00
Alfred Perlstein
64566a3e2a bring in binary search tree code.
Obtained from: NetBSD
2000-07-01 06:55:11 +00:00
Nick Sayer
cbe8602290 Moving forward on my commitment to always make at least one commit from
a terminal room of any conference I attend....

Fix xdrproc_t prototype. () instead of (...) breaks C++ programs.
2000-06-22 01:46:25 +00:00
Josef Karthauser
c5bb91d1b2 Add strtofflags and fflagstostr to libc. 2000-06-17 11:55:57 +00:00
Jake Burkholder
e39756439c Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by:		msmith and others
2000-05-26 02:09:24 +00:00
Jake Burkholder
740a1973a6 Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by:	phk
Reviewed by:	phk
Approved by:	mdodd
2000-05-23 20:41:01 +00:00
Peter Wemm
f612e24f9e Install /usr/include/dev/ppbus as well as dev/usb 2000-05-19 22:08:18 +00:00
Bruce Evans
80a07932e7 Fixed missing consts for function parameters, so that the code matches
the man page and POSIX.1.  Fixed nearby misformatting.  Fixed a missing
prototype.
2000-05-11 15:57:17 +00:00
John Baldwin
bde8875a06 Finish moving all IEEE fp types to be the same on all arch's. 2000-05-10 19:41:40 +00:00
David E. O'Brien
8d1d19d347 fp_except => fp_except_t for consistancy with the i386 and the tradition
C methoid of nameing types.
2000-05-10 19:00:45 +00:00
Jonathan Lemon
83a15ece20 Revert previous commit, and remove the <event.h> symlink. As this is
a system-specific extension, not a standardized interface, it should
be located with the sys/ includes.

Requested by:	wollman
2000-04-18 17:00:22 +00:00
Jonathan Lemon
6fad667de2 Create <event.h> -> <sys/event.h> link that I forgot earlier.
Reminded by:	ache
2000-04-16 22:31:49 +00:00
Ruslan Ermilov
3021afb53e The idea always was that `make copies' should undo the
`make symlinks' job, but it got broken in rev 1.109.

Restore the correct behaviour.
2000-04-06 07:33:29 +00:00
Jason Evans
60ad8853e0 Do not conditionalize function prototype definition for functions we
implement.

Noticed by:	Thimble Smith <tim@mysql.com>
Approved by:	jkh
2000-02-20 07:40:25 +00:00
David E. O'Brien
f506ed7467 There is a problem in that one cannot use ctype.h at the same time as parts
of the C++ stdlib.  Our ctype.h uses symbols of the form _<X> to denote the
various character classes.  Our ctype.h also extends the usual ctype.h
offering by adding the "_T" (special) class.  Problem is parts of the STL
also use the symbol "_T" as its parameterized type.  These two uses are
incompatible.

Thus change the form of the symbols used in ctype to something that fixes
the current problem and is less likely to cause conflicts in the future.

Requested by:	Tomoaki NISHIYAMA <tomoaki@biol.s.u-tokyo.ac.jp>
Ok'ed by:	JKH
2000-02-08 07:43:26 +00:00
Yoshinobu Inoue
12cefbcc20 Change IPv6 address scope delimeter from '@' to '%' as recent KAME change.
'@' conflicts with existing notations such as user@host, so '%' is better.

Approved by: jkh

Obtained from: KAME project
2000-02-08 05:12:45 +00:00
Josef Karthauser
418d67b0d9 Revert part of the last commit, remove {g|s}etflags from the libc
interface, and statically link them to the programs using them.
These functions, upon reflection and discussion, are too generically
named for a library interface with such specific functionality.
Also the api that they use, whilst ok for private use, isn't good
enough for a libc function.

Additionally there were complications with the build/install-world
process.  It depends heavily upon xinstall, which got broken by
the change in api, and caused bootstrap problems and general mayhem.

There is work in progress to address future problems that may be
caused by changes in install-chain tools, and better names for
{g|s}etflags can be derived when some future program requires them.
For now the code has been left in src/lib/libc/gen (it started off
in src/bin/ls).

It's important to provide library functions for manipulating file
flag strings if we ever want this interface to be adopted outside
of the source tree, but now isn't necessarily the right moment
with 4.0-release just around the corner.

Approved:	jkh
2000-02-05 18:42:36 +00:00
Yoshinobu Inoue
e3be4d7b7e sync iruserok() extension API with other BSDs
Some of rcmd related function is need to be updated to
  support IPv6. Some of them are already updated as standard
  document. But there is also several de-facto functions and
  they are not listed in standard documents.
  They are,

    iruserok()  (used by rlogind, rshd)
    ruserok()   (used by kerberos, etc)

  KAME package updated those functions in original way.

    iruserok_af()
    ruserok_af()

  But recently there was discussion on IETF IPng mailing
  list about how to sync those API, and it is decided,

    -Those function is not standard and not documented.
    -But let BSDs sync their API as de-facto.

  And after some discussion, it is announced that

    -add update to iruserok() as iruserok_sa()
    -no ruserok() API change(it is only updated internaly)

So I sync those API before 4.0 is released.
The changes are,
   -prototype changes
   -ruserok() internal update (use iruserok_sa() inside)
   -removal of ruserok_af()
   -change iruserok_af() as static functioin, and also prefix the name with __.
   -add iruserok_sa() (Just call __iruserok_af() inside)
   -adding flag AI_ALL to getipnodebyaddr() called from __icheckhost().
    This is necessary to support IPv4 communication via AF_INET6 socket
    could be correctly authenticated via iruserok_sa()
   -irusreok_af() call is replaced to iruserok_sa() call
    in rlogind, and rshd.

Approved by: jkh
2000-02-01 15:55:56 +00:00
John Polstra
8a889bcb26 Add a #define for RTLD_LOCAL as required by the Single Unix
Specification.
2000-01-29 01:53:35 +00:00
Josef Karthauser
18c0eeddf7 Historically file flags (schg, uschg, etc) have been converted from
string to u_long and back using two functions, flags_to_string and
string_to_flags, which co-existed with 'ls'.  As time has progressed
more and more other tools have used these private functions to
manipulate the file flags.

Recently I moved these functions from /usr/src/bin/ls to libutil,
but after some discussion with bde it's been decided that they
really ought to go in libc.

There are two already existing libc functions for manipulating file
modes:  setmode and getmode.  In keeping with these flags_to_string
has been renamed getflags and string_to_flags to setflags.

The manual page could probably be improved upon ;)
2000-01-27 21:17:01 +00:00
Peter Wemm
4ba5197729 Sigh. Really fix it this time. It seems the first time through the
run it would modify the source tree, causing it to fail the second
time around. Sigh.
2000-01-26 17:38:51 +00:00
Peter Wemm
400dc95012 Fix world breakage (kdump, truss) causes by rev 1.107 (adding dev/usb).
It was creating ${.OBJDIR}/${MACHINE}/usr/include/dev -> .../sys/dev
and mkioctls would descend that and saw *all* of src/sys/dev/*/*.h,
not just dev/usb/*.h.  It then choked on the dpt includes.
2000-01-26 17:12:09 +00:00
Yoshinobu Inoue
469bed11ef bindresvport related changes
-changed bindresvport2 to bindresvport_sa
 -merged the man into bindresvport.3

All discussion between Jean-Luc Richier <Jean-Luc.Richier@imag.fr>,
Theo de Raadt <deraadt@cvs.openbsd.org>, itojun, is reflected to
this code. (Actually Theo de Raadt write the code simultaneously as the
discussion change.)
2000-01-26 09:02:42 +00:00
Yoshinobu Inoue
0cac72f42c several tcp apps IPv6 update
-inetd
 -rshd
 -rlogind
 -telnetd
 -rsh
 -rlogin

Reviewed by: freebsd-arch, cvs-committers
Obtained from: KAME project
2000-01-25 14:52:10 +00:00
Nick Hibma
fcc56d9930 Install the USB include files in /usr/include/dev/usb.
We should still sort out some way of avoiding the clutter. Not all files
should be there.

Prompted by:   Louis A. Mamakos <louie@TransSys.COM>
2000-01-25 09:24:23 +00:00
Peter Wemm
d60809caa9 Add prototypes for [sg]etres[ug]id(). 2000-01-17 13:32:55 +00:00
Bruce Evans
a5341e911c Fixed disordering, misformatting, and duplicate declaration of
iruserok_af() in previous commit.
2000-01-14 15:43:27 +00:00
Yoshinobu Inoue
42b4f28ebd libc rcmd update for IPv6.
A new function bindresvport2(), AF independent version of bindresvport()
is also added.

Reviewed by: sumikawa
Obtained from: KAME project
2000-01-13 15:09:48 +00:00
Daniel Eischen
3eadb69d1f Make sched_param parameter a const to comply with POSIX and SUSv2 specs.
This doesn't need to be applied to stable, because somehow -stable seems
to have gotten it right.

Reviewed by:	jasone
2000-01-10 04:14:08 +00:00
John Polstra
4fba53a082 Remove the comment warning that the dllockinit() interface might
change.  I have decided that the interface is general enough to
last.
2000-01-09 20:57:21 +00:00
Peter Wemm
c447342094 Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"
is an application space macro and the applications are supposed to be free
to use it as they please (but cannot).  This is consistant with the other
BSD's who made this change quite some time ago.  More commits to come.
1999-12-29 05:07:58 +00:00
John Polstra
3600eb76c6 Work around an assert failure in the dynamic linker's default thread
locking functions.  If an application loads a shared object with
dlopen() and the shared object has an init function which requires
lazy binding, then _rtld_bind is called when the thread is already
inside the dynamic linker.  This leads to a recursive acquisition
of the lock, which I was not expecting -- hence the assert failure.

This work-around makes the default locking functions handle recursive
locking.  It is NOT the correct fix -- that should be implemented
at the generic locking level rather than in the default locking
functions.  I will implement the correct fix in a future commit.

Since the dllockinit() interface will likely need to change, warn
about that in both the man page and the header file.
1999-12-28 04:38:17 +00:00
Yoshinobu Inoue
7d56d3747c Getaddrinfo(), getnameinfo(), and etc support in libc/net.
Several udp and raw apps IPv6 support.

Reviewed by: freebsd-arch, cvs-committers
Obtained from: KAME project
1999-12-28 02:37:14 +00:00
John Polstra
d3980376e8 Add a new function dllockinit() for registering thread locking
functions to be used by the dynamic linker.  This can be called by
threads packages at start-up time.  I will add the call to libc_r
soon.

Also add a default locking method that is used up until dllockinit()
is called.  The default method works by blocking SIGVTALRM, SIGPROF,
and SIGALRM in critical sections.  It is based on the observation
that most user-space threads packages implement thread preemption
with one of these signals (usually SIGVTALRM).

The dynamic linker has never been reentrant, but it became less
reentrant in revision 1.34 of "src/libexec/rtld-elf/rtld.c".
Starting with that revision, multiple threads each doing lazy
binding could interfere with each other.  The usual symptom was
that a symbol was falsely reported as undefined at start-up time.
It was rare but not unseen.  This commit fixes it.
1999-12-27 04:44:04 +00:00
Bruce Evans
de7067ac25 Fixed missing declaration of ctermid_r(3). 1999-12-23 16:33:12 +00:00
Bruce Evans
c6dfd71a9f Fixed missing declaration of getlogin_r(3). 1999-12-23 16:06:12 +00:00
Bruce Evans
dea750ae4c Fixed missing declaration of rand_r(3). 1999-12-23 15:58:20 +00:00