Commit graph

1955 commits

Author SHA1 Message Date
Peter Wemm 6173688707 Remove old SIGALRM absorbing back-compat code. It wasn't working at all
for the entire time that it was there, so obviously nothing needs it
anymore.

Note, unix98/single-unix spec v2 says that usleep() returns an int rather
than a void, to indicate whether the entire time period elapsed (0) or an
error (eg: signal handler) interrupted it (returns -1, errno = EINTR)
It is probably useful to make this change but I'll test it locally first
to see if this will break userland programs [much]...

Reviewed by: ache, bde
1997-10-15 14:11:08 +00:00
Peter Wemm 9f375c3252 Give up on the "try and compensate for broken programs" cruft and revert
back to the original single nanosleep() implementation.  This is POSIX and
Unix98 (aka single-unix spec v2) compliant behavior.  If a program sets
alarm(2) or an interval timer (setitimer(2)) without a SIGALRM handler
being active, sleep(3) will no longer absorb it, and the program will get
what it asked for..... :-]

The original reason for this in the first place (apache) doesn't seem to
need it anymore, according to Andrey.

Reviewed by: ache, bde
1997-10-15 14:06:15 +00:00
Bill Paul 4c45fb08aa Correct a bug in the 'allow arbitrary number of socket descriptors' changes
made to the RPC code some months ago. The value of __svc_fdsetsize is being
calculated incorrectly.

Logically, one would assume that __svc_fdsetsize is being used as a
substitute for FD_SETSIZE, with the difference being that __svc_fdsetsize
can be expanded on the fly to accomodate more descriptors if need be.
There are two problems: first, __svc_fdsetsize is not initialized to 0.
Second, __svc_fdsetsize is being calculated in svc.c:xprt_registere() as:

                __svc_fdsetsize = howmany(sock+1, NFDBITS);

This is wrong. If we are adding a socket with index value 4 to the
descriptor set, then __svc_fdsetsize will be 1 (since fds_bits is
an unsigned long, it can support any descriptor from 0 to 31, so we
only need one of them). In order for this to make sense with the
rest of the code though, it should be:

                __svc_fdsetsize = howmany(sock+1, NFDBITS) * NFDBITS;

Now if sock == 4, __svc_fdsetsize will be 32.

This bug causes 2 errors to occur. First, in xprt_register(), it
causes the __svc_fdset descriptor array to be freed and reallocated
unnecessarily. The code checks if it needs to expand the array using
the test: if (sock + 1 > __svc_fdsetsize). The very first time through,
__svc_fdsetsize is 0, which is fine: an array has to be allocated the
first time out. However __svc_fdsetsize is incorrectly set to 1, so
on the second time through, the test (sock + 1 > __svc_fdsetsize)
will still succeed, and the __svc_fdset array will be destroyed and
reallocated for no reason.

Second, the code in svc_run.c:svc_run() can become hopelessly confused.
The svc_run() routine malloc()s its own fd_set array using the value
of __svc_fdsetsize to decide how much memory to allocate. Once the
xprt_register() function expands the __svc_fdset array the first time,
the value for __svc_fdsetsize becomes 2, which is too small: the resulting
calculation causes the code to allocate an array that's only 32 bits wide
when it actually needs 64 bits. It also uses the valuse of __svc_fdsetsize
when copying the contents of the __svc_fdset array into the new array.
The end result is that all but the first 32 file descriptors get lost.

Note: from what I can tell, this bug originated in OpenBSD and was
brought over to us when the code was merged. The bug is still there
in the OpenBSD source.

Total nervous breakdown averted by: Electric Fence 2.0.5
1997-10-14 21:50:17 +00:00
Bruce Evans b2fad8ae7a Moved `SRCS+= frexp.c' to the correct Makefile.inc.
Sorted SRCS.
1997-10-14 07:43:33 +00:00
Bruce Evans 9386dc4deb Moved `SRCS+= frexp.c' to the correct Makefile.inc. 1997-10-14 07:43:18 +00:00
Bruce Evans 1df595f25d Fixed searching of $PATH in execvp(). Do what sh(1) should do according
to POSIX.2.  In particular:

- don't retry for ETXTBSY.  This matches what sh(1) does.  The retry code
  was broken anyway.  It only slept for several seconds for the first few
  retries.  Then it retried without sleeping.
- don't abort the search for errors related to the path prefix, in
  particular for ENAMETOOLONG, ENOTDIR, ELOOP.  This fixes PR1487.  sh(1)
  gets this wrong in the opposite direction by never aborting the search.
- don't confuse EACCES for errors related to the path prefix with EACCES
  for errors related to the file.  sh(1) gets this wrong.
- don't return a stale errno when the search terminates normally without
  finding anything.  The errno for the last unsuccessful execve() was
  usually returned.  This gave too much precedence to pathologies in the
  last component of $PATH.  This bug is irrelevant for sh(1).

The implementation still uses the optimization/race-inhibitor of trying
to execve() things first.  POSIX.2 seems to require looking at file
permissions using stat().  We now use stat() after execve() if execve()
fails with an ambiguous error.  Trying execve() first may actually be a
pessimization, since failing execve()s are fundamentally a little slower
than stat(), and are significantly slower when a file is found but has
unsuitable permissions or points to an unsuitable interpreter.

PR:		1487
1997-10-14 07:23:16 +00:00
Bill Paul e882d43eca Improve the innetgr() NIS+ compat kludge. We should only fail over to the
'slow' lookup if we get a YPERR_MAP (no such map in server's domain) error
instead of failing over on any error. In the latter case, if the 'fast'
search fails legitimately (i.e. the user or host really isn't a member
of the specified netgroup) then we end up doing the 'slow' search and
failing all over again. The result is still correct, but cycles are
consumed for no good reason.

Also removed the #ifdef CHARITABLE since the compat kludge is no longer
optional.
1997-10-13 17:09:15 +00:00
Satoshi Asami fc702c5bc8 Make this file p-make clean. (Use "ld -O foo" instead of "ld; mv
a.out foo".)

Reviewed by:	bde (actually more like "Suggested by")
1997-10-11 02:37:42 +00:00
Bill Paul c17942ca57 NIS+ compatibility kludge. A long time ago, I set up innetgr() so
that if searching through the special netgroup.byhost or netgroup.byuser
maps didn't work, we would roll over to the 'slow' method of grovelling
though the netgroup map and working out the dependencies on the fly.
But I left this option hidden inside an #ifdef CHARITABLE since I
didn't think I'd ever need it.

Well, the Sun rpc.nisd NIS+ server in YP compat mode doesn't support
the .byhost and .byuser reverse maps, so the  failover is necessary
in order to be compatible. *sigh*

This closes PR #3891, and should be merged into RELENG_2_2.
1997-10-11 00:03:25 +00:00
Peter Wemm 112dfe815d Also install pcap-int.h so things can call pcap_compile on arbitary
expressions (eg: in pppd)
1997-10-10 11:55:42 +00:00
Philippe Charnier 8b76e1d7a8 Staticize usage(). Cosmetics. 1997-10-10 06:27:07 +00:00
John Dyson 44f203cb96 Add the AIO/LIO to libc. They aren't fully done yet, but have been in the
kernel for a few months.
1997-10-10 05:48:16 +00:00
Joerg Wunsch cfeb4fd273 Remove the claim that UUCP locking were not atomic. It is since
revision 1.8 of uucplock.c.
1997-10-07 07:24:50 +00:00
David E. O'Brien b90b0ce7ab Add passwd(5) to "SEE ALSO".
ISSUES:
        An example and better explansion on how to specify a user's login
	class in /etc/master passwd is needed.
	(As I don't seem to be specifiying it right, I can't do it).
1997-10-07 05:40:36 +00:00
Jordan K. Hubbard 97fe7f477f Changes to support full make parallelism (-j<n>) in the world
target.
Reviewed by:	<many different folks>
Submitted by:	Nickolay N. Dudorov" <nnd@nnd.itfs.nsk.su>
1997-10-05 09:40:24 +00:00
Wolfgang Helbig b9b51fb731 Merged in better support of ISO 8601 from elsie.nci.nih.gov.
Added the conversion specifiers %g and %G, that are replaced
by the year which contains the greater part of the week in question.
1997-10-03 19:06:57 +00:00
Bill Fenner b1cb1b02f1 Teach ftpErrString to format UNIX errnos, since at least ftpLogin()
can return UNIX errnos.  When UNIX errnos catch up with FTP status
codes (e.g. at 100) a new way will have to be found to tell which
is which.

This allows fetch to print errors like
fetch: ftp.fu-berlin.de: No route to host
instead of
fetch: ftp.fu-berlin.de: Unknown error
1997-10-02 23:26:03 +00:00
Søren Schmidt b478da3630 Add rudimentary support for using the keyboard. 1997-10-01 20:53:41 +00:00
Poul-Henning Kamp 62a9dc968b Update to tcl8.0 release version. 1997-10-01 13:37:27 +00:00
Andrey A. Chernov b1769be32c Move locks from /etc/opielocks to /var/run/opielocks to keep
/etc  non-writeable as possible
1997-10-01 13:02:20 +00:00
Jordan K. Hubbard dcb69d91c2 Correct an ancient bogon which involved trying to read() from a
nuked file descriptor.  This is probably why sysinstall's ftp xfer
occasionally SEGV'd if you left things alone for a long time and
the timeout code got called.  Whoops!
1997-10-01 07:21:41 +00:00
Andrey A. Chernov 7c92864437 Bump minor number 1997-09-29 21:40:17 +00:00
Wolfram Schneider bf5cbf3551 Sort cross refereces in section SEE ALSO. 1997-09-29 19:11:55 +00:00
Wolfram Schneider 2af22b06a4 Endless loop.
$ vipw
[corrupt a line in editor, exit editor]
pwd_mkdb: corrupted entry
pwd_mkdb: at line #2
pwd_mkdb:
/etc/pw.012585: Inappropriate file type or format
re-edit the password file? [y]: n^D^D
[hang]
1997-09-29 13:13:51 +00:00
Andrey A. Chernov 5fb9db85bb Add setutent.c 1997-09-29 11:38:36 +00:00
Andrey A. Chernov bcd05664ce EXT_KEYS gone, STD ommited 1997-09-29 10:55:46 +00:00
Andrey A. Chernov 3f3386c2a8 Add logwtmp.c 1997-09-29 10:49:21 +00:00
Andrey A. Chernov e9fcc517e1 Merge 1997-09-29 10:33:14 +00:00
Mike Smith af35b9ccb0 Revert the previous prototype un-typo. Add a brief comment warning that
"fixing" it is not a good idea.
1997-09-28 17:11:31 +00:00
Mark Murray 0e8089efef Changes for KTH KerberosIV 1997-09-28 09:08:48 +00:00
Mark Murray 7f80a02080 Changes for KTH KerberosIV.
Also quieten -Wall a bit.
1997-09-28 08:57:24 +00:00
Mike Smith 378a2883fe Typo fix 1997-09-28 03:28:34 +00:00
Mike Smith 27c729f066 Fix typo in signal() prototype 1997-09-28 03:28:09 +00:00
Andrey A. Chernov 46dba712f1 Use revived __maskrune for digittoint
Minor formatting
1997-09-27 04:34:35 +00:00
Andrey A. Chernov 08401510be Add mskanji.c 1997-09-25 23:24:35 +00:00
Andrey A. Chernov 3f2fd98c12 Move it under XPG4 define 1997-09-25 23:20:26 +00:00
Andrey A. Chernov bed2de7d4c Move MSKanji under XPG4 define 1997-09-25 23:18:10 +00:00
Andrey A. Chernov 1284c1ad08 __maskrune --> __istype 1997-09-25 23:10:38 +00:00
Julian Elischer 16f76e6f06 Submitted by: Sin'ichiro MIYATANI / Phase One, Inc <siu@phaseone.co.jp>
Basic support for the Shift JIS encoding of japanese.
(and one tiny typo fixed in a comment)
1997-09-24 20:38:12 +00:00
Andrey A. Chernov 65fce1274e This commit was generated by cvs2svn to compensate for changes in r29747,
which included commits to RCS files with non-trunk default branches.
1997-09-23 21:34:42 +00:00
Andrey A. Chernov e97dbe1e30 Official patch from infozip 1997-09-23 21:34:42 +00:00
Peter Wemm 42396e05cf Apply fts() fix from PR#4593
Submitted by:  Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>
1997-09-22 12:48:40 +00:00
Bill Paul 0e710e8f95 Make selection logic more strict. Only select AF_INET loopback interfaces
that are up on second (loopback only) pass, and only select non-loopback
AF_INET interfaces that are up on first pass.
1997-09-21 23:04:51 +00:00
Poul-Henning Kamp d030d2d2ae Many places in the code NULL is used in integer context, where
plain 0 should be used.  This happens to work because we #define
NULL to 0, but is stylistically wrong and can cause problems
for people trying to port bits of code to other environments.

PR:		2752
Submitted by:	Arne Henrik Juul <arnej@imf.unit.no>
1997-09-18 14:08:40 +00:00
Philippe Charnier 34384756cd environmental -> environment. 1997-09-18 06:55:21 +00:00
Peter Wemm 9e06e6da51 Some adjustments for the resolver use of poll(). For some reason I thought
an unimplemented syscall returned ENOSYS, rather than EINVAL.  I have run
statically linked code with this wrapper and it does appear to work fine
on 2.2-stable which doesn't have poll().  ktrace shows the poll syscall fail
once and the fallback to select() working.
1997-09-16 06:03:54 +00:00
Peter Wemm b7ecb08afa Put a system call not present checking wrapper around the call to
__getcwd().  I've got this libc code running on one of my machines
at the moment without the __getcwd() syscall being present.
1997-09-16 06:00:50 +00:00
Wolfram Schneider 211fed7e35 Fix yet a minor stylistic nit from Bruce.
(`cvs diff -ib' print one new char ;-).
1997-09-15 19:37:23 +00:00
Poul-Henning Kamp 36dff60096 Fix yet a minor stylistic nit from Bruce (Doesn't he have more
important things to do ?? :-)

Prepare for the likely case of a change in kernel algorithm.
1997-09-15 17:40:15 +00:00
Poul-Henning Kamp 9c2d6fcf05 Fix a buglet and a couple of stylistic nits from Bruce. 1997-09-15 08:25:14 +00:00
Wolfram Schneider 8be26e5d0f Potential bufferflow in getpwent(), getpwnam() and getpwuid()
PR: bin/4134
Submitted by:	nick@foobar.org
1997-09-14 18:16:11 +00:00
Poul-Henning Kamp 27262cac33 Add __getcwd() syscall, and have getcwd() take a shot at it.
If your kernel doesn't support __getcwd() or if __getcwd() cannot
deliver because of cache expiry, it does the canonical thing.
1997-09-14 16:57:27 +00:00
Peter Wemm 535db1806c Call poll(2) from within the resolver but adapt to older kernels without it
if necessary.  This removes the need to malloc large fd_set's for selecting
on high fd's (larger than FD_SETSIZE at libc compile time).

The syscall adaptive stuff only happens on the very first call.  SIGSYS
is masked, and if the call to poll fails with ENOSYS, then we use select
for the life of the program.  If poll does not fail with ENOSYS, then we
always use poll and skip the once-off signal masking gunk.

This may be overkill, but it saved my neck a few times while working on
multiple different sets of kernel sources, some with poll, some without.
1997-09-14 09:44:34 +00:00
Peter Wemm 16115af153 A poll(2) manpage.
Obtained from: NetBSD
1997-09-14 05:44:35 +00:00
Peter Wemm b52c91dd7e Generate poll syscall stub 1997-09-14 03:29:55 +00:00
Joerg Wunsch dbf4898f6c Document SA_NOCLDWAIT.
Make all the SA_* flags go into a tagged list, to improve readability.
1997-09-13 19:43:24 +00:00
Bruce Evans 065bebee55 Removed superfluous quoting of function args. 1997-09-07 04:10:35 +00:00
Bruce Evans f12d1f0bf6 Fixed style bug in pseudocode. 1997-09-07 04:01:27 +00:00
Brian Somers 59354a4e8d Upgrade to 2.4 (Fix -PKT_ALIAS_UNREGISTERED_ONLY)
Submitted by:	Charles Mott <cmott@srv.net>

Add __libalias_version so that ppp can derive the
correct library name for dlopen()
1997-09-06 11:11:43 +00:00
Peter Wemm a9c87f32ee When compiling under elf, use correct library naming conventions. Also
add the required extra symlink.  Set the -soname to libcrypt.so so that
the symlink is used at runtime rather than resolved at compile time.
1997-09-05 12:12:35 +00:00
Peter Wemm 7bd6d5e7cf If building under elf, have libskey.so depend on libmd and libcrypt. 1997-09-05 11:52:20 +00:00
Peter Wemm 1840bd1444 If not building a.out, still build a pic version of libmd. This allows
things like libskey.so to be dynamically self contained.

Things like md5(1) where speed is critical should still link with libmd.a,
but for things like login, where it's a once-off call if skey is used, it's
not worth the hassle.
1997-09-05 11:49:43 +00:00
Paul Traina 326df44ead The parameters to logwtmp should be const char's 1997-09-04 22:38:59 +00:00
Bruce Evans 853aa1faf3 Fixed synopsis. The envp arg for execle() can't be given in the prototype.
Fortunately, the man page doesn't refer to "envp" so just deleting it is OK.
1997-09-03 03:25:35 +00:00
Andrey A. Chernov 738111e63b Fix possible coredump on BW displays 1997-09-02 19:07:50 +00:00
Brian Somers a367bd9e25 Add "options no_tld_query" to resolv.conf.
Mention the capability in resolver(5).
Mention that RES_OPTIONS can be used in resolver(5).
Discussed with: -hackers
1997-09-01 01:19:23 +00:00
Bruce Evans 6a9280be8c Hide the declaration of `struct exception' from C++, since it conflicts
with the standard C++ `class exception'.  This makes matherr() difficult
to use in C++.  Small loss.
1997-08-31 22:12:19 +00:00
Bruce Evans 4447a79bf7 Fixed inclomplete function type in synopsis. 1997-08-31 21:54:10 +00:00
Brian Somers ad1d4e56a2 Remove login_progok()
Suggested by: guido
1997-08-31 20:09:39 +00:00
Andrey A. Chernov 0d589df709 Restore back issetugid() usage and bump major number 1997-08-31 08:37:28 +00:00
Poul-Henning Kamp 188891873e Another 32bits of 64bits conformance.
Reviewed by:	phk
Submitted by:	jdp
1997-08-31 05:59:39 +00:00
Peter Wemm 77909f5978 Initial elf nlist support, mostly stolen from OpenBSD (they use standard
#defines that are compatable with ours).  I made some some minor tweaks
to the leading '_' tests.

Again, this is off by default for the moment.  This probably should be
split into seperate files (like some of our other libc files that could
do with some splitting).

Obtained from: OpenBSD (plus some minor tweaks)
1997-08-31 00:08:35 +00:00
KATO Takenori 01f770e87c Added HW_MACHINE_ARCH. 1997-08-30 02:26:36 +00:00
Warner Losh 9a91f1cc25 Merge in the safe chdir changes from Todd Miller's mods to the OpenBSD
tree.  Also merge in fix to NetBSD PR #1495.  These represent 1.3-1.9 in
the OpenBSD tree.  Make minor KNF changes to new code (which is in the
OpenBSD as 1.10).  This avoids the symlink race problems.

These patches should go into 2.2.5 before the ship if they don't
break anything in -current.
Reviewed by:	Bruce Evans
Obtained from:	OpenBSD
1997-08-29 22:56:41 +00:00
John Polstra 9295bb8d0d Add a stub version of getpublickey(), in order to eliminate an
undefined symbol referenced from libc.  Without the stub, it is
impossible to execute any program using the shared library if
LD_BIND_NOW=1 is in the environment.  The stub always returns
failure, but it can be overridden outside the library when necessary.

I don't know whether this is the "correct" fix, but it is intolerable
to have any undefined symbols referenced from libc.
1997-08-28 21:50:33 +00:00
Andrey A. Chernov ef5ccd9e3c Fix inspace handling I broke in rev 1.13 1997-08-28 08:13:21 +00:00
Brian Somers fbbe016b64 Add full support for determining if a user
is restricted from running a given program.
1997-08-27 20:06:20 +00:00
Andrey A. Chernov eb8eee5a55 Use getpwnam(getlogin()) before getpwuid(getuid()) 1997-08-27 13:36:34 +00:00
Poul-Henning Kamp 263f4be35c Improvement of type independency for the bitmap.
This makes 64bit operation more likely.

Reviewed by:	phk
Submitted by:	jdp
1997-08-27 12:04:33 +00:00
Poul-Henning Kamp cd15afa3e8 Malloc option H is now default. 1997-08-27 06:40:34 +00:00
Warner Losh 3fa69daee8 Don't getenv(HOME) when set[ug]od. This can lead to a buffer overflow and
elevated privs.
Obtained from: OpenBSD
1997-08-27 05:27:53 +00:00
Brian Somers 889d7d1524 Add prog.deny as a list capability for
denying execution of certain programs.
1997-08-26 23:15:57 +00:00
Bruce Evans 30a72f72d5 -I${DESTDIR}/sys -> -I${.CURDIR}/../../sys. 1997-08-26 14:13:02 +00:00
Andrey A. Chernov a139916b88 Temp restore of rev 1.9 1997-08-26 12:47:09 +00:00
Andrey A. Chernov a05c4d30fd Temporarily comment out issetugid() call until everyone installs libtermcap,
major number bumping will follows then
1997-08-25 16:42:22 +00:00
Andrey A. Chernov 0e7e6efe8f Fix saving/restoring tty modes, allow initscr be called twice,
from ncurses 4.1
1997-08-25 07:41:15 +00:00
Joerg Wunsch f778764443 Make the MD* header files C++-aware. Also, string arguments are supposed
to be of type `const char *'.

PR:		3291
Submitted by:	dima@tejblum.dnttm.rssi.ru (Dmitrij Tejblum)
1997-08-25 05:24:31 +00:00
Andrey A. Chernov 32a7305976 Bump minor number due to issetugid() 1997-08-24 19:19:08 +00:00
Andrey A. Chernov cefcce61a0 Add winnstr family and fake resizeterm from ncurses 4.1 for compatibility
with recent applications.
Bump minor number.
1997-08-24 19:09:45 +00:00
Joerg Wunsch 1818482d81 Cosmetic: distinguish in diag message between rebuilding and updating
the database.

PR:		3397
Submitted by:	taob@risc.org (Brian Tao)
1997-08-24 18:23:21 +00:00
Steve Price a89989b26f Get rid of integer overflow warning.
PR:		misc/3575
Submitted by:	Bruce Evans <bde@zeta.org.au>
1997-08-23 23:51:12 +00:00
Steve Price 18de8a52e4 Remove extra definition of vwprintw.
PR:		bin/3623
Submitted by:	Stephen J. Roznowski <sjr1@flash.net>
1997-08-23 23:23:07 +00:00
Steve Price da0a2ddec5 Reference the correct version of BSD at the bottom of the
manpage.

PR:		docs/3735
1997-08-23 21:32:50 +00:00
Søren Schmidt 805af8409d Activate libvgl 1997-08-22 13:20:03 +00:00
Andrey A. Chernov 7b759a7f68 Replace uids comparison by issetugid() call 1997-08-22 11:14:53 +00:00
Bruce Evans 1ae93414c3 Fixed off by 1 error. 1997-08-21 19:44:41 +00:00
Bruce Evans 8f45662223 Split beforeinstall target so that headers can be installed without
installing data files.
1997-08-21 16:14:34 +00:00
Peter Wemm 04b8783cda Manpage for getsid(2). 1997-08-19 07:19:43 +00:00
Peter Wemm 4ff76833b4 Forgot to mention what getpgid(0) does. 1997-08-19 07:04:43 +00:00
Peter Wemm ff31b5e404 Manpage for getpgid(2), wording taken from NetBSD. 1997-08-19 07:00:53 +00:00