Commit Graph

170 Commits

Author SHA1 Message Date
Nate Williams
1e37fc9d59 Changed the terminology for what used to be called the "memorizing"
vector.  Now it is called the "symbol caching" vector.  This was made
possible and unconfusing by other changes that allowed me to localize
everything having to do with the caching vector in the function
reloc_map().

Switched to alloca() for allocating the caching vector, and eliminated
the special mmap-based allocation routines.  Although this was motivated
by performance reasons, it led to significant simplification of the
code, and made it possible to confine the symbol caching code to the
single function reloc_map().

Got rid of the unnecessary and inefficient division loop at the
beginning of rtld().

Reduced the number of calls to getenv("LD_LIBRARY_PATH") to just 1, on
suggestion from <davidg@root.com>.

Added breaks out of the relocation loops when the relocation address is
found to be 0.  A relocation address of 0 is caused by an unused
relocation entry.  Unused relocation entries are caused by linking a
shared object with the "-Bsymbolic" switch.  The runtime linker itself
is linked that way, and the last 40% of its relocation entries are
unused.  Thus, breaking out of the loop on the first such entry is a
performance win when ld.so relocates itself.  As a side benefit, it
permits removing a test from md_relocate_simple() in
../i386/md-static-funcs.c.

Unused relocation entries in other shared objects (linked with
"-Bsymbolic") caused even bigger problems in previous versions of the
runtime linker. The runtime linker interpreted the unused entries as if
they were valid. That caused it to perform repeated relocations of the
first byte of the shared object.  In order to do that, it had to remap
the text segment writable.  Breaking out of the loop on the first unused
relocation entry solves that.

Submitted by:	John Polstra <jdp@polstra.com>
1995-11-02 18:48:15 +00:00
Andrey A. Chernov
e2326c6ef6 Revert fsync ifdef behaviour and name, now default variant acts like
original one.
Suggested by: peter
1995-10-31 09:16:46 +00:00
Andrey A. Chernov
e3807a3f8f Put fsync under #ifdef EXTRA_SANITY and turn it off by default.
fsync here cause real disk trashing when large UUCP mail chanks
parsed.
1995-10-31 08:22:13 +00:00
Bill Paul
0b8ab5c8e1 Add revnetgroup. 1995-10-26 16:28:33 +00:00
Bill Paul
a44e4d1407 Import the first cut of my (finally finished) revnetgroup program. This
program parses the /etc/netgroup file into netgroup.byuser and netgroup.byhost
format for NIS.

I used hash tables to store the initial netgroup data in memory and to
construct the 'reverse' netgroup output. It seems just as fast as the
SunOS revnetgroup, which is surprising considering this is my first
attempt at using hash tables in a real application. :)

Note that I canibalized a large chunk of getnetgrent.c to save myself
from having to write my own netgroup parsing functions.
1995-10-26 16:25:29 +00:00
Nate Williams
468f82b316 Run-time linker speedups - Round One
Implemented symbol memorizing to reduce the number of calls to lookup(),
making relocation go faster.  While relocating a given shared object,
the dynamic linker maintains a memorizing vector that is directly
indexed by the symbol number in the relocation entry.  The first time a
given symbol is looked up, the memorizing vector is filled in with a
pointer to the symbol table entry, and a pointer to the so_map of the
shared object in which the symbol was defined.  On subsequent uses of
the same symbol, that information is retrieved directly from the
memorizing vector, without calling lookup() again.

A symbol that is referenced in a relocation entry is typically
referenced in many relocation entries, so this memorizing reduces the
number of calls to lookup() dramatically.  The overall improvement in
the speed of dynamic linking is also dramatic -- as much as a factor of
three for programs that use many shared libaries.

Submitted by:	jdp@polstra.com "John Polstra"
1995-10-25 16:16:35 +00:00
Andrey A. Chernov
d7582593f6 Remove LD_NOSTD_PATH unsetenv, isn't exist anymore 1995-10-24 06:50:45 +00:00
Andrey A. Chernov
a4057ed8d3 Remove LD_NOSTD_PATH implementation, it isn't works and
can cause some problems.
Suggested-by: davidg
1995-10-24 06:48:16 +00:00
Andrey A. Chernov
b2105a0990 if uid != euid or gid != egid unsetenv("LD_NOSTD_PATH") too 1995-10-21 14:52:48 +00:00
Andrey A. Chernov
d549e5cc7f Fix original patch error with ! before strncmp
Zap only needed LD_* variables
1995-10-20 22:17:35 +00:00
Andrey A. Chernov
68942f23dd Don't allow LD_* env. variables to be tricked
Submitted by: Sam Hartman <hartmans@mit.edu>
1995-10-20 17:26:40 +00:00
David Greenman
dfd651579c Added a -D option to set the TCP_NODELAY socket option. This improves
responsiveness at the expense of some additional network traffic.
1995-10-15 03:40:57 +00:00
Justin T. Gibbs
f4390542d7 Kerberos can now deal with multi-homed clients.
Kerberos obtains a network address for the local host from the routing
tables and uses it consistently for all Kerberos transactions.  This ensures
that packets only leave the *authenticated* interface.  Clients who open
and use their own sockets for encrypted or authenticated correspondance
to kerberos services should bind their sockets to the same address as that
used by kerberos.  krb_get_local_addr() and krb_bind_local_addr() allow
clients to obtain the local address or bind a socket to the local address
used by Kerberos respectively.

Reviewed by: Mark Murray <markm>, Garrett Wollman <wollman>
Obtained from: concept by Dieter Dworkin Muller <dworkin@village.org>
1995-10-05 21:30:21 +00:00
Nate Williams
c68c38c86b This is a FreeBSD manpage, not a NetBSD manpage. :) 1995-10-05 05:16:52 +00:00
Andrey A. Chernov
12e35e512e Build secure telnetd if available and allowed 1995-09-29 19:47:51 +00:00
Bruce Evans
9987ab26d8 Fix SRCS (.c's were .o's) so that `make depend' works. 1995-09-28 17:33:16 +00:00
Nate Williams
6f5457454c Make the error message more readable when 'ld.so' cannot locate a needed
shared library.  Formerly, the message looked like this:

    ld.so: run: libjdp1.so.1.0: Undefined error: 0

The new message looks like this:

    ld.so: run: Can't find shared library "libjdp1.so.1.0"

(Where "run" is the name of the program being executed.)

Submitted by:	jdp@polstra.com (John Polstra)
1995-09-27 23:17:33 +00:00
Nate Williams
e1ec3d8b3c Fixup the "ld.so failed" message for the case when ld.so finds undefined
symbols.

An easy example to see this is to develop an X program which links
against Xt, but doesn't add -lX11 to the link line.  It will link fine,
but cause run-time errors by ld.so because of missing symbols used by Xt
defined in X11.  This patch makes the errors more readable.

Submitted by:   jdp@polstra.com (John Polstra)
1995-09-27 23:14:08 +00:00
David Greenman
430ff9b689 Fixed bug introduced with the change of startslave()...two arguments
were chopped off of the function call and garbage was passed instead.
The solution involves making some variable globals as well as fixing the
call to have all the arguments.
1995-09-11 20:54:49 +00:00
Paul Traina
b74fc1026f Move erase cleanup outside linemode conditional 1995-09-06 02:03:36 +00:00
Paul Traina
e22b1cd1ca Properly set the erase character for the login prompt.
Submitted by:	John Capo <jc@irbs.com> & Peter Wemm
1995-09-05 17:38:31 +00:00
Paul Traina
575ecb340a Delay starting login process until option negotiation is complete to
avoid race condition on connections with larger round-trip-times.

Submitted by:	John Capo & Peter Wemm
1995-09-05 17:34:29 +00:00
Andrey A. Chernov
bb22b34ecd Fix ${.CURDIR} misspelling 1995-08-29 13:42:52 +00:00
Mike Pritchard
ae532ecb79 Check for expired passwords before allowing access to the system. 1995-08-28 21:30:59 +00:00
Joerg Wunsch
19d57e6d9d Import Paul Kranenburg's man page for ld.so (aka. rtld).
Obtained from:	NetBSD
1995-08-26 13:17:39 +00:00
Andrey A. Chernov
ddcf802236 Upgrade to 2.9 1995-08-21 12:34:18 +00:00
Bruce Evans
48cfb668fc Change install' to ${INSTALL}' so that default install flags can be
specified in the top level Makefiles.

Previously I missed dozens of Makefiles that skip the install after
using `cmp -s' to decide that the install isn't necessary.
1995-08-06 12:24:38 +00:00
Mark Murray
558914c47f Only build telnetd if secure telnetd is not going to be built.
Reviewed by:	rgrimes
1995-08-06 11:20:35 +00:00
Paul Traina
4c450ad7a7 Use data ports in the range 40000..44999 by default to enhance FTP usability
in a firewall environment.  Original idea by Mark Tracy (?).

Reviewed by:	wollman
Submitted by:	pst
1995-08-05 19:12:05 +00:00
Andreas Schulz
c4dfd14ae0 Fix some typos in a comment BUAD -> BAUD. 1995-08-05 18:16:50 +00:00
Jordan K. Hubbard
6186bd5dc7 Back this change out. It's just not worth arguing over and any further emails
I get on this topic will go straight to /dev/null.  This is absolutely the
last word on this topic you'll see from me.  Too much time has already been
wasted.
1995-08-03 05:44:46 +00:00
Paul Richards
7ce7bdd607 Change default banner fro 4.4 BSD to FreeBSD.
Reviewed by:
Submitted by:
Obtained from:
1995-08-02 12:07:31 +00:00
Andrey A. Chernov
955db62afa Use the same DECODE_BAUD trick like in new telnetd to obtain
termios speed.
Obtained from: Pre-Lite2 telnet
1995-08-02 11:20:05 +00:00
Jordan K. Hubbard
4d7ccc95b4 A useful aid.. Add support for:
%r:	current release
	%m:	machine architecture type (i386 for now)
	%s:	OS name (FreeBSD)

from uname() in banner string.
1995-08-01 13:12:24 +00:00
Peter Wemm
3f59b9c4ef rexecd was not calling "setlogin()" when it should have. This was causing
getlogin() to return wrong answers (eg: "root").
Reviewed by:	davidg
Obtained from:	James Jegers, for NetBSD, slightly reworked by me.
1995-07-29 15:21:15 +00:00
Bill Paul
017eb962e0 Uncomment 'CFLAGS+=ETC_ETHERS' -- we have support for this as of 2.0.5. 1995-07-25 23:38:40 +00:00
Andrey A. Chernov
9aa70e27a7 Change hardcoded 15 (which means 38400) to B115200 which is 17 1995-07-23 02:30:44 +00:00
Doug Rabson
82aaeb09ad Change ld.so to correctly load dependant libraries for dlopen and unload them
on dlclose.  Also correctly call constructors and destructors for libraries
linked with /usr/lib/c++rt0.o.
Change interpretation of dlopen manpage to call _init() rather than init()
for dlopened objects.
Change c++rt0.o to avoid using atexit to call destructors, allowing dlclose to
call destructors when an object is unloaded.
Change interface between crt0 and ld.so to allow crt0 to call a function on
exit to call destructors for shared libraries explicitly.

These changes are backwards compatible.  Old binaries will work with the new
ld.so and new binaries will work with the old ld.so.  A version number has
been introduced in the crt0-ld.so interface to allow for future changes.

Reviewed by:	GAWollman, Craig Struble <cstruble@singularity.bevc.blacksburg.va.us>
1995-06-27 09:53:27 +00:00
David Greenman
ecf74fe675 The final negotiation of DO_BINARY in the LINEMODE portion of the telnetd code
causes some clients that do not support linemode to mis-interpret the return
key (i.e. double returns).
The fix is to only do the state check for binary options if linemode will
be used.
Closes PR#505.

Submitted by:	Charles Henrich
1995-06-17 05:50:47 +00:00
Rodney W. Grimes
6c06b4e2aa Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
Rodney W. Grimes
4399be3cbd Remove trailing whitespace. 1995-05-30 05:05:38 +00:00
David Greenman
956455631c Make last change a little more robust by checking for failure of getcwd(). 1995-05-22 11:03:55 +00:00
David Greenman
82c76939c1 Set "HOME" so that tilde expands correctly. It previously was always root's
directory /root.
1995-05-22 09:53:02 +00:00
Garrett Wollman
9fc5823a7a Speed up ftpd and make it more efficient:
- set TCP_NOPUSH to keep from sending short packets at each write(2) boundary
- set SO_SNDBUF to 64k so we have a reasonable amount of buffer space
- for a regular file in binary mode which is not being restarted and is
. smaller than 16 Meg, use mmap(2) and write(2) the whole file in one big
  gulp

In the most common circumstances, this should dramatically reduce the
system-call load from ftpd, since the call to write() will not return until
the entire file has been written, rather than writing just a few K at a time
in a loop.
1995-05-03 16:58:12 +00:00
Andrey A. Chernov
d3e6b9f393 Fix bug:
When hostname len > 8, name replaced with dot notation when -u flag
not specified (default case).
Use _PATH_* for utmp/wtmp.
1995-04-26 22:33:15 +00:00
Nate Williams
110aea11f2 Sync. up bits with Paul K. Cascade support plus some cosmetic changes.
Obtained from: NetBSD
1995-04-21 04:57:50 +00:00
Jordan K. Hubbard
bcca63cba4 Extensive updates to this package.
Submitted by:	Gene Stark <gene@starkhome.cs.sunysb.edu>
1995-04-18 01:54:25 +00:00
Gary Palmer
7253b58b7b Fix two more references to /etc/motd that I overlooked. PR #29 1995-04-15 07:05:07 +00:00
Gary Palmer
025362a70b Close PR #29. The file should be /etc/ftpmotd, not /etc/motd. 1995-04-15 07:02:22 +00:00
Andrey A. Chernov
4f7ac4bd57 Add some useful sendmail options 1995-04-12 19:21:43 +00:00