Commit Graph

593 Commits

Author SHA1 Message Date
John Polstra
a18cde535d The ELF specification says that the RPATH in the executable or
shared object takes precedence over LD_LIBRARY_PATH.  Make the
dynamic linker do it that way.
1999-04-09 06:42:00 +00:00
John Polstra
d5b537d01a Eliminate all machine-dependent code from the main source body and
the Makefile, and move it down into the architecture-specific
subdirectories.

Eliminate an asm() statement for the i386.

Make the dynamic linker work if it is built as an executable instead
of as a shared library.  See i386/Makefile.inc to find out how to
do it.  Note, this change is not enabled and it might never be
enabled.  But it might be useful in the future.  Building the
dynamic linker as an executable should make it start up faster,
because it won't have any relocations.  But in practice I suspect
the difference is negligible.
1999-04-09 00:28:43 +00:00
Brian Somers
d5cf830ef1 Determine the host name using an array size of
MAXHOSTNAMELEN and call trimdomain() before implementing
the -u option.

This allows local hosts of a lan with a long domain name to
appear properly in utmp by base host name (w/o domain) rather
than by IP number.
1999-04-08 21:36:27 +00:00
Brian Somers
aae211bc7e Really fix -u.... 1999-04-07 08:39:54 +00:00
Brian Somers
9e9a43bdec Ensure that things returned by gethostname() and
friends are terminated and allow for a maximum
host name length of MAXHOSTNAMELEN - 1.
Put parenthesis around sizeof args.
Make some variables static.
Fix telnetd -u (broken by my last commit)

Prompted by: bde
1999-04-07 08:27:45 +00:00
Brian Somers
d9dc7d5c7e Fix the size of rhost, don't forget to NUL terminate
it and use brackets for sizeof.
Requested by: bde
1999-04-07 06:00:22 +00:00
John Polstra
a16ed197f2 Fix a couple of typos in comments. 1999-04-07 02:48:43 +00:00
John Polstra
14f5fa0596 Add a new function dlversion() which returns the version number of
the dynamic linker in the same form as __FreeBSD_version.  This is
mainly intended for checking the dynamic linker version during a make
world.
1999-04-07 02:43:11 +00:00
Brian Somers
143b4dcdc7 Link with libutil 1999-04-06 23:40:25 +00:00
Brian Somers
32af26a501 Use realhostname() rather than various combinations of
gethostbyaddr() & gethostbyname().

Remove brokeness in ftpd for hosts of MAXHOSTNAMELEN length.
1999-04-06 23:06:00 +00:00
Brian Somers
51d8a6713f After receiving a connection and doing a reverse
lookup on the incoming IP, do a forward lookup on
the result and make sure that the IP is in the
resulting list.  If it's not, put the IP number
in utmp/wtmp instead of the rogue name.

Stolen from: rlogind
Suggested by: sef
1999-04-06 00:29:41 +00:00
John Polstra
5e4636f2b0 Resolve undefined weak references to a value of 0. This solves the
"__deregister_frame_info" problem that was seen when combining a
program linked using the old gcc with shared libraries that were
built using egcs.
1999-04-05 02:36:40 +00:00
Peter Wemm
faba5e7488 If somebody does an execv("foo", NULL) (which theoretically is an error),
avoid crashing inside rtld (since it's easy) since everything else handles
it.  Of course, if the target program checks argv[], it'll fall over.

Reviewed by:	jdp
1999-04-04 06:01:09 +00:00
Peter Wemm
610b0299af Add an 'al' (autologin username) capability to getty/gettytab. This is a
damn useful thing for using with serial consoles in clusters etc or secure
console locations.  Using a custom gettytab entry for console with
an entry like 'al=root' means that there is *always* a root login ready on
the console.  This should replace hacks like those which go with conserver
etc.  (This is a loaded gun, watch out for those feet!)

Submitted by:  "Andrew J. Korty" <ajk@purdue.edu>
1999-04-04 04:36:50 +00:00
Joerg Wunsch
53152fc9db Ignore empty usernames, and repeat the login: prompt in this case.
There's not much point in having uucpd behave differently than
login(1) for this, and now uucpd is compatible to the default chat
script of Taylor UUCP which sends a single \r at first.

While i was at it, added a few strategic ``errno = 0;''s, so at least
an `Undefined error 0' will be returned for things like a closed
connection while reading the login ID or password, as opposed to an
even more bogus thing like `No such file or directory'.
1999-03-30 10:23:35 +00:00
Nate Williams
38ccb4c214 - Commit the correct dladdr() implementation.
Reviewed by:	jdp@FreeBSD.org <This is the version he reviewed!>
1999-03-24 23:47:29 +00:00
Nate Williams
e818e307ee - Added dladdr(3) support.
Reviewed by:	jdp@FreeBSD.org
1999-03-24 23:37:35 +00:00
Brian Somers
23bc058463 Set the CPU resource limit back to infinity before exec()ing PP.
PR:	10399
1999-03-09 22:04:44 +00:00
Bill Fenner
13ca3c01ec Clean up some .Os macro uses: quotes are not needed, multiple arguments
don't really work if the first one isn't "FreeBSD", and "FreeBSD-Experimental"
isn't an OS name.
1999-02-15 08:34:14 +00:00
Nate Williams
0b8dcbe23c - Set the system immutable flag when installing ld.so to avoid people
accidentally clobbering it.

Submitted by:	numberous people on -current
1999-02-15 05:02:54 +00:00
Satoshi Asami
0e510aed5b Oops, I missed a few more /etc/nologin references yesterday. It appears
my check of the tree was incomplete.  Sorry guys.

Reported by:	Ben Smithurst <ben@scientia.demon.co.uk>
1999-01-12 14:09:23 +00:00
Peter Wemm
5328c7eb7e As previously threatened, clean up the rshd -a option and make it default
on rshd and rlogind.  However, note that:
1: rshd used to drop a connection with -a if the hostname != ip address.
   This is unneeded, because iruserok() does it's own checking.
   It was also wrong if .rhosts had an explicit IP address in it,
   connections would be dropped from that host solely because the DNS was
   mismatched even though it was explicitly intended to work by IP address.
2: rlogind and rshd check the hostname mappings by default now because that
   is what goes into the utmp/wtmp and logs.  If the hostname != ip address,
   then it uses the IP address for logging/utmp/wtmp purposes.  There isn't
   much point logging ficticious hostnames.
3: rshd -a is now accepted (but ignored) for compatability.  If you really
   want to make life miserable for people with bad reverse DNS, use tcpd in
   paranoid mode (which is questionable anyway, given DNS ttl tweaking).
1998-12-16 07:20:45 +00:00
Peter Wemm
3cc1b1bf9c Old stuff laying around: Don't use a function called getstr(), that has
nasty consequences when the system curses is ncurses as this conflicts
with a ncurses funciton and causes recursion.
1998-12-16 06:04:29 +00:00
Eivind Eklund
d284feaa7b Block for buffer overflow. 1998-12-13 21:02:28 +00:00
Matthew Dillon
3a3c0cf418 PR: bin/9031
Changed unbounded strcpy() to snprintf() to fix buffer overrun exploit
1998-12-12 20:56:53 +00:00
Bruce Evans
97aa1043ac Fixed long line in previous commit. 1998-12-03 05:45:18 +00:00
Bill Fumerola
c711c51d19 Update to correctly reflect the default values of
net.inet.ip.portrange.hifirst and net.inet.ip.portrange.hilast

PR:		docs/6745
Submitted by:	Masachika Ishizuka <ishizuka@ish.org>
1998-12-02 22:11:02 +00:00
David Greenman
45166d95d1 Added a -D option to turn on TCP_NODELAY. 1998-12-01 23:27:24 +00:00
Matthew Dillon
386794da12 Reviewed by: freebsd-current, freebsd-security
Removed getuid() root check so ntalkd can be run from a tty sandbox.
    It isn't suid root anyway, who knows why the getuid() check was even
    in there in the first place!
1998-12-01 21:12:57 +00:00
Doug Rabson
eace1a8ad9 Use the runpath of the main program for locating libraries loaded by
dlopen().

Reviewed by: jdp
1998-11-27 21:19:52 +00:00
John Polstra
4700eb95cb Find "klogin.c" in "src/lib/libpam/modules/pam_kerberosIV" instead
of in "src/usr.bin/login".  The latter instance is going away.  As
soon as ftpd is PAMized, it won't need to use klogin.c at all.
1998-11-21 02:11:16 +00:00
Dima Ruban
d3f476b1f0 Enable named-xfer and rbootd for alpha. 1998-11-10 06:50:35 +00:00
John Polstra
3f47c82a7f Fix a bug in the handling of minor version numbers. Formerly, the
rtld would accept the first shared library it found with the right
major version number, even if the minor version number was too low.
If a different version of the shared library with an adequate minor
version number appeared later in the search path, it would not be
found.

Now the rtld searches all locations first looking for a library
with a minor version that is high enough.  Only if such a library
is not found will it fall back to accepting a minor version number
that is too low.  As before, a warning comes out in that case.

This solves some problems encountered when building an older world
on a -current system.
1998-11-07 01:59:39 +00:00
David Greenman
8692ad469b Rename a function name so that it doesn't conflict with a future system call. 1998-10-30 16:17:50 +00:00
Dag-Erling Smørgrav
e6fa0d4308 Set the user context correctly so that cd ~ does the right thing.
PR:		bin/7943 bin/8293
Submitted by:	Bill Fenner <fenner@parc.xerox.com>
Approved by:	jkh
1998-10-13 20:42:01 +00:00
John Polstra
1280c211e2 Fix a bug in dlclose that broke the apache13 port. The list of
loaded objects wasn't being maintained properly.
1998-10-13 03:31:59 +00:00
Jordan K. Hubbard
3a2d923136 This thing has its own puts function, so use it.
Submitted by:	Matthew Jacob <mjacob@nas.nasa.gov>
1998-10-08 23:14:02 +00:00
Kenneth D. Merry
b994e5358d Fix a memory leak in rpc.rstatd that shows up when it's run in standalone
mode.  (i.e., not from inetd)

PR:		bin/8212
1998-10-08 19:59:40 +00:00
Alexander Langer
29a199dbc5 Added double quotes around CHMOD description to prevent garbled output.
PR:		8094
Submitted by:	Christoph Weber-Fahr <wefa@callcenter.systemhaus.net>
1998-09-29 22:02:06 +00:00
John Polstra
b19042b569 Make LD_PRELOAD work for ELF. 1998-09-22 02:09:56 +00:00
David E. O'Brien
be0cde6f10 Remove useless `BINOWN=root' now that it is the default. 1998-09-19 22:42:06 +00:00
Doug Rabson
8223b746c9 Work around an alpha compiler bug.
Reviewed by: Kenneth D. Merry <ken@plutotech.com>
1998-09-16 21:33:14 +00:00
John Polstra
29218d94d3 Fix a bug that showed up when debugging dynamically linked programs.
References from GDB to "printf" and various other functions would
find the versions in the dynamic linker itself, rather than the
versions in the program's libc.  This fix moves the GDB link map
entry for the dynamic linker to the end of the search list, where
its symbols will be found only if they are not found anywhere else.
It was suggested by Doug Rabson, though I implemented it a little
differently.

I personally would prefer to leave the dynamic linker's entry out
of the GDB search list altogether.  But Doug argues that it is
handy there for such things as setting breakpoints on dlopen().
So it stays for now, at least.

Note, if we ever integrate the dynamic linker with libc (which has
several important benefits to recommend it), this whole problem
goes away.
1998-09-16 02:54:08 +00:00
John Polstra
4e25d42aee Make the pathname pointed to by the Obj_Entry structure for the
dynamic linker itself dynamically allocated.  All of them are
supposed to be dynamically allocated, but we cheated before.  It
made gdb unhappy under some circumstances.
1998-09-15 21:07:52 +00:00
Justin T. Gibbs
b2dfb1f906 Update system to new device statistics code.
Submitted by:	"Kenneth D. Merry" <ken@plutotech.com>
		mike@smith.net.au (Mike Smith)
1998-09-15 08:15:30 +00:00
Doug Rabson
75fd258d75 Update to the binutils-2.9.1 PLT format. 1998-09-11 18:31:55 +00:00
Doug Rabson
732b5469fe Add the r_addend of the relocation when processing GLOB_DAT relocations. 1998-09-11 18:30:55 +00:00
Doug Rabson
5e618ef5c8 Fix a cut&paste error which prevented LD_BIND_NOW from working. 1998-09-08 09:47:35 +00:00
John Polstra
a3bd401942 Don't recognize a file as an a.out shared library unless it has at
least 2 version numbers.  This fixes the bug where the dynamic
linker would try to load an ELF shared library if it found one.

Note, this change also fixes the same thing in "ld", because the
code is shared.

For "ld" there is still a problem with ".a" libraries, which cannot
be distinguished by name.  I haven't decided what, if anything, to
do about that.
1998-09-05 20:28:48 +00:00
John Birrell
c2c37821c4 Chaneg MACHINE to MACHINE_ARCH to support MACHINE=pc98.
Remove a couple of unsupported machines.
1998-09-05 08:33:10 +00:00