Commit Graph

2113 Commits

Author SHA1 Message Date
ps
43658697fc Change from using poll(2) to kqueue/kevent when waiting for a DNS
response to return.  This will stop processes waiting on DNS requests
from being woken up when a select collision occurs.  This was tested
on mx1.FreeBSD.org (outgoing mail for the FreeBSD.org mailing
lists.)

Reviewed by:	jlemon, peter
2000-09-12 11:37:20 +00:00
nectar
4b57274ae4 Set h_errno when an error is encountered.
PR:		bin/21092
Submitted by:	Alexander Kabaev <ak03@gte.com>
2000-09-10 19:06:05 +00:00
phk
d0fd2f76cf Add code to devname(3) so it can find the names of devices which
were not present when dev_mkdb(8) was run.

First the dev_mkdb(8) database is searched, this caters for non-DEVFS
cases where people have renamed a device.

If that fails we ask the kernel using sysctl kern.devname if the device
driver has put a name in the dev_t.  This covers DEVFS cloned devices.

If that also fails we format a string which isn't entirely useless.
2000-09-09 11:39:59 +00:00
ache
ddefbaa46b Prevent buffer overflow if NLSPATH is too long 2000-09-08 11:42:37 +00:00
kris
a1158cce42 Disallow '/' characters in LC_* environment variables which might
be used to point to a bad locale file. This is only believed to be a
minor security risk - the only risk is if some program uses the result
of a localized string as a format specifier in a vulnerable function
like sprintf(). No such code is believed to exist in the FreeBSD base
system, although it is possible that badly written third party code
would do that.

Submitted by:	imp
Approved by:	ache
2000-09-08 07:29:48 +00:00
nectar
5450aa20ea Fix getipnodebyname(3) bug.
Submitted by:	ume
2000-09-07 02:18:22 +00:00
nectar
748554442d 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
ache
962cffc5fb Add .El 2000-09-06 16:52:01 +00:00
ache
f7c8729376 Document %-macros and NLSPATH better. 2000-09-05 19:14:34 +00:00
ache
7925505886 Fully implement NLSPATH processing as described in SUSv2 2000-09-05 14:04:21 +00:00
phantom
5b566d9d01 Oops! don't set errno to ENOMEM explicitly if malloc() failed.
Found by:	ache
2000-09-05 12:23:08 +00:00
peter
459dd42211 Remove the SIGSYS handler and wrapper around the __getcwd() syscall.
It was kinda silly since the sigaction() syscall that it used to setup
the handler is more recent than __getcwd(), therefore it was useless
as the wrapper would have died before even getting as far as __getcwd(2).

Reminded by:	bde
2000-09-05 09:35:36 +00:00
peter
ebbd43d98f Yank out the NOPOLL conditionals. libc_r no longer needs it, and this
library depends on other things that come *way* later than poll() now
(sigset size changes in particular)
2000-09-04 21:28:16 +00:00
imp
9a4445204b Use .St -susv2 rather than "The Single UNIX Specification".
Submitted by: sheldonh
2000-09-04 15:38:58 +00:00
phantom
adbc56332d * move $FreeBSD$ tag to its usual place (bottom of copyright)
* mdoc cleanup
* document missing errno values (ERRORS section)

Reviewed by:	sheldonh
2000-09-04 13:20:56 +00:00
phantom
07bb417f8a Finaly cleanup libc/nls code:
* rewrite catopen() to remove duplicate code chunks and optimize
* if empty string is passed to catopen() as name argument then
   catopen() will set errno to ENOENT (File not found), not EINVAL
* move search code to LOOKUP() macro to shrink amount of duplicated code
* move common resource freeing actions to __nls_free_resources() function
* exclude from build code related to MCLoadAll defintion since it is not
  using at all
* style(9) related whitespace changes

Reviewed by:	ache
2000-09-04 12:09:40 +00:00
imp
78c14ae89a Don't print an error message if the bad option is '?'. This has been
in my tree for a long time.  bde reviewed this once upon a time and
said it was OK, iirc.  This also obviates the need to put ? in the
optstring argument to preclude the extra warning message which some
people think confuses users.  When I made my getopt cleanups of a long
time ago, this was the compromise reached.  I just neglected to commit
it until now.
2000-09-04 03:49:22 +00:00
imp
6eee268d67 The comparison against 0 should be against LC_ALL. category isn't a
boolean and it is LC_ALL that's special.

Someone submitted this to me a long time ago, but I can't find the
mail now.
2000-09-04 03:43:24 +00:00
imp
b21324d129 Soften the statement about select's timeout argument. This part of
the system likely won't change in the future, but the warning is a
good idea.
2000-09-04 03:32:30 +00:00
ache
bbd4badbd6 Rewrite using stdio. It cause program speedup since eliminates lots of small
read() syscalls.  It not cause static binary size increasing because stdio
already picked via setlocale() called from catopen()
2000-09-03 21:05:10 +00:00
ache
9ec6d409a0 Add:
The implementation will behave as if no library function calls strtok().
2000-09-03 13:24:28 +00:00
brian
3f670babb5 setproctitle() requires unistd.h and not libutil.h/-lutil 2000-09-02 02:25:34 +00:00
brian
5990f9fefc 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
ache
6d6923050a Treat empty lang as "C" lang too 2000-09-01 13:19:18 +00:00
phantom
5b3f190e28 Set rcsid to correct value
Resort #include files
Remove SYSV compatibility chunks
2000-09-01 12:19:00 +00:00
phantom
76465a7c58 protect .h file contents correctly. 2000-09-01 12:13:33 +00:00
phantom
2ae932bdcb Remove unused indirect references to cat* functions. 2000-09-01 12:10:59 +00:00
phantom
3fd2030fc4 Fix memory leak introduced by kris in rev 1.22 2000-09-01 11:56:31 +00:00
ache
abfec47a85 setlocale may return NULL, handle this case too by resetting to "C" 2000-09-01 11:13:38 +00:00
ache
fea9bbdd85 Move protection code down to handle NL_CAT_LOCALE case too. 2000-09-01 11:09:34 +00:00
ache
c023c260fc Protect from badly formed LANG variable 2000-09-01 10:54:04 +00:00
des
355bb561f3 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
ache
85d6a99272 catgets: detect if fd becomes invalid after exec and return default response
cosmetique, use NULL for pointers comparison
2000-08-30 11:44:44 +00:00
ache
b919003d91 Explicetely describe catalog descriptor lifetime 2000-08-30 10:22:23 +00:00
ache
59889a1524 strtok() -> strsep() (no strtok() in libraries allowed)
small cleanup in nearby area:
pointer 0 -> NULL, according to manpages
hardcoded constant -> sizeof(buf)
2000-08-29 21:04:07 +00:00
dwmalone
b008bd149c According to the susv2 man pages I have, remove(3) should act as
rmdir(2) on directories and unlink(2) otherwise. This modification,
and most of the man page update has been obtined from OpenBSD. This
was spotted by someone on a mailing lists a few months ago, but
I've lost their mail.

Reviewed by:	sheldonh
2000-08-28 15:45:42 +00:00
jhb
bd5034b9ae The API change mentioned in the previous revision has been backed out, so
back out the corresponding documentation.

Noticed by:	brian, ume
2000-08-22 21:50:03 +00:00
jhb
bed81b37b6 Remove duplicate FreeBSD id tags. 2000-08-21 21:05:44 +00:00
green
45b22e0c18 Fix style bugs (including ones introduced from OpenBSD). 2000-08-16 23:37:16 +00:00
ume
d4ba157d9f Don't retry connecting via the same medium.
I changed to close to original code before merging IPv6 support.
It seems having delay before another try is useless.  However, I'm
not sure that delay means.  So, I leave it as-is.

PR:		bin/20515
2000-08-10 17:10:57 +00:00
itojun
3168f0a4f8 mention getipnodeby* and get{addr,name}info are not thread-safe. (sync with kame)
s/.Os KAME/.Os/
comment From: Greg Thompson
2000-08-09 23:16:23 +00:00
green
18a0d97536 If using a DB_RECNO, db::put should return the new key if R_IAFTER is
set, not the previous key.

Add $FreeBSD$, not taking this off the vendor branch because it's not on.
2000-08-08 05:20:57 +00:00
jlemon
ed47465fd4 Document return value of ENOENT for nonexistent/invalid filter entries. 2000-08-07 16:47:35 +00:00
ben
5260de5ec7 Fix description of argv[0] passed to interpreted scripts; it's the name of
the interpreter, _not_ the argv[0] passed in the original exec() call.
2000-08-05 16:38:24 +00:00
kris
04e6eba710 Prevent internal buffer overflow due to expansion of $LANG and/or name
argument in catopen().

Reviewed by:	chris, -audit
2000-08-05 04:56:43 +00:00
kris
33c96b009f Calculate the string length of a u_long at compile-time, instead of using a
hardcoded value.
2000-08-04 11:07:57 +00:00
kris
81f8d1df4f Correct factor-of-10 error in INT_STRLEN_MAXIMUM() calculation. 2000-08-04 11:03:20 +00:00
kris
910d78b1f5 Correct string length bounds checking. 2000-08-04 10:53:37 +00:00
kris
6e733bdce9 Prevent TMPDIR overflow. 2000-08-04 10:50:21 +00:00
kris
3f1752b9dc Don't overflow the internal buffer in clnt_sperror() 2000-08-04 10:34:59 +00:00