Commit Graph

1205 Commits

Author SHA1 Message Date
Mark Murray
d0392caa7b Enable (optional) static linking.
Asked for by:	BDE
2001-04-28 07:56:49 +00:00
Mark Murray
618b0bba1f Change names of functions and variables with global scope that are
in conflict with library values of the same name. This allows static
linking.
2001-04-28 07:55:19 +00:00
Mark Murray
f9ebf4c2b5 Allow static linking.
Asked for by:	BDE
2001-04-28 07:44:37 +00:00
Mark Murray
8490ea92d6 Clean up the error handling code a bit. There is no need to "roll our
own" error() routine when errx() is available. This resolves a conflict
when linking statically.
2001-04-28 07:43:01 +00:00
Kris Kennaway
6e76e16fe6 Replace a strcat() with a strlcat(). Partial sync with OpenBSD; more
work is needed.

Submitted by:	"Andrew R. Reiter" <arr@watson.org>
Obtained from:	OpenBSD
2001-04-24 10:33:46 +00:00
Ruslan Ermilov
eb0838029f mdoc(7) police: normalize .Nd. 2001-04-18 15:54:10 +00:00
Ruslan Ermilov
5f95f24bf4 mdoc(7) police: uppercase document title. 2001-04-18 08:25:26 +00:00
Peter Wemm
70825609cf Previous clobbered a work-in-progress. Here is the merged result:
Limit the "pathname" glob to one item, as that is what all users of it
are expecting, except for LIST.

Always glob, instead of when the first character is a ~.  For example,
if you had directories ~/x1, and ~/x2, then "cwd x[1]" would fail, but
"cwd ~/x[1]" would work since it was globbed due to the ~ character.
Also, "cwd ~/x[12]" used to arbitarily work as it used the first
expansion (ie: x1) without an error.  Make it return '550 ambiguous'
instead of '550 not found' so that the user can see the difference.

For LIST, just use the user supplied string as the popen does the glob.

Problem noticed by:  Ajay Mittal <amittal@iprg.nokia.com>
2001-04-17 03:03:45 +00:00
Chris D. Faulhaber
6d3fe674ce Limit number of paths returned via glob() for authorized users
using tilde expansion.
2001-04-17 02:33:20 +00:00
Brian Feldman
7d6505e64e Support the empty "PASS\r\n" command. 2001-04-16 22:20:26 +00:00
Ruslan Ermilov
6a01974b78 Document that SITE extensions are disabled for anonymous logins.
Obtained from:	logdaemon package by Wietse Venema
2001-04-16 14:51:11 +00:00
Poul-Henning Kamp
53ba84a69e Add the "SITE MD5 filename" facility.
This allows you to determine if the file on the other side is the same
as the one you have without transferring the entire file to compare.

Needless to say, if the server end lies to you this check doesn't work,
but on the other hand, if it lies to you about the files checksum,
what can you trust from it ?
2001-04-15 20:59:29 +00:00
Ruslan Ermilov
b9ad8c8635 beforeinstall -> SCRIPTS. 2001-04-07 11:21:35 +00:00
Ruslan Ermilov
3e2b2e79c3 mdoc(7) police: cosmetics. 2001-04-04 10:33:13 +00:00
Ruslan Ermilov
4ecbb30346 Bye-bye /usr/lib/libtelnet.a. This should fix ``make release'' brokeness.
Approved by:	markm
2001-03-28 12:08:22 +00:00
Mark Murray
5bc9d93db3 Add full PAM support for account management and sessions.
The PAM_FAIL_CHECK and PAM_END macros in su.c came from the util-linux
package's PAM patches to the BSD login.c

Submitted by:	"David J. MacKenzie" <djm@web.us.uu.net>
2001-03-27 19:40:51 +00:00
Ruslan Ermilov
e5b5c66bca - Backout botched attempt to intoduce MANSECT feature.
- MAN[1-9] -> MAN.
2001-03-26 14:22:12 +00:00
Ruslan Ermilov
0dc44b5add Do not build (and install) both secure/ and standard versions
of libtelnet, telnetd, and telnet.  This only worked because
secure/ was listed late in SUBDIR in Makefile.inc1.

Reviewed by:	markm
2001-03-26 12:49:05 +00:00
Ruslan Ermilov
0414fc4dd0 Don't use MANDEPEND and MANSRC. 2001-03-26 07:28:26 +00:00
Alfred Perlstein
cc74aaddad change callrpc() from taking "char *" args, I'm quite sure they really meant
to use "void *".

remove a duplicate prototype for callrpc() from libexec/ypxfr/ypxfr_extern.h
2001-03-23 16:14:49 +00:00
Ruslan Ermilov
020ee2dc9f Set the default manual section for libexec/ to 8. 2001-03-20 18:10:13 +00:00
Jonathan Lemon
6d10cb2f6f Teach ftpd about the new GLOB_MAXPATH flag. 2001-03-19 19:11:00 +00:00
Dag-Erling Smørgrav
1f15c0d66c When the file was transferred using sendfile(2), we forgot to keep track
of the transferred byte count. MFC candidate.

PR:		bin/25699
2001-03-11 13:20:44 +00:00
Kris Kennaway
276c4a5d47 First appeared in 4.3, not 5.0 2001-03-04 09:15:55 +00:00
Dag-Erling Smørgrav
e22887cdda Change the read-only reply to "550 Permission denied.". 2001-02-19 21:51:26 +00:00
Jeroen Ruigrok van der Werven
7c63796828 Preceed/preceeding are not english words. Use precede or preceding. 2001-02-18 10:25:42 +00:00
Ruslan Ermilov
8654bd76ea mdoc(7) police: simplify construct. 2001-02-14 09:56:37 +00:00
Jeroen Ruigrok van der Werven
1debc9f69d Synch: Properly constify sccsid[].
Replace bcopy() with memmove().
2001-02-07 22:25:56 +00:00
Jeroen Ruigrok van der Werven
197640b1d7 Synch: Prefer memmove() over bcopy(). 2001-02-07 22:22:57 +00:00
Jeroen Ruigrok van der Werven
a4322ab2f6 Synch: Properly constify sccsid[]. 2001-02-07 22:20:44 +00:00
Jeroen Ruigrok van der Werven
6f76661f7f Synch: prefer memmove() over bcopy(), since the first is a C-standard
interface, whilst the latter is a BSD'ism.
2001-02-07 22:18:58 +00:00
Jeroen Ruigrok van der Werven
2fa72ea7d4 Fix typo: compatability -> compatibility.
Compatability is not an existing english word.
2001-02-06 12:05:58 +00:00
Jeroen Ruigrok van der Werven
9a01d32bfd Fix typo: seperate -> separate.
Seperate does not exist in the english language.

Submitted to look at by:	kris
2001-02-06 10:39:38 +00:00
Jeroen Ruigrok van der Werven
f09deb6962 Fix typo: wierd -> weird.
There is no such thing as wierd in the english language.
2001-02-06 09:25:10 +00:00
Jeroen Ruigrok van der Werven
67034ac6ad Fix tftpd and tftp to support file transfers of over 65535 blocks
(about 31 MB - 32 MB).

Submitted (partially)
	by: Pascal Hofstee <daeron@wit401305.student.utwente.nl>
2001-02-02 10:53:02 +00:00
Nik Clayton
e9f391478b Structure the options listing to be more standard.
The PR also included documentation for other options, but upon
inspection of the source these options aren't used.

PR:             docs/24149
Submitted by:   Jesse Monroy, Jr. <opentrax@email.com>
2001-02-02 03:29:09 +00:00
Ruslan Ermilov
d0353b836e mdoc(7) police: split punctuation characters + misc fixes. 2001-02-01 16:38:02 +00:00
Jeroen Ruigrok van der Werven
f043ac0627 Add static dependency to libisc to get isc_movefile().
Submitted by:	Munehiro Matsuda <haro@kubota.co.jp>
2001-01-29 07:56:34 +00:00
Bill Fumerola
1ed0e5d2e1 Add -c/C which chroots by IP of tftp client, (i.e. /tftproot/127.0.0.1/). 2001-01-25 04:20:25 +00:00
Chris D. Faulhaber
3fca54b652 Limit commands that can be issued when not logged in:
TYPE, STRU, MODE, ALLO, STAT, ABOR, SITE IDLE, SYST, REST

Reviewed by:	kris, sheldon
2001-01-20 01:34:22 +00:00
Chris D. Faulhaber
b27e228ca9 Check malloc() and strdup() return values
Reviewed by:	kris
2001-01-20 00:29:31 +00:00
Ruslan Ermilov
bd26f2dafc man(7) -> mdoc(7). 2001-01-16 13:12:21 +00:00
Ruslan Ermilov
896eb7d10c Prepare for mdoc(7)NG. 2001-01-16 09:15:57 +00:00
Doug Barton
10fe5181ec Move the process of storing entropy from /dev/random and reseeding with
it at boot time closer to the way we want it to be in the final version.

* Move the default directory to /var/db/entropy
* Run the entropy saving cron job every 11 minutes. This seems
  to be a better default, although still bikeshed material.
* Feed /dev/random some cheesy "entropy" from various commands
  and files before the disks are mounted. This gives /dev/random
  a better chance of running without blocking early.
* Move the reseeding with previously stored entropy to the point
  immediately after the disks are mounted.
* Make the harvesting script a little safer in regards to the
  possibility of accidentally overwriting something other
  than a regular file.
2001-01-14 07:18:31 +00:00
Doug Barton
27a803d631 Add a system to save entropy from /dev/random periodically so that
it can be used to reseed at boot time. This will greatly increase
the chances that there will be sufficient entropy available at
boot time to prevent long delays.

For /etc/rc, remove the vmstat and iostat runs from the attempt
to provide some cheesy randomness if the files fail, since
those programs are dynamically linked, and ldd seems to want
some randomness to do its magic.

Guidance and parameters for this project were provided by
Mark Murray, based on the requirements of the Yarrow
algorithm. Some helpful suggestions for implementation
(including the tip about iostat and vmstat) were provided
by Sheldon Hearn. All blame for problems or mistakes is
mine of course.
2001-01-11 13:01:20 +00:00
John Polstra
27e2c03506 Fix a bug in which a program called dlclose from a destructor and
got an assert failure in the dynamic linker.
2001-01-05 04:36:17 +00:00
Ruslan Ermilov
0f069ea22c Prepare for mdoc(7)NG. 2000-12-27 14:15:06 +00:00
Ruslan Ermilov
58eaff2332 Prepare for mdoc(7)NG. 2000-12-20 13:26:01 +00:00
Dan Moschuk
f6f0c4b90d In send_data(), use sendfile() instead of the mmap() algorithm. 2000-12-20 03:34:54 +00:00
Ruslan Ermilov
19a05e112f mdoc(7) police: removed hard sentence breaks, run through spell-checker. 2000-12-18 08:33:25 +00:00
Dmitry Sivachenko
3276496d94 Fix typo.
PR:		23591
Submitted by:	mavetju@chello.nl
2000-12-17 17:45:22 +00:00
Poul-Henning Kamp
a4b77a2aaa Add option -E to disable EPSV which throws certain stateful firewalls
into confusion.

Add option -r to make ftpd support only read-only operations.

Submitted by:	Flemming (F3) Jacobsen <fj@batmule.dk>
Reviewed by:	phk
2000-12-16 19:19:19 +00:00
Ruslan Ermilov
ed40311694 mdoc(7) police: removed history info from the .Os FreeBSD call. 2000-12-14 11:52:05 +00:00
Julian Elischer
05eff81e04 Add support for advertising the service we support if the
PADI packet contains a NULL service.  This is apparently the desired
behaviour in this case, though we only allow advertising one
service. You could run multiple pppoeds to advertise multiple services.
2000-12-13 00:27:33 +00:00
Ruslan Ermilov
e22bb3897a mdoc(7) police: .Os CMU -> .Os, split authors for better output. 2000-12-12 15:31:21 +00:00
Ruslan Ermilov
a2fd3702a3 mdoc(7) police: use canonical form of .Dd macro. 2000-12-11 15:15:20 +00:00
Assar Westerlund
ba688fa510 (scrub_env): change to only accept a listed set of variables,
including only non-filename contents for TERMCAP
2000-12-10 20:50:20 +00:00
David E. O'Brien
1a37aa566b Add `_PATH_DEVZERO'.
Use _PATH_* where where possible.
2000-12-09 09:35:55 +00:00
Ruslan Ermilov
114c43dcf8 Whitespace-only to sync with -stable. 2000-12-07 15:09:48 +00:00
Ruslan Ermilov
2961f2ed60 MFS: Silence compilation warnings. 2000-12-07 14:59:11 +00:00
Brian Somers
b884490bc0 Drop out of our main loop due to a signal rather than handling things in the
signal handler.
Fix a spelling error.

Subtley pointed out by: bde

Make some stuff static
2000-12-04 22:13:30 +00:00
David E. O'Brien
2c5569d6ff The GCC 2.96 snapshots have slightly different rules for finding include
files.  Mostly -I${.CURDIR} was needed -- especially for YACC generated
files as the new cpp does not look in the ultimate source file
(ie, the .y file)'s directory as told by the "#line" directive.  Some were
misspellings of "-I${.CURDIR}" as "-I.".
2000-12-01 09:39:28 +00:00
David E. O'Brien
d548f6db32 There is no src/contrib-crypto/ anything directory. So don't look for
include files in subdirs of it.
2000-12-01 06:34:44 +00:00
Philippe Charnier
57757e9f36 Remove unused #include. Use getopt(3). Add usage() with syslog(3) cap. 2000-11-28 18:15:25 +00:00
Kris Kennaway
b63695f384 Constify 2000-11-27 07:21:37 +00:00
Daniel O'Callaghan
3fbaa839f9 Prevent leakage of information about anonymous user's homedir
via 'QUOTE CWD'.

Reviewed by:	des
2000-11-26 23:33:36 +00:00
Kris Kennaway
97ad2a1bc4 Correct definition of MAXHOSTNAMELEN in ifdef'ed out code. 2000-11-26 22:18:11 +00:00
Kris Kennaway
f6fd83ed27 Correct definition of MAXHOSTNAMELEN in ifdef'ed code.
Submitted by:	Edwin Groothuis <mavetju@chello.nl>
PR:		bin/22787
2000-11-26 21:37:51 +00:00
Kris Kennaway
a16f31237a Constify 2000-11-26 10:21:54 +00:00
Kris Kennaway
18fdc5893a Don't hard-code a buffer size 2000-11-26 10:05:06 +00:00
Ruslan Ermilov
760819894e mdoc(7) police: use the new features of the Nm macro. 2000-11-20 14:42:24 +00:00
Kris Kennaway
ffd4007070 Format string paranoia 2000-11-19 13:30:36 +00:00
Kris Kennaway
3fb3b78f0f Format string paranoia 2000-11-19 12:46:16 +00:00
Kris Kennaway
e10471bbba L_SET -> SEEK_SET
Obtained from:	OpenBSD
2000-11-19 10:56:14 +00:00
Kris Kennaway
b601f693db Format string paranoia
Obtained from:	OpenBSD
2000-11-19 10:52:10 +00:00
Kris Kennaway
75dd9c65fa Don't use sizeof() on a pointer when we really wanted to measure
the length of the array.

Noticed by:	Christos Zoulas <christos@ZOULAS.COM>
Obtained from:	OpenBSD
2000-11-19 10:01:27 +00:00
John W. De Boskey
46ee285632 Check return code from login_tty. Allow getty to try and become
a daemon and session leader (thus allowing getty to be run from
a shell command line or script).

Partially Reviewed by:	bde
2000-11-19 02:10:25 +00:00
Brian Somers
80e2e6b62f Go back to populating data_len in struct ngpppoe_init_data. 2000-11-16 23:15:42 +00:00
Ben Smithurst
76a06f8483 remove trailing periods from SEE ALSO. 2000-11-15 17:27:54 +00:00
Ruslan Ermilov
b5c508fba3 Use Fx macro wherever possible. 2000-11-14 11:20:58 +00:00
Ruslan Ermilov
726b61ab5f Avoid use of direct troff requests in mdoc(7) manual pages. 2000-11-10 17:46:15 +00:00
Dirk Froemberg
59cc881262 Fix to=auto in bootptab.
PR:		misc/5574
Submitted by:	Bart Robinson <lomew@marker.cs.utah.edu>
Reviewed by:	wollman
2000-11-10 12:19:53 +00:00
John Polstra
c1ff193db4 Remove the superfluous call to _rtld_error() in symlook_default().
The function's callers generate the error message when appropriate.

This eliminates the message ``Undefined symbol "__register_frame_info"''
which was bogusly returned by dlerror() in some cases.
2000-11-07 22:41:53 +00:00
Kris Kennaway
4147bd4426 Filter out some more magic environment variables used by libraries linked
with telnetd. This should really be done with a positive filter - i.e.
only allow through a configured list of variables.

Also do some buffer-safety cleanups while I'm here - I don't think these
are exploitable.
2000-10-31 05:29:54 +00:00
Brian Somers
fbf0385368 Use the new-style ngpppoe_init_data structure.
Approved by: archie
2000-10-31 02:46:12 +00:00
Gregory Neil Shapiro
d1ba25f456 Add a MAINTAINER= line so people know who to blame 2000-10-26 23:02:36 +00:00
Guido van Rooij
ea413ab7ad Fix broken PAM with SKEY behaviour: the skey.access file checks
were broken because the code failed to set PAM_RHOST.
2000-10-12 10:21:05 +00:00
Ruslan Ermilov
6f1214d918 Removed broken PAM support from rshd(8) and rlogind(8). rshd does
not allocate a pty(4) so it is not suitable at all for interactive
PAM modules.  rlogind calls login(1) which is already PAM enabled.

Approved by:	markm
2000-10-12 07:18:20 +00:00
Gregory Neil Shapiro
c6cc60252d Style fixes 2000-10-11 05:04:21 +00:00
Gregory Neil Shapiro
1e1c8c164c mail.local(8) is no longer installed as a set-user-id binary.
Users may have to adjust their configuration to call mail.local as root
by adding the F=S flag to the local mailer.  Most probably already have this.
2000-10-10 18:12:30 +00:00
Garrett Wollman
eb2fc78027 Don't depend on <sys/stat.h> bogusly including <sys/time.h> (and thereby
<time.h>).
2000-10-10 01:50:26 +00:00
Ruslan Ermilov
9b376c9084 Make it compile without -DNO_PAM again. 2000-10-06 17:08:31 +00:00
Brian Somers
fd845ee4c3 o Load netgraph.ko, ng_ether.ko and ng_pppoe.ko as required (I'm sure this
used not to be necessary).
o Allow ``-n ngdebug'' to specify something to pass to NgSetDebug()
  and redirect NgSetDebug() output to syslog(8) in daemon() mode.
o Xref ng_ether(8) and NgSetDebug(4).
o Correct the type of the response passed to NgRecvData.
2000-10-03 20:41:00 +00:00
John Polstra
185db83c04 Add support for dlsym(RTLD_DEFAULT, ...). 2000-09-19 04:27:16 +00:00
Gregory Neil Shapiro
cf1fec423a Give users a way to alter the sendmail (and related utilities) build
environment so they can enable functionality such as SASL, LDAP, Hesiod.
2000-09-17 00:41:33 +00:00
Garrett Wollman
67c31d5008 Some more slight doco fixes: update date, and add a bit more to the history. 2000-09-14 19:20:17 +00:00
Garrett Wollman
f62eaadff1 Allow tftpd to run as a specified user, not just `nobody'.
Update documentation to reflect new option.  Also fix documentation
style and add missing references.

PR:		21268
Submitted by:	"Aleksandr A. Babaylov" <babolo@links.ru>
Reviewed by:	imp
2000-09-14 19:08:29 +00:00
Warner Losh
7c62d872a5 strerror is declared in <string.h>
errno is declared in <errno.h>
2000-09-04 05:48:09 +00:00
Warner Losh
53410a4824 remove redundant optreset declaration 2000-09-04 05:47:14 +00:00
John W. De Boskey
bde08d0072 Pass two pointer parameters to the r_debug_state() hook
function, thus allowing a debugger or other trace tool
to easily grab the addresses of the needed structures
off the stack.

This change is transparent to gdb, which locates the
link_map list and transfers it to debugger memory
for comparison purposes.

A sample program will be committed showing how this can
be used.

Reviewed by:    John Polstra <jdp@FreeBSD.org>
2000-08-26 05:13:29 +00:00
Sheldon Hearn
90906a46ea Don't set an arbitrary limit on username lengths; use MAXLOGNAME
instead.

PR:		20675
Submitted by:	Vladimir B Grebenschikov <vova@express.ru>
2000-08-17 12:31:17 +00:00
Ruslan Ermilov
2310b8c624 Fix `control socket: Protocol not supported' failure in
standalone -D mode when neither -4 nor -6 is specified.
2000-08-16 09:12:33 +00:00
Gregory Neil Shapiro
88c75941e6 The rest of the changes needed to support the new version of sendmail (8.11.0).
Beyond changes to the build system, this includes fixing up the sample
freebsd.mc configuration for changes in defaults and syntax, removing
outdated documentation, and updating the release notes.
2000-08-12 22:39:25 +00:00
Kris Kennaway
769ec4a81a sprintf() -> snprintf() paranoia. 2000-08-04 10:39:34 +00:00
Sheldon Hearn
028f24cffa Honour skey.access(5) by allowing UNIX passwords when skeyaccess(3)
has set pwok to a non-zero value.

Previously, the fact that skey.access(5) allowed UNIX passwords for
this connection attempt was ignored, even in the NOPAM case.

This only addresses the NOPAM case; when libpam is used, the problem
will persist.

PR:		20333
2000-08-01 13:58:55 +00:00
Nick Sayer
3d4a189e9f Add 'nc' flag to gettytab -- no carrier. Forces non-blocking open and
setting of CLOCAL. Necessary for 3 wire RS-232 setups with dumb
terminals.

PR:		5959
2000-07-31 23:47:57 +00:00
Hajimu UMEMOTO
21cca9bebe Make compilable without -DINET6.
With shut up unused variable warnings.

PR:		bin/20225
Submitted by:	Paul Herman <pherman@frenchfries.net>
2000-07-28 09:34:44 +00:00
John Polstra
44a028c369 Revamp the code that calls shared libraries' init and fini functions.
Formerly the init functions were called in the opposite of the
order in which libraries were loaded, and libraries were loaded
according to a breadth-first traversal of the dependency graph.
That ordering came from SVR4.0, and it was easy to implement but
not always sensible.

Now we do a depth-first walk over the dependency graph and call
the init functions in an order such that each shared object's needed
objects are initialized before the shared object itself.  At the
same time we build a list of finalization (fini) functions in the
opposite order, to guarantee correct C++ destructor ordering whenever
possible.  (It may not be possible if dlopen and dlclose are used
in strange ways, but we come as close as one can come.)

The need for this renovation has become apparent as more programs
have started using multithreading.  The multithreaded C library
libc_r requires initialization, whereas the standard libc does not.
Since virtually every other object depends on the C library, it is
important that it get initialized first.
2000-07-26 04:24:40 +00:00
Brian Feldman
119fc1a3ce We shouldn't use cp to save the old ld-elf.so.1. Use the sanctioned tool
${INSTALL} with -C -p instead.
2000-07-20 08:00:02 +00:00
Dag-Erling Smørgrav
6200918df7 Don't reply "not a plain file" when the requested file doesn't exist. 2000-07-17 22:24:52 +00:00
John Polstra
cf98e66403 Fix a bug which could cause programs with user threads packages to
lock against themselves, causing infinite spinning.  Brian Feldman
found this problem when testing with Mozilla and supplied the fix,
which I have revised slightly.

Here is the failure scenario.  A thread calls dlopen() and acquires
the writer lock.  While the thread still holds the lock, a signal
is delivered and caught.  The signal handler tries to call a function
which hasn't been bound yet.  It thus enters the dynamic linker
and tries to acquire the reader lock.  Since the writer lock is
already held, it will spin forever in the signal handler.  The
thread holding the lock won't be able to progress and release the
lock.

The solution is to block almost all signals while holding the
exclusive lock.

A similar problem could conceivably occur in the opposite order.
Namely, a thread is holding the reader lock and then a signal
handler calls dlopen() or dlclose() and spins waiting for the writer
lock.  We deal with this administratively by proclaiming that signal
handlers aren't allowed to call dlopen() or dlclose().  Actually
we don't have to proclaim a thing, since signal handlers aren't
allowed to call any system functions except those which are explicitly
permitted.

Submitted by:	Brian Fundakowski Feldman <green>
2000-07-17 17:18:13 +00:00
Kris Kennaway
fcee96bdc1 Don't call err() without a format string. 2000-07-11 23:53:22 +00:00
Ben Smithurst
a611641f01 Explain that the -S option only logs file downloads, not all transfers.
PR:		16934
Submitted by:	Kurt Zeilenga <kurt@OpenLDAP.org>
2000-07-11 11:42:29 +00:00
John Polstra
630df077ab Solve the dynamic linker's problems with multithreaded programs once
and for all (I hope).  Packages such as wine, JDK, and linuxthreads
should no longer have any problems with re-entering the dynamic
linker.

This commit replaces the locking used in the dynamic linker with a
new spinlock-based reader/writer lock implementation.  Brian
Fundakowski Feldman <green> argued for this from the very beginning,
but it took me a long time to come around to his point of view.
Spinlocks are the only kinds of locks that work with all thread
packages.  But on uniprocessor systems they can be inefficient,
because while a contender for the lock is spinning the holder of the
lock cannot make any progress toward releasing it.  To alleviate
this disadvantage I have borrowed a trick from Sleepycat's Berkeley
DB implementation.  When spinning for a lock, the requester does a
nanosleep() call for 1 usec. each time around the loop.  This will
generally yield the CPU to other threads, allowing the lock holder
to finish its business and release the lock.  I chose 1 usec. as the
minimum sleep which would with reasonable certainty not be rounded
down to 0.

The formerly machine-independent file "lockdflt.c" has been moved
into the architecture-specific subdirectories by repository copy.
It now contains the machine-dependent spinlocking code.  For the
spinlocks I used the very nifty "simple, non-scalable reader-preference
lock" which I found at

  <http://www.cs.rochester.edu/u/scott/synchronization/pseudocode/rw.html>

on all CPUs except the 80386 (the specific CPU model, not the
architecture).  The 80386 CPU doesn't support the necessary "cmpxchg"
instruction, so on that CPU a simple exclusive test-and-set lock
is used instead.  80386 CPUs are detected at initialization time by
trying to execute "cmpxchg" and catching the resulting SIGILL
signal.

To reduce contention for the locks, I have revamped a couple of
key data structures, permitting all common operations to be done
under non-exclusive (reader) locking.  The only operations that
require exclusive locking now are the rare intrusive operations
such as dlopen() and dlclose().

The dllockinit() interface is now deprecated.  It still exists,
but only as a do-nothing stub.  I plan to remove it as soon as is
reasonably possible.  (From the very beginning it was clearly
labeled as experimental and subject to change.)  As far as I know,
only the linuxthreads port uses dllockinit().  This interface turned
out to have several problems.  As one example, when the dynamic
linker called a client-supplied locking function, that function
sometimes needed lazy binding, causing re-entry into the dynamic
linker and a big looping mess.  And in any case, it turned out to be
too burdensome to require threads packages to register themselves
with the dynamic linker.
2000-07-08 04:10:38 +00:00
John Polstra
517191eede When installing the dynamic linker, save the previous version in
"ld-elf.so.1.old".  The dynamic linker is a critical component of
the system, and it is difficult to recover if it is damaged and
there isn't a working backup available.  For instance, parts of
the toolchain such as the assembler are dynamically linked, making
it impossible to build a new dynamic linker if the installed one
doesn't work.
2000-07-08 03:27:54 +00:00
Brian S. Dean
f2b5eea7aa Plug the hole where rshd would bypass a proper .rhosts check if the
password was empty.

Reviewed by:	Warner Losh <imp@freebsd.org>
2000-07-05 17:47:17 +00:00
Sheldon Hearn
cbe10916b3 Only punctuation is an allowed argument type for open-close macros
such as Po/Pc, as explained by phantom.

Reported by:	billf
2000-06-30 06:30:53 +00:00
David Nugent
b535a9bf12 Fix a problem in the virtual host address compare code which caused
duplicated host entries in /etc/ftphosts not to be folded. Make sure
we exit the loop on a match.

PR:		bin/19390
2000-06-26 05:36:09 +00:00
Josef Karthauser
141d77b8cb Switch over to using the new fflagstostr and strtofflags library calls. 2000-06-17 14:19:33 +00:00
Jonathan Lemon
7d664a2f47 Spelling fix: transfered --> transferred
Submitted by:  dan@dan.emsphone.com
2000-06-02 21:22:09 +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
Nick Sayer
2db39860cf 1. Add IPv6 portrange restriction code (-U flag) to passive().
2. Add portrange restriction code (for both v4 and v6) to the EPSV
processing stuff.
2000-05-25 19:30:18 +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
John Polstra
a0f2601e13 Eliminate unaligned accesses that occurred when relocating the
DWARF2 exception tables emitted by the compiler for C++ sources.
These tables are tightly packed, and they contain some relocated
addresses which are not well-aligned.
2000-05-22 16:31:18 +00:00
Bruce Evans
86f792b120 Don't uselessly set MANDEPEND (it isn't used in this Makefile, and isn't
really used in bsd.man.mk).

Don't uselessly set MANSRC ("." is in the path by default, and there are
no ordering problems).

Fixed some other style bugs.
2000-05-15 15:01:13 +00:00
Nick Sayer
210376ef16 Man page fixups
Submitted by:	sheldonh@uunet.co.za
2000-05-15 14:06:07 +00:00
Hajimu UMEMOTO
cacdbc0d13 IPv6 support.
Reviewed by:	shin
2000-05-14 18:01:05 +00:00
Nick Sayer
0d9fb499eb Add -i (insecure) flag to rexecd, which allows uid == 0 logins
(presuming that the user in question is not in /etc/ftpusers and
does not have a null password).
2000-05-13 15:58:36 +00:00
Mike Pritchard
751f44657e Minor mdoc cleanup.
PR:		docs/13218
2000-05-05 02:21:45 +00:00
Jeroen Ruigrok van der Werven
2e79759062 Remove dead debug code.
This also removes a dependency/reference on COMPAT_43.
2000-04-29 12:02:00 +00:00
Sheldon Hearn
35add0e9a7 Cross-reference ldd(1) in rtld(1) and vice versa. 2000-03-28 09:01:04 +00:00
Bruce Evans
9d08570309 Fixed missing DPADDs.
Fixed some style bugs (some usual ones for LDADD, and misformatting of
$FreeBSD$).
2000-03-27 16:11:27 +00:00
Dan Moschuk
e4322bc6d3 Wrap uucpd behind the NOUUCP knob.
Noticed by: Doug Barton
2000-03-24 18:21:09 +00:00
Ruslan Ermilov
8780fb291e Finally unifdef -DINTERNAL_LS. 2000-03-13 11:20:09 +00:00
Mark Murray
f0ad5f0b62 Use libcrypto instead of libdes. 2000-02-24 21:18:08 +00:00
Yoshinobu Inoue
7395b85a9e Support logging for IPv6 remote host.
Approved by: jkh

PR: bin/16789
Submitted by: Ben Smithurst <ben@scientia.demon.co.uk
2000-02-18 07:08:03 +00:00
Peter Wemm
05c1f99bee Doc fix: remove references to ~ftp/bin/ls as we have FTPD_INTERNAL_LS
unconditionally active already.

Noticed by:	obrien
2000-02-17 02:14:11 +00:00
Yoshinobu Inoue
f38c6cadf9 Add more dual stack consideration.
-ftpd need to know each of AF_INET and AF_INET6 addr for hosts specified in
   /etc/ftphosts.

Approved by: jkh
2000-02-10 19:51:30 +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
9ddb9015ff Remove unnecessary -g for CFLAGS.
-g for CFLAGS which was set at debugging time was mistakenly committed,
 so removed it.

Approved by: jkh
2000-02-03 10:01:11 +00:00
Yoshinobu Inoue
b3ea3170b3 Fix ftpd core dump when hostname is not set.
When hostname is not set, ftpd core dumps, because there is no
  NULL check for freeing name resolving information for its own
  hostname.
  So the check is added.

Approved by: jkh
2000-02-03 09:59: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
ea5cc7f114 Add a manual page for the ELF dynamic linker. I initially created
rtld.1 by means of a repository copy from "src/libexec/rtld-aout/rtld.1".
Then I edited it to make it (more) accurate for the ELF dynamic
linker.
2000-01-29 03:16:54 +00:00
John Polstra
ed6332a49e Move the man pages for the a.out dynamic linker into the 1aout
section.  I created rtld.1aout earlier with a repository copy.

This clears the way for the ELF dynamic linker man page, which I
will commit next.
2000-01-29 03:13:49 +00:00
John Polstra
7dbe16fbee When a threads package registers locking methods with dllockinit(),
figure out which shared object(s) contain the the locking methods
and fully bind those objects as if they had been loaded with
LD_BIND_NOW=1.  The goal is to keep the locking methods from
requiring any lazy binding.  Otherwise infinite recursion occurs
in _rtld_bind.

This fixes the infinite recursion problem in the linuxthreads port.
2000-01-29 01:27:04 +00:00
Yoshinobu Inoue
1f2ba8fcb7 Fix rshd coredump when AF_INET socket is used.
Confirmed by: F. Heinrichmeyer <fritz.heinrichmeyer@fernuni-hagen.de>
2000-01-28 20:02:02 +00:00
Bruce Evans
21bac31e55 Changed setflags() to set_flags(). This fixes world breakage due to
recently incremented namespace pollution in <unistd.h>.
2000-01-28 07:12:03 +00:00
Yoshinobu Inoue
4dd8b5ab79 another tcp apps IPv6 updates.(should be make world safe)
ftp, telnet, ftpd, faithd
  also telnet related sync with crypto, secure, kerberosIV

Obtained from: KAME project
2000-01-27 09:28:38 +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
John Polstra
5bc2f0f789 Block almost all signals in the default locking method instead of
just a few of them.  This looks like it solves the recent

  ld-elf.so.1: assert failed: /usr/src/libexec/rtld-elf/lockdflt.c:55

failures seen by some applications such as JDK.
2000-01-25 01:32:56 +00:00
Mike Pritchard
bb2c7cbb5b Fix various man pages to stop abusing the .Bx macro to generate the
string "FreeBSD".  Use the .Fx macro instead.
2000-01-23 02:18:19 +00:00
John Polstra
924d965ba0 Allow files in LD_PRELOAD to be separated by white space, like Solaris
and Linux.
2000-01-22 22:20:05 +00:00
Jeroen Ruigrok van der Werven
f84ca2612e We do not support the -B option.
PR:		15925
Submitted by:	Thierry Herbelot
2000-01-12 14:49:38 +00:00
John Polstra
9bfb1dfc29 Revamp the mechanism for enumerating and calling shared objects'
init and fini functions.  Now the code is very careful to hold no
locks when calling these functions.  Thus the dynamic linker cannot
be re-entered with a lock already held.

Remove the tolerance for recursive locking that I added in revision
1.2 of dllockinit.c.  Recursive locking shouldn't happen any more.

Mozilla and JDK users: I'd appreciate confirmation that things still
work right (or at least the same) with these changes.
2000-01-09 21:13:48 +00:00
Alexey Zelkin
4df223aaf6 . mdoc(7)'fy
. add Xrs to hosts.equiv(5), auth.conf(5), services(5) to some pages
. sort Xrs in SEE ALSO sections

Patches based on PR:	docs/15680
Submitted by:		Christian Weisgerber <naddy@mips.rhein-neckar.de>
2000-01-07 13:14:32 +00:00
Josef Karthauser
edc2844c9f Moved flags_to_string and string_to_flags into libutil. It's used in
many places nowadays.
1999-12-30 13:15:15 +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
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
Peter Wemm
6e2578e4c4 Revert the libcrypt/libmd stuff back to how it was. This should not have
happened as it was working around problems elsewhere (ie: binutils/ld
not doing the right thing according to the ELF design).  libcrypt has
been adjusted to not need the runtime -lmd.  It's still not quite right
(ld is supposed to work damnit) but at least it doesn't impact all the
users of libcrypt in Marcel's cross-build model.
1999-12-18 13:55:17 +00:00
Marcel Moolenaar
7c99ddf2cc Add libmd (or move it after libcrypt). We don't want the linker to be
smart because it will definitely get it wrong. This popped up during
cross-linking.
1999-12-16 10:55:45 +00:00
Sheldon Hearn
f0f4f75620 Correct the ttys.5 and init.8 manpages with respect to the incorrect
assumption that only getty processes can be managed.  Describe the
SysV-like ability to keep arbitrary long-running processes alive
using a non-device first field in /etc/ttys.

PR:		12767
Submitted by:	Peter Jeremy <peter.jeremy@alcatel.com.au>
1999-12-06 09:07:14 +00:00
Peter Wemm
64baa0b4e3 Reactivate named-xfer 1999-11-30 06:23:04 +00:00
Peter Wemm
fe6d3fe571 Move named and associated tools into a seperate makefile section and
disable them pending an import and cleanup of bind 8.2.2.p5.
1999-11-30 02:18:13 +00:00
Brian Somers
97cba131dc Add a ``-P pidfile'' option 1999-11-23 00:21:20 +00:00
Brian Somers
fe63703662 Enable pppoed 1999-11-21 23:39:51 +00:00
Brian Somers
dbc7ba8d31 pppoed(8) - a server to accept PPPoE connections 1999-11-21 23:39:14 +00:00
John Polstra
df618d033c In revision 1.21 I changed the search order for shared libraries,
but I forgot to make the corresponding fix to the comment.  Rectify
that.

Submitted by:	Tony Finch <fanf@demon.net>
1999-11-19 04:45:07 +00:00
Marcel Moolenaar
8ef94ce860 Fix bootpd for Alpha.
bptypes.h originally defined int32 to be of type long. This obviously
doesn't work on the Alpha. By defining int32 (and u_int32) in terms of
int32_t (and u_int32_t) it now is what it says it should be.

Two occurrences of 'unsigned int32' have been changed to 'u_int32' for
consistency.

Submitted by: Wilko Bulte <wilko@yedi.iaf.nl>
1999-11-12 10:11:48 +00:00
Eivind Eklund
5bd9ff610a Log username with password failure.
This has proved useful in real life installations.
1999-11-06 20:58:44 +00:00
Mark Murray
b8351749c9 Allow for a telnet in secure/ (SRA telnet). 1999-10-07 20:04:17 +00:00
Alfred Perlstein
09ef98c6c0 sync with netbsd PR 8534, fix undefined C code.
Pointed out by: David A. Holland
1999-10-07 08:41:55 +00:00
Alexey Zelkin
8bd2d9a0e6 .Nm += "rtld"
apropos(1) now knows about rtld(1) manpage.
1999-09-28 05:35:59 +00:00
Alexey Zelkin
c6d6e7726f Correct spelling : ascii -> ASCII
PR:		docs/13702
Submitted by:	Stephen J. Roznowski <sjr@home.com>
Reviewed by:	mpp
1999-09-20 09:15:23 +00:00
Mark Murray
6c9134c067 Fix for new Kerberos4. Make a fist cut at PAM-ising while I'm here. 1999-09-19 22:05:32 +00:00
Michael Haro
9db4bbf32a When a STAT command is sent to ftpd as an out-of-band transmission during
a file transfer, the command was mishandled on every other receipt of the
command.

PR:		13261
Submitted by:	Ian Lepore <ian@plutotech.com>
1999-09-12 01:27:46 +00:00
Mark Murray
b2b9ed4833 Fix more Common Error brokenness. 1999-09-06 20:18:44 +00:00
Mark Murray
9891baa632 Add common error lib for the Kerberos case. 1999-09-06 06:32:02 +00:00
John Polstra
825316056a Make jdk-1.1.8 work again. It turns out that some code inside
libjava peeks into the dynamic linker's private Obj_Entry structures.
My recent changes introduced some new members near the front of
the structures, causing libjava to get the wrong fields.  This commit
moves the new members toward the end of the structure so that the
layout of the portion that is relevant to JDK remains the same as
before.

I will work with the JDK porting team to see if we can come up with
a less fragile way for them to do what they need to do.  I understand
the current approach was necessary in order to work around some
limitations of the dynamic linker.  Maybe it's not necessary any
more.
1999-09-05 21:12:53 +00:00
John Polstra
0edd3ca778 Enable -Wformat checking for debug_printf(). 1999-09-04 20:36:27 +00:00
John Polstra
ed5e1b5537 Change the warning about unrecognized entries in the dynamic table
to a debug message which is disabled in production builds of the
dynamic linker.  The condition warned about is normally harmless.

PR:		bin/12849
1999-09-04 20:14:48 +00:00
John Polstra
476015a33b When looking up symbols, search the objects loaded at program start
up first -- before the dlopened DAGs containing the referencing
object.

This makes dynamically loaded perl modules work properly again.
1999-09-04 04:00:09 +00:00
John Polstra
a607e5d7f8 Get the actual pathname of the dynamic linker from the executable's
PT_INTERP program header entry, to ensure that gdb always finds
the right dynamic linker.

Use obj->relocbase to simplify a few calculations where appropriate.
1999-08-30 01:54:13 +00:00
John Polstra
7360ae0f2a When checking to see if a shared object is already loaded, look for
a device/inode match if no pathname match is found.
1999-08-30 01:50:41 +00:00
John Polstra
926ea445fe Revamp the symbol lookup algorithm to cope better with objects
loaded separately by dlopen that have global symbols with identical
names.  Viewing each dlopened object as a DAG which is linked by its
DT_NEEDED entries in the dynamic table, the search order is as
follows:

  * If the referencing object was linked with -Bsymbolic, search it
    internally.
  * Search all dlopened DAGs containing the referencing object.
  * Search all objects loaded at program start up.
  * Search all objects which were dlopened() using the RTLD_GLOBAL
    flag (which is now supported too).

The search terminates as soon as a strong definition is found.
Lacking that, the first weak definition is used.

These rules match those of Solaris, as best I could determine them
from its vague manual pages and the results of experiments I performed.

PR:		misc/12438
1999-08-30 01:48:19 +00:00
John Polstra
7326e0b620 When honoring -Bsymbolic, still keep searching if only a weak
definition was found in the referencing object.
1999-08-30 01:25:38 +00:00
John Polstra
6bd9374580 Simplify the logic in find_symdef(). 1999-08-30 01:24:08 +00:00
Mike Pritchard
229494cb51 Add $FreeBSD$ lines to man pages that are missing them to make it
easier for translation teams.

PR:		docs/13418
Submitted by:	Alexey Zelkin <phantom@cris.net>
1999-08-28 23:10:20 +00:00
Peter Wemm
7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
Peter Wemm
1713064734 unifdef -DINTERNAL_LS - it's too useful to be off by default. If anyone
really dislikes this, we could add a switch to disable it at runtime and
check in popen.c.
1999-08-26 00:45:36 +00:00
Warner Losh
7d773433a7 Ufff. cflags -> chflags. I could have sworn this change has been in
my last three successful make buildworlds...

Noticed by: phk
1999-08-21 20:54:40 +00:00
Warner Losh
15621e0d76 Remove all flags from devices before we try to assert ownership and
set permissions.

Bug not fixed:
	We silently ignore failures of chflags, chmod and chown.
1999-08-21 18:15:55 +00:00
John Polstra
41f83b07a8 Add a NULL pointer check whose absence could cause segmentation
violations in certain obscure cases involving failed dlopens.  Many
thanks to Archie Cobbs for providing me with a good test case.

Eliminate a block that existed only to localize a declaration.
1999-08-20 22:33:44 +00:00
Jordan K. Hubbard
ef4aaceaa0 Back out previous commit - it's not necessary now that tty.h properly includes
the queue macros.
1999-08-09 07:51:03 +00:00
Brian Feldman
3452a15dcf Add a missing include (sys/queue.h for sys/tty.h SLIST usage.) 1999-08-09 02:19:38 +00:00
Gene Stark
ccc2025d3a Correction to previous commit. 1999-08-08 07:23:12 +00:00
Gene Stark
de44c0a11d Corrected mistake that was causing daemon to loop without serving
user requests.  Note that nothing can be said about the value of 'user'
unless User != NULL.
1999-08-08 07:05:46 +00:00
John Polstra
bfb1ef6058 Change many asserts into normal errors. They were all for conditions
caused by invalid shared objects rather than by internal errors.

Enable format string mismatch checking for _rtld_error().
1999-07-18 00:02:19 +00:00
John Polstra
cb435fa919 Change the symbol used to find the end of an object's address space
from "end" to "_end".  The former does not exist in most shared
libraries.  This fixes problems in dladdr() and dlsym(RTLD_NEXT, ...).
1999-07-14 04:09:11 +00:00
Mike Pritchard
2dd1e9f4e1 Fix a couple of typos.
PR:		12610
Submitted by:	Seth <seth@freebie.dp.ny.frb.org>
1999-07-12 18:37:48 +00:00
Doug Rabson
e85422ad1d Add code to 'handle' R_ALPHA_NONE relocations by ignoring them. 1999-07-12 07:54:45 +00:00
John Polstra
18cd0551a7 Add a MAINTAINER line naming myself. We control the vertical. We
control the horizontal.
1999-07-09 16:27:43 +00:00
John Polstra
8d05e8c453 Fix bug: if a dlopen() failed (e.g., because of undefined symbols),
the dynamic linker didn't clean up properly.  A subsequent dlopen()
of the same object would appear to succeed.

Another excellent fix from Max Khon.

PR:		bin/12471
Submitted by:	Max Khon <fjoe@iclub.nsu.ru>
1999-07-09 16:22:55 +00:00
John Polstra
5bf3700dae Shake hands with GDB a little bit earlier so that it is possible to
debug the init functions.

Submitted by:	dfr
1999-07-03 23:54:02 +00:00
Mike Pritchard
a206edcdb7 Update the SYNOPSIS to reflect that the -l option can be specified
more than once.

Pointed-out-by: sheldonh
1999-06-28 10:50:47 +00:00
John Polstra
d16ad2d055 Fix a reference counting problem when using dlopen(NULL, ...).
PR:		bin/12129
1999-06-25 04:50:06 +00:00
John Polstra
962fdc466a Fix a serious performance bug for large programs on the Alpha,
discovered by Hidetoshi Shimokawa.  Large programs need multiple
GOTs.  The lazy binding stub in the PLT can be reached from any of
these GOTs, but the dynamic linker only has enough information to
fix up the first GOT entry.  Thus calls through the other GOTs went
through the time-consuming lazy binding process on every call.

This fix rewrites the PLT entries themselves to bypass the lazy
binding.

Tested by Hidetoshi Shimokawa and Steve Price.

Reviewed by:	Doug Rabson <dfr@freebsd.org>
1999-06-25 02:53:59 +00:00
Peter Wemm
d050fd4212 Identify illegal switches, don't print them as '?' in the error.. 1999-05-18 05:51:09 +00:00
Bill Paul
f9d553adf5 Fix ypxfr so that it can be run from cron.
Patch submitted by: Dan Nelson <dnelson@emsphone.com>
1999-05-10 20:55:29 +00:00
Guy Helmer
e57c110bba Add missing -A option to SYNOPSIS.
PR:		docs/10771
1999-05-04 19:42:01 +00:00
Warner Losh
859663719d More egcs warning fixes:
o main returns int not void
	o use return 0 at end of main when needed
	o use braces to avoid potentially ambiguous else
	o don't default to type int (and also remove a useless register
	  modifier).

Reviewed by: obrien and chuckr
1999-04-25 22:23:38 +00:00
John Polstra
6d30b16752 Back out my change from 6 April PDT that added a new dlversion()
function.  It was an ill-considered feature.  It didn't solve the
problem I wanted it to solve.   And it added Yet Another Version
Number that would have to be maintained at every release point.
I'm nuking it now before anybody grows too fond of it.
1999-04-22 01:54:38 +00:00
John Polstra
5353bfc3b4 After relocating the main program, but before calling any of the
_init() functions, initialize the global variables "__progname" and
"environ".  This makes it possible for the _init() functions to call
things like getenv() and err().
1999-04-21 04:06:57 +00:00
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
John Birrell
b576a5aeae Chaneg MACHINE to MACHINE_ARCH to support MACHINE=pc98. 1998-09-05 08:31:10 +00:00
John Polstra
a565ca5920 Implement ldconfig functionality for ELF. The hints are stored in
a different file than the a.out hints, namely, "/var/run/ld-elf.so.hints".
These hints consist only of the directory search path.  There is
no hash table as in the a.out hints, because ELF doesn't have to
search for the file with the highest minor version number.  (It
doesn't have minor version numbers at all.)

A single run of ldconfig updates either the a.out hints or the ELF
hints, but not both.  The set of hints to process is selected in
the usual way, via /etc/objformat, or ${OBJFORMAT}, or the "-aout"
or "-elf" command line option.  The rationale is that you probably
want to search different directories for ELF than for a.out.

"ldconfig -r" is faked up to produce output like we are used to,
except that for ELF there are no minor version numbers.  This should
enable "ldconfig -r" to be used for checking LIB_DEPENDS in ports
even for ELF.

I implemented the ELF functionality in a new source file, with an
eye toward eliminating the a.out code entirely at some point in
the future.
1998-09-05 03:31:00 +00:00
John Birrell
e00072f9f4 Add -lcrypt when building kerberos. 1998-09-05 00:32:27 +00:00
John Birrell
2a356d7348 Enable rtld-elf for build on alpha too. We now have support for shared
libraries on alpha!
1998-09-04 22:55:17 +00:00
Doug Rabson
13575fc46f Add alpha support.
Submitted by: John Birrell <jb@cimlogic.com.au> (with extra hacks by me)
Obtained from: Probably NetBSD
1998-09-04 19:03:57 +00:00
John Polstra
63fac2b9ef Suppress duplicate entries in ldd output. 1998-09-02 02:51:12 +00:00
John Polstra
93df8d681b Style fixes. If it seems like a lot of lines of changes, it's
because I moved some functions.  Mr. Tidy likes them to be in
alphabetical order.
1998-09-02 02:00:20 +00:00
John Polstra
cefbc49679 Handle dlsym(NULL, ...) properly, by searching in the caller's
shared object.  Note, this searches _only_ that object, and not its
needed objects, in accordance with the documentation.

Also fix dlopen(NULL, ...) so that the executable's needed objects
are searched as well as the executable itself.
1998-09-02 01:09:34 +00:00
Wolfram Schneider
acd8019083 Sort cross references. 1998-08-31 16:41:09 +00:00
John Birrell
8deb7ff0b0 BINFORMAT -> OBJFORMAT ready for E-day. 1998-08-30 01:57:55 +00:00
Stephen McKay
166f84746d Pass me the pointy hat with the extra sequins. Just a moment, while I get
it to sit right...

The __error() hack gave out the wrong address.  It returned the address of
errno in ld.so instead of the address of errno in the main program.  Oops.

The hack is now correct, just in time to be obsoleted by elf.
1998-08-22 15:51:41 +00:00
John Birrell
1eab1be09e Update this header to use the revamped elf headers which select Elf32
or Elf64 based on the inclusion of the machine dependent header.

I've left the addition of the extra fields to handle the relocation
structures with addend for a separate commit after jdp has had a chance
to review what I've done. The current change is needed to compile
csu/alpha/crt1.c
1998-08-21 03:29:40 +00:00
John Polstra
9d5aee94a0 Add "-C" to INSTALLFLAGS to install atomically. An elf->elf
installworld dies at this point otherwise, leaving the system
without a dynamic linker.
1998-08-17 04:59:15 +00:00
Mark Murray
448bbb5805 Fix LIBDIR (for aout/ELF). 1998-08-06 21:41:13 +00:00
Peter Wemm
4add781b40 Build mail.local and smrsh (when building sendmail) 1998-08-04 15:32:43 +00:00
Peter Wemm
31655e8ab7 Build sendmail-8.9.1 smrsh 1998-08-04 15:31:31 +00:00
Peter Wemm
9b842df695 Use sendmail-8.9.1 mail.local (with our changes). It has LMTP support. 1998-08-04 15:30:17 +00:00
Bruce Evans
bb6ae0a4a9 Fixed printf format errors. 1998-08-02 16:44:18 +00:00
Poul-Henning Kamp
ee98a93f47 Getty is missing the speed table entry for 230400 baud.
PR:		7280
Reviewed by:	phk
Submitted by:	Craig Leres <leres@ee.lbl.gov>
1998-07-22 05:57:22 +00:00
Steve Price
ef0ccf3dc0 Remove no longer needed FreeBSD specific code.
PR:		5497
Submitted by:	Jacob Bohn Lorensen <jacob@jblhome.ping.mk>
Obtained from:	OpenBSD (indirectly it seems so just to be safe)
1998-07-20 04:52:26 +00:00
Joseph Koshy
d59b62e37b Document the use of lines beginning with a '#' as comment lines.
PR: 5676
1998-07-09 11:38:21 +00:00
Joseph Koshy
d1428a91eb Clean up grammar. Provide proper pathnames for spool directories.
Document dependency on current load average for starting new batch jobs.

PR: 7109
1998-07-01 05:47:58 +00:00
Bruce Evans
1a463b86e9 Fixed printf format errors. 1998-06-30 15:19:51 +00:00
Bruce Evans
375557fcad Don't assume that time_t is long. 1998-06-29 17:06:00 +00:00
Bruce Evans
74b5e3ebd1 Don't assume that time_t is long. Fixed printf format errors. 1998-06-29 16:47:08 +00:00
Stephen McKay
1188f66af7 Since I got no objections to this patch, and no one has offered any
alternative, I present .. ta! da! .. the __error() hack.

This patch to the a.out dynamic loader provides old a.out binaries
with __error() if they are linked with an older libc that lacks it,
but are also linked against a library that needs it.

There is a smaller, tricker hack that takes advantage of the fact
that ld.so has __error() too, courtesy of the new libc, but this
hack is the straightforward version.
1998-06-21 14:22:29 +00:00
Peter Wemm
fc882c32be Fix stupid typo, I had only tested this in elf mode. 1998-06-12 19:45:14 +00:00
Peter Wemm
6c81492cb8 Only build rtld-aout if we're in an a.out build environment. 1998-06-12 16:09:33 +00:00
Peter Wemm
d5431fa51e Activate libbind 1998-06-11 09:17:58 +00:00
Poul-Henning Kamp
1499abeef4 Spelling fixes.
PR:		6903
Reviewed by:	phk
Submitted by:	Josh Gilliam <josh@quick.net>
1998-06-10 12:34:27 +00:00
Brian Somers
32b8743969 Search for libraries in dlopen() when the specified path
contains no ``/''s.
Elf already searches it seems.
Mostly submitted by: Mike Smith <mike@smith.net.au>
1998-06-07 03:53:08 +00:00
John Birrell
f24f28e28c named-xfer can't be linked static due to the duplicated symbols in
libc and libbind.

rpc.rstatd required libkvm.

Only try to build these on i386 for the time being.
1998-06-06 07:09:01 +00:00
Joseph Koshy
3dead0b645 Mention that syslog.conf(5) does not log LOG_FTP messages by default.
PR: 5287
1998-06-05 10:31:24 +00:00
Joerg Wunsch
09caeadeda Use gethostname(3) to obtain the local host name, as opposed to uname(3).
Otherwise the length of the name is limited to 32 characters only.
1998-06-03 20:01:28 +00:00
John Birrell
158a00b20e signal() returns SIG_ERR on error, not int.
time() requires a time_t pointer, not a long.
1998-06-03 11:33:44 +00:00
Joseph Koshy
9595a75afa Spelling corrections.
PR: 6829
Submitted by: Josh Gilliam <josh@quick.net>
1998-06-03 04:21:41 +00:00
Peter Wemm
04dc9546dd SUBDIR += rtld-aout 1998-06-01 14:33:06 +00:00
Peter Wemm
42decb4196 Seperate the Paul Kranenburg a.out rtld stuff into a stand-alone area away
from the gpl ld code.  This is part 2 of something that I began in 1996.
A repository copy has happened behind cvs's back.
1998-06-01 13:00:32 +00:00
Søren Schmidt
cabb97dcbf ELF preparation step 2:
Move a.out libraries to /usr/lib/aout to make space for ELF libs.
Make rtld usr /usr/lib/aout as default library path.
Make ldconfig reject /usr/lib as an a.out library path.
Fix various Makefiles for LIBDIR!=/usr/lib breakage.

This will after a make world & reboot give a system that no
longer uses /usr/lib/*, infact one could remove all the old
libraries there, they are not used anymore.

We are getting close to an ELF make world, but I'll let this
all settle for a week or two...
1998-05-26 20:12:56 +00:00
Steve Price
7edcb9366e Make ftpd(8) honor its default group setting in the config files.
PR:		6682
Submitted by:	Max Euston <meuston@jmrodgers.com>
1998-05-25 03:45:35 +00:00
Andrey A. Chernov
23ea9f7e98 Back out "always UTC" fix since some people want visually identical 'ls'
output for local users. FTP protocol RFC also says that 'ls' output is
not machine-readable. "always UTC" still possible with TZ= in ftpd
environment by price of having UTC in log files too.

Fix INTERNAL_LS to sense new /etc/localtime after chroot
1998-05-18 00:06:28 +00:00
Andrey A. Chernov
34d1ba5cd5 Return back initial tzset() must be before first chroot 1998-05-16 21:23:33 +00:00
Andrey A. Chernov
f350361770 Return back vfork and use execve with TZ="" environment in vfork case 1998-05-15 16:51:06 +00:00
Andrey A. Chernov
f85f9e5656 Use fork instead of vfork since setenv clobber parent environment
Fork already used for INTERNAL_LS in anycase
1998-05-15 16:30:09 +00:00
Andrey A. Chernov
46589cb624 Move TZ="" assignment just before exec to not touch other time stuff 1998-05-15 16:08:52 +00:00
Andrey A. Chernov
2903069462 Do TZ= as first thing, since FTP protocol is unable to tell zone offset in
any case.

It makes no difference for anon account (since chroot already makes it GMT),
but if you do mirror with special non-anon login, in old variant
your mirror will be wholy retransmitted twice in the year due to
time zone changes (/etc/localtime plays bad role here)
1998-05-15 15:06:58 +00:00
John Birrell
63e7e54aa4 NetBSD kernels don't support TCP_NOPUSH, so on alpha don't try setting
this socket option. This is temporary code while the alpha still uses
NetBSD socket code in the kernel.
1998-05-15 03:23:28 +00:00
John Birrell
ad12d72a41 Remove a bogus prototype for time() and let time.h do that.
Change pointer casts from int to long. The code that looks to index -1
of argv is still broken on alpha.
1998-05-14 10:07:29 +00:00
Bruce Evans
330698829e Fixed missing dependencies on headers generated by rpcgen, as usual.
Removed bogus dependencies of generated .c files on generated headers.
Sorted sources lists.
1998-05-10 16:01:36 +00:00
Robert Nordier
c898c25b02 Replace _exit() with exit()
Pointed out by: Nathan Torkington <gnat@prometheus.frii.com> PR 5585
1998-05-05 00:28:51 +00:00
Robert Nordier
871f7745a1 Fix typo.
Pointed out by: Junji SAKAI <sakai.jp.freebsd.org> PR 5621
1998-05-05 00:12:01 +00:00
Bruce Evans
ef87dd8703 Simplified by using new yacc rules and by not generating y.tab.h. 1998-05-04 18:20:18 +00:00
Peter Wemm
1a0082552a Argh, forgot to commit the update here for bind-8.. Sorry folks...
Prompted by:	John Hay <jhay@mikom.csir.co.za>
1998-05-04 05:12:49 +00:00
Steve Price
b1dd8a7b57 Clarify use of 'if' capability.
PR:		6499
Submitted by:	Doug Barton <Studded@san.rr.com>
1998-05-04 02:37:29 +00:00
Steve Price
f1f61bc603 Avoid stairstep effect on output of 'if=...' file.
PR:		part of 6492
Submitted by:	Chip Norkus via Doug White <studded@san.rr.com>
1998-05-03 16:29:06 +00:00
Doug Rabson
46066cf144 Add support for ldd. 1998-05-01 08:39:27 +00:00
Doug Rabson
2001f720ce Add GDB support. The method and some of the code came from NetBSD's elf
runtime linker.
1998-04-30 07:48:02 +00:00
David Greenman
dadb9fb334 Set TCP_NODELAY on the control channel to improve performance a bit. 1998-04-28 03:37:23 +00:00
David Greenman
b81d7e37bb Fixed a bug where if MAXUSRARGS amount of args were passed in, the argv[]
array would end up without the NULL pointer termination, causing the glob
code to glob whatever garbage happend to follow on the stack.
1998-04-27 10:51:26 +00:00
Poul-Henning Kamp
5708bd4228 telnetd does not recognize the if (display file before login) gettytab flag.
PR:		6365
Reviewed by:	phk
Submitted by:	Jason Garman <init@risen.org>
1998-04-26 06:51:36 +00:00
Gene Stark
c8e50f41fe PR: misc/4679
Submitted by:	Glen Foster (gfoster@gfoster.com)
Fix missing "/" in dump file pathname.
1998-04-18 13:37:24 +00:00
Poul-Henning Kamp
20ef883886 openlog() needs to have LOG_NDELAY added, or else the syslog() calls after
the chroot will not get sent to syslogd.

PR:		4910
Reviewed by:	phk
Submitted by:	Jim Mercer <jim@komodo.reptiles.org>
1998-04-12 11:15:54 +00:00
Philippe Charnier
99e2b73dd8 .Sh AUTHOR -> .Sh AUTHORS. Use .An/.Aq. 1998-03-19 07:37:43 +00:00
Philippe Charnier
c92c0f2628 .Sh AUTHOR -. .Sh AUTHORS. Use .An/.Aq. 1998-03-19 07:37:22 +00:00
John Polstra
59f198d1ff Enable rtld-elf when building an ELF system on the i386. 1998-03-07 19:43:48 +00:00
John Polstra
3124c3e093 Import the ELF dynamic linker. This is the ElfKit version with
quite a few enhancements and bug fixes.  There are still some known
deficiencies, but it should be adequate to get us started with ELF.

Submitted by:	John Polstra <jdp@polstra.com>
1998-03-07 19:24:35 +00:00
Daniel O'Callaghan
20d2e1ee59 PR: 5812
Pointed-in-the-right-driection-by: Mike Smith and Steve Price

Close syslogging before calling ls_main()
1998-02-25 07:10:57 +00:00
Eivind Eklund
f5c57d05c1 Make ftpd log IP-addresses in addition to hostnames. 1998-02-24 08:45:57 +00:00
David E. O'Brien
f97d7807ad MFS. 1998-02-18 10:53:16 +00:00
John Polstra
663690b388 Implement dladdr. 1998-02-06 16:46:46 +00:00
Philippe Charnier
81389de071 Convert to mdoc. Header -> Id. Typo. 1998-02-03 07:30:22 +00:00
Poul-Henning Kamp
55d6f63f1c Remove lfs_cleanerd 1998-01-30 12:36:10 +00:00
Poul-Henning Kamp
4f4a34fffa Disable lfs_cleanerd 1998-01-30 12:35:10 +00:00
Bruce Evans
81d50a41f6 Merged just enough files from Lite2 in lfs_cleanerd to convert from
MOUNT_LFS to "lfs" in one place.  The merge was painful because it
conflicted with cosmetic FreeBSD changes.  lfs_cleanerd still compiles
cleanly but has aproximately the same chance of working as before (0).
1998-01-20 14:41:53 +00:00
Bill Paul
e4a0e42ba8 Make these programs compile and work correctly now that /usr/include/rpcsvc
has been ANSI-fied.

Pointed out by: bde
1998-01-19 23:13:38 +00:00
Bruce Evans
cc03533c8d Removed most unused includes of <net/if_var.h> outside the kernel. 1998-01-16 17:38:56 +00:00
Philippe Charnier
4493ca0bce Add missing dot. 1998-01-07 07:56:15 +00:00
Philippe Charnier
fcccc2999a Remove unused #includes and make it compile again with -DDEBUG. Use syslog()
instead of errx() when being a daemon.
1998-01-07 07:54:18 +00:00
Philippe Charnier
859c540701 Remove unused #include. Display if inetd started us in case of failure. 1998-01-07 07:51:00 +00:00
Philippe Charnier
09c4476e4e Typos. 1998-01-07 07:44:01 +00:00
Masafumi Max NAKANE
b1d9db7283 Typo fix: bootgw -> bootpgw 1997-12-29 13:59:28 +00:00
Warner Losh
a82e63028f style(9) nits
Submitted by:	bde
1997-12-26 23:36:43 +00:00
Warner Losh
d83662583c sprintf->snprintf paranoia
Obtained from: OpenBSD (?)
1997-12-24 19:39:57 +00:00
Warner Losh
45b3189258 Be extra paranoid about the length of data returned from gethostbyaddr or
gethostbyname.
Submitted by:	Julian Assange
1997-12-24 19:38:18 +00:00
Warner Losh
d3a9dd61ac sprintf->snprintf paranoia. The one thing that looks like a hole in
the diff is in an ifdef that isn't enabled for FreeBSD.
Obtained from:	OpenBSD(?)
1997-12-24 19:21:09 +00:00
Warner Losh
e760ef2c35 Various sprintf -> snprintf fixes.
Minor style fix (strcpy(foo,"") -> *foo = '\0')
Obtained from:	OpenBSD(?)
1997-12-24 19:13:23 +00:00
Warner Losh
9bc34f7ce1 Use snprintf rather than printf out of paranoia
Obtained from:	OpenBSD
1997-12-24 18:56:03 +00:00
Philippe Charnier
5802420635 Typo. 1997-12-18 07:39:27 +00:00
Philippe Charnier
20e9e8236d Cosmetic in usage string. 1997-12-15 07:19:41 +00:00
Philippe Charnier
27eed7e3b4 Use full path in synopsis. Sort #includes. Use .Tn for NIS. 1997-12-08 07:49:56 +00:00
Philippe Charnier
38de36c41c Sync with diffs I found in kerberised versions: -Wall, no `;' in macros. 1997-12-08 07:46:53 +00:00
John Polstra
6210388a93 Make emacs work again. This is a workaround for the fact that the
emacs a.out file, self-generated by emacs's "unexec" function in
"unexsunos4.c", is invalid.  In particular, its "_end" symbol has
the wrong value.  The dynamic linker was using the value of that
symbol to initialize its sbrk break level.

The workaround is to peek at the executable's a.out header in
memory, and calculate what "_end" should be based on the segment
sizes.

I will work out a fix for emacs and send it to the FSF.  This
dynamic linker workaround is still worthwhile, if only to avoid
forcing all emacs users to build a new version.

Note: xemacs gives a bogus warning at startup, for related reasons.
The warning is harmless and can safely be ignored.  I will send a
patch to the xemacs maintainers to get rid of it, and meanwhile
add a patch file to our port.
1997-12-05 02:06:37 +00:00
Philippe Charnier
14d460e1b4 Use err(3). Add prototypes. Document that startup scripts are rc.i386 and
rc.conf (enable/disable) not rc.local.
Use full pathname in SYNOPSIS section.
1997-12-04 07:25:19 +00:00
Philippe Charnier
8cda9fcc0d Sort #includes. Add rcsid. Use full pathname in SYNOPSIS section. 1997-12-04 07:20:45 +00:00
Steve Price
59c780cdc1 FTP_INTERNAL_LS -> FTPD_INTERNAL_LS
Pointed out by:	Jaye Mathisen <mrcpu@cdsnet.net>
1997-12-04 03:58:02 +00:00
Philippe Charnier
a8faeabc96 Use full path in synopsis. Syslog will add trailing \n. 1997-12-03 07:19:58 +00:00
Philippe Charnier
5f806c3ccf Use err(3). Remove progname and trailing \n in syslog strings. 1997-12-03 07:16:08 +00:00
Philippe Charnier
a846453c5e Use err(3). Add protos for -Wall. 1997-12-02 12:33:42 +00:00
Philippe Charnier
a40772799f No \n in syslog() strings. Add man page to Xrefs. Change null byte to NUL byte. 1997-12-02 12:30:04 +00:00
Philippe Charnier
c7c2ef669a Do not terminate syslog() messages with a dot, as others daemons do. 1997-12-02 12:25:39 +00:00
Philippe Charnier
40150947c4 Document -n flag. Use err(3). Add usage.
Add syslog capability.
1997-12-02 12:20:17 +00:00
John Polstra
08bdd3d27d Get rid of the dynamic linker's internal malloc package, and arrange
things so that it uses the same malloc as is used by the program
being executed.  This has several advantages, the big one being
that you can now debug core dumps from dynamically linked programs
and get useful information out of them.  Until now, that didn't
work.  The internal malloc package placed the tables describing
the loaded shared libraries in a mapped region of high memory that
was not written to core files.  Thus the debugger had no way of
determining what was loaded where in memory.  Now that the dynamic
linker uses the application's malloc package (normally, but not
necessarily, the system malloc), its tables end up in the regular
heap area where they will be included in core dumps.  The debugger
now works very well indeed, thank you very much.

Also ...

Bring the program a little closer to conformance with style(9).
There is still a long way to go.

Add minimal const correctness changes to get rid of compiler warnings
caused by the recent const changes in <dlfcn.h> and <link.h>.

Improve performance by eliminating redundant calculations of symbols'
hash values.
1997-11-29 03:32:48 +00:00
Philippe Charnier
622058ebd0 Use err(3). -Wall cleaning. cosmetics in man page. 1997-11-26 07:36:51 +00:00
Philippe Charnier
754c3c574d Remove \n at end of syslog string. -Wall cleaning. Cosmetics in man page. 1997-11-26 07:34:56 +00:00
Philippe Charnier
9ce3627ba1 Cosmetics in man page. Add rcsid and sort #includes. 1997-11-26 07:31:14 +00:00
Philippe Charnier
6896720af3 Use err(3). -Wall cleaning. Use Pa for file names and add section in Xrefs. 1997-11-26 07:29:04 +00:00
Philippe Charnier
943eade9ed Sort #includes. Add rcsid. Add man page section in .Xrefs. 1997-11-25 07:17:15 +00:00
Philippe Charnier
3029b69f0b Use warn(3). Hardcode progname instead of using argv[0]. Use Pa for file
name.
1997-11-25 07:14:34 +00:00
Philippe Charnier
eb0b829002 Add usage(), rcsids. 1997-11-24 07:33:42 +00:00
Philippe Charnier
ad17ca10b7 Cosmetics in usage() and man page. 1997-11-24 07:31:31 +00:00
Philippe Charnier
7d70b772c1 Key is 8 bytes according to code, not 10 as stated in man page. Add rcsid. 1997-11-24 07:29:12 +00:00
Philippe Charnier
d6bf9eb7bb Use err(3) instead of local redefinition. Add usage. -Wall cleaning. 1997-11-24 07:27:06 +00:00
Philippe Charnier
d748864d2c Correct incompletes .Xrs. Remove duplicate #includes and unused variables. 1997-11-21 07:43:53 +00:00
Philippe Charnier
692727e680 Use err(3). -Wall cleaning. 1997-11-21 07:40:48 +00:00
Philippe Charnier
e02897fa5b Cosmetics in man page. Exit(-1) -> exit(1). 1997-11-21 07:38:43 +00:00
Philippe Charnier
74b634ac40 Add const to copyright string. Put sccsid under #if 0/#endif control. 1997-11-20 07:26:04 +00:00
Philippe Charnier
55033a6f9f Use err(3). exit(-1) -> exit(1). 1997-11-20 07:23:44 +00:00
Philippe Charnier
864b6b6e0a Cosmetic in error strings. Sort Xrefs. Add usage (with syslog capability). 1997-11-20 07:21:55 +00:00
Sean Eric Fagan
c6633e1b9f Log the request from the remote side, in addition to it having happened.
Reviewed by:	julian
1997-11-14 04:39:38 +00:00
Alexander Langer
1dd902ff4b Switch the effective uid to that of the user when writing mail files,
allowing quotas to be enforced on mail spools.

PR:             1111
Submitted by:   Charles Henrich <henrich@crh.cl.msu.edu>
1997-11-13 23:14:34 +00:00
Wolfram Schneider
77a87957c8 Store temporary files in /var/tmp instead /tmp. This should avoid
a possible disk overflow for enormous large mails.
Submitted by:	grog
1997-10-11 22:05:44 +00:00
Frank Durda IV
f05011e686 PR: bin/771 and bin/1037 are resolved by this change
This change changes the default handling of linemode so that older and/or
stupider telnet clients can still get wakeup characters like <ESC> and
<CTRL>D to work correctly multiple times on the same line, as in csh
"set filec" operations.   It also causes CR and LF characters to be read by
apps in certain terminal modes consistently, as opposed to returning
CR sometimes and LF sometimes, which broke existing apps.  The change
was shown to fix the problem demonstrated in the FreeBSD telnet client,
along with the telnet client in Solaris, SCO, Windows '95 & NT, DEC OSF,
NCSA, and others.

A similar change will be incorporated in the crypto version of telnetd.

This resolves bin/771 and bin/1037.
1997-10-08 03:10:32 +00:00
Warner Losh
20271f308f Clarify the actions of -s and the list of allowable names. 1997-10-06 16:28:47 +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
Bill Paul
23677e98fe Putting records with zero-length keys into a Berkeley DB hash database
is asking for trouble (sequential database enumerations can get caught
in an infinite loop). The yp_mkdb(8) utility avoids putting such records
into a database, but ypxfr does not. Today I got bit by a NULL entry in
one of the amd maps on my network, which is served by a SunOS master.
The map was transfered successfully to my FreeBSD slave, but attempting
to dump it with ypcat(1) caused ypserv(8) to transmit the same record
over and over again, making the map appear to be infinitely large. I
finally noticed the problem while testing a new version of amd under
development at the Columbia CS department, which began gobbling up insane
amounts of memory while trying to swallow the map.

To deal with this problem, I'm modifying ypxfr to watch for records
with zero-length keys and turn them into something less destructive
before writing them to the database.
1997-09-30 18:08:11 +00:00
Mark Murray
1ba18872f4 Changes for KTH KerberosIV. 1997-09-28 09:07:34 +00:00
Mark Murray
8aeaa47e80 There is a clear separation of the crypto telnet and the non-crypto telnet.
As this is the non-crypto version, remove the useless (commented out)
directives and macros.
1997-09-28 08:40:54 +00:00
Mark Murray
0934db4674 Changes for the new KTH Kerberos4.
Also make -Wall a bit quieter
1997-09-28 08:38:04 +00:00
Mark Murray
e7509c75f5 Changes for the new KTH Kerberos.
Also make -Wall a bit quieter.
1997-09-28 08:36:04 +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
Andrey A. Chernov
fe38e2f8f4 Allow backspace too 1997-09-15 00:42:04 +00:00
Andrey A. Chernov
4541df7be4 disable upper controls and enable all other
8bit codes due to lack of locale knowledge in daemon
1997-09-15 00:27:49 +00:00
Wolfram Schneider
d6940a479f -p flag misdocumented in telnetd(8)
PR: 4462
Submitted by:  hfir@math.rochester.edu
1997-09-14 18:25:19 +00:00
Wolfram Schneider
f6b31571f6 spelling corrections.
PR: docs/4450
Submitted by: josh@quick.net
1997-09-13 16:01:53 +00:00
Dima Ruban
8fad2d7e99 Do setlogin() before changing uid/gid, since
`at/batch' requires this.

Obtained from: me && OpenBSD
1997-09-08 23:39:48 +00:00
Thomas Gellekum
986a117274 Hopefully better fix for logwtmp(): rename to a private
version ftpd_logwtmp().
1997-09-05 11:44:00 +00:00
Thomas Gellekum
b11f88b09a logwtmp() prototype is in <libutil.h>. 1997-09-05 11:17:22 +00:00
David Nugent
1cc1582825 Fix botch with escaped characters, go back to using cgetstr().
For escaped characters used in modem strings, use double-backslashes
in gettytab.
PR: 4370
1997-09-03 01:05:36 +00:00
David Nugent
b92f6bd2b8 Use cgetustr() since we handled special escapes ourselves.
Fix typo in escape parsing function.
PR: 4370
Submitted by: sumii@is.s.u-tokyo.ac.jp
1997-09-01 10:06:05 +00:00
Joerg Wunsch
71c971334b Fix description of -t option.
PR:		3382
Submitted by:	furuta@sra.co.jp (Atsushi Furuta)
1997-08-24 18:21:34 +00:00
Steve Price
eb1ca88d07 Turn off hyphenation in this manpage so that .Xr macros, don't get
split between lines.

PR:		bin/4080
1997-08-23 16:22:30 +00:00
John-Mark Gurney
82681653a4 change -I/sys to -I${.CURDIR}/../../sys 1997-08-22 14:00:57 +00:00
Nate Williams
39f2a9e2db - In dlsym(), if the lookup fails using the original symbol, prepend an
underscore and try looking it up again.  This is a non-issue if we
  switch to ELF.

Reviewed by:	sef, jdp
1997-08-19 23:33:45 +00:00
Steve Price
f000d0afab .Nm --> .Xr so that gettytab(5) is shown instead of gettytab 5.
PR:		bin/4079
1997-08-17 16:36:41 +00:00
Bruce Evans
0e52df1255 Makefile.dist is a non-bmaked version of Makefile. We don't want it. 1997-08-02 18:52:16 +00:00
Bruce Evans
75d986c2a6 This commit was generated by cvs2svn to compensate for changes in r27847,
which included commits to RCS files with non-trunk default branches.
1997-08-02 18:46:42 +00:00
Bruce Evans
9c60775004 Import Lite2's src/libexec, except for makekey (which was spammed
by a repository copy from 1.1.5 and patched back to Lite1) and
rbootd/bootdir/SYSHPBSD (which is binary).  All changed files have
already left the vendor branch.
1997-08-02 18:46:42 +00:00
John Polstra
7e7344e2f4 Implement dlsym(RTLD_NEXT, symbol). 1997-08-02 04:56:44 +00:00
David Nugent
0512556a48 Make useage of hostname global variable consistent.
PR: 4135
Based on submitted patch by:	 blank@fox.uni-trier.de
1997-07-24 09:26:12 +00:00
Wolfram Schneider
506a9d513c Rshd print to much information if a user does not exists. 1997-07-18 21:04:19 +00:00
Peter Wemm
65b3003d2d kill the undead 1997-07-13 14:26:00 +00:00
Peter Wemm
593718bea0 .if exists(../eBones) tests the obj dir, not the source dir's existance.
The existance of a stale obj dir does not imply the source too.
1997-07-05 14:22:15 +00:00
Steve Price
11fe7d5e79 Zap register keyword usage and convert: bcopy -> memmove, bzero -> memset,
index -> strchr, and rindex -> strrchr.
1997-06-29 19:50:26 +00:00
Steve Price
5c8709fd6d Merge conflicts and make this compile -Wall clean. 1997-06-29 19:00:29 +00:00
Steve Price
6bc912a9a4 This commit was generated by cvs2svn to compensate for changes in r27074,
which included commits to RCS files with non-trunk default branches.
1997-06-29 18:50:34 +00:00
Steve Price
0559b33149 Import of NetBSD's rbootd version 19970629 1997-06-29 18:50:34 +00:00
Alexander Langer
b84136c8f6 Removed unused variables. 1997-06-27 21:51:59 +00:00
Gene Stark
8b9715c239 Submitted by: Gene Stark and Robert Sexton (robert@kudra.com)
Added patches from Robert Sexton to eliminate case sensitivity of the
xtend command.
1997-06-24 03:52:15 +00:00
Steve Price
681e5e7a09 Show the real revision date and not the date that this
manpage is being viewed.
1997-06-23 04:03:49 +00:00
David Nugent
85f5c8500d Reset alarm before invoking ppplogin.
PR: 3733
Reviewed by:
Submitted by: kfurge@worldnet.att.net
Obtained from:
1997-06-03 12:56:47 +00:00
David Nugent
6bdca427d7 login.group => login.conf.
PR: 3748
Reviewed by:
Submitted by:
Obtained from:
1997-06-02 21:03:20 +00:00
Masafumi Max NAKANE
d5fb0dffb4 Typo fix.
PR:		3693
Submitted by:	Kazuo Horikawa <k-horik@yk.rim.or.jp>
1997-05-27 13:46:40 +00:00
Daniel O'Callaghan
3401a71f4e Tell the chroot()ed user that "access restrictions apply". 1997-05-21 23:24:41 +00:00
Bill Paul
48d26cf410 Small tweak to the group parsing code to stop it from core dumping
on malformed /etc/group entries. This is a band-aid until I can pull
in the newer group parsing code from getgrent .

Pointed out by: branson@belmakor.hq.ferg.com (Branson Matheson)
1997-05-21 15:10:42 +00:00
Doug Rabson
3c0a9567e5 Changes to support the kernel linker:
Add a -Bforcedynamic option which generates a dynamic object even
	if no shared libraries were given in the link.

	Make RRS in text section warnings conditional on "-assert pure-text"
	so that I can link non-PIC kernel modules without tons of link
	errors.  Changes to bsd.lib.mk to follow.

	Fix a couple of bugs exposed by the fact that the kernel is not
	linked at zero.

Reviewed by:	jdp
1997-05-13 10:23:47 +00:00
Poul-Henning Kamp
798c69cd78 Don't rely on stderr to report bad news. 1997-05-11 14:27:03 +00:00
David Nugent
04a59e678a Fix memory leak caused by not freeing memory returned by cgetstr()
calls. The cost is a little more up-front memory allocation, but the
effect seems minimal.

Problem noticed-by: bde

Added syslog at LOG_ERR when referencing an unknown gettytab entry
and for other cgetent() failues (circular reference et al).

To be merged into 2.2 after a few days testing.
1997-05-11 10:25:38 +00:00
David Nugent
5d0bfe39ec login_getclass() -> login_getpwclass(). 1997-05-10 19:02:03 +00:00
John Polstra
aafb797228 Fix a bug that caused the relocs for linker set members in shared
libraries to come out as 1-byte relocations instead of 4-byte
relocations.

Submitted by:	Doug Rabson <dfr@nlsystems.com>
1997-04-30 05:18:08 +00:00
David Nugent
ea4e54b942 Adds anon ftp virtual host capability to ftpd, using /etc/ftphosts for
definition of a system's virtual hosts.
1997-04-29 12:42:08 +00:00
David Nugent
31fea7b8f2 YAMF2.2: Allow @group entries in /etc/ftpusers & /etc/ftpchroot to deny
and allow chroot access to entire groups.
1997-04-27 08:29:21 +00:00
David Nugent
334ab9fdd0 Document internal ls, how to compile it in and what it changes wrt
anon ftp and chrooted users.
1997-04-26 12:23:51 +00:00
David Nugent
af85d782fd Adds optional "internal ls" support for ftpd, by collecting
modules from src/bin/ls, and handling exec(_PATH_LS,..) as a
special case, very useful in an environment where many users
are given chroot access. "~/etc/{s}pwd.db" files are still
needed if uid/gid->user/group translation is desired.

To enable this it must be compiled with the make variable
FTP_INTERNAL_LS defined, either in /etc/make.conf or the
environment.
1997-04-26 12:12:10 +00:00
David Nugent
b071c689de Add basic login.conf (sans authentication) support. 1997-04-23 04:56:39 +00:00
David Nugent
80b3b7342f Added login.conf support. 1997-04-23 03:06:47 +00:00
Bruce Evans
9453d60b10 Fixed `make depend' and related bogons. LDFLAGS was used for
ld-specific flags.  LDFLAGS is really for ld-related flags for cc,
not for ld, and some flags, e.g., -Bshareable, mean completely
different things to cc and ld.  Having the wrong things in LDFLAGS
also broke the standard ${PROG} target.  This was kludged around
by using a special rule that depended on LDFLAGS being bogus.
Fixing `make depend' broke the special rule but fixed the standard
rule (except in the DESTDIR case, which was handled more strictly
here than elsewhere).
1997-04-16 11:31:32 +00:00
David Nugent
d95f252dfe Remove text about unsupported flags 'mdmbuf', 'local', 'crtscts' etc
that are in reality handled in gettytab.

Document the new 'dialin' and 'network' tty flags.
1997-04-13 21:29:50 +00:00
David Nugent
c4c1e98233 Submitted by: Philippe Charnier <charnier@xp11.frmug.org>
Fixes name size limitation (was hardcoded to 8).
Closes PR#3258
1997-04-12 01:04:50 +00:00
Mike Pritchard
eac60dd633 Ensure that the remote host name is Nul terminated.
Closes PR# 2589.
1997-04-08 20:36:36 +00:00
David Nugent
cbd13fcada Fix for expiration date test. Closes PR#3224. 1997-04-08 12:32:17 +00:00
Joerg Wunsch
758a95b7aa Use MAXHOSTNAMELEN, as opposed to an arbitrary number, and ensure
correct termination if it overflows.

Closes PR # misc/2982.

Submitted by:	Drew Derbyshire <ahd@kew.com>
1997-04-01 20:39:59 +00:00
Peter Wemm
f0ccf9018b Be a bit more careful about what port number we are using for the
second socket.  If we're going to check for reserved ports, we should
do it properly.
1997-03-29 12:35:06 +00:00
Warner Losh
91477cc4d7 compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-28 15:48:21 +00:00
David Nugent
ce862ff5d3 Don't trucate username to 8 characters. 1997-03-25 09:52:38 +00:00
Mike Pritchard
42946c8261 Remove some incorrect text on how passwords are validated.
Closes PR# 3050.

Submitted by:	 Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>
1997-03-25 03:45:52 +00:00
Warner Losh
fca08b7cfa Fix non explloitable buffer overflows (since the largest packet processed
precludes it) to keep people from whining about it in the newsgroups and
mailing lists.
1997-03-24 06:04:08 +00:00
Warner Losh
0f5e6a0d00 Fix various buffer overflows that may or may not be exploitable.
Fixes PR 2588

Reviewed by:	Dan Cross?
Submitted by:	Julian Assange
1997-03-24 06:01:39 +00:00
Warner Losh
a51e2c9b04 Julian A's fix. Do chdir as user rather than as root. Fixes a minor NFS
compatibility problem at the same time.  Some buffer made large enough
for worst case hostname.

fixes PR 2593.

Reviewed by:	Dan Cross and maybe others
1997-03-24 05:57:28 +00:00