Commit Graph

1458 Commits

Author SHA1 Message Date
peter
7368638dde Revert last change. ../rtld.c uses CACHE_LINE_SIZE too.
Change it to 64 while here.

Reported by:  ps
2003-12-11 18:42:51 +00:00
peter
e87d087aa1 Only define CACHE_LINE_SIZE in one place.. 2003-12-11 04:49:37 +00:00
peter
20d7a03f75 CACHE_LINE_SIZE is 64 on athlon and amd64 chips, not 32. This should
probably be 128 since that is what the hardware prefetch fill size is
on both the p3, p4 and athlon* cpus.
2003-12-11 04:47:53 +00:00
sobomax
dced91d8f3 Fix a bug which causes wrong filename being written into the syslog
in the case when client sends request with RFC2347 options.

Approved by:	re
MFC After:	2 weeks
2003-11-20 13:36:31 +00:00
harti
91fb8e3f9c Replace all uses of the old netgraph constants NG_*LEN by the new
constants NG_*SIZ that include the trailing NUL byte. This change
is mostly mechanical except for the replacement of a couple of snprintf()
and sprintf() calls with strlcpy.
2003-11-15 15:26:35 +00:00
yar
759577e793 If a file to send in ASCII mode already has CRLF as end-of-line,
don't add excessive CR on the wire.

PR:		bin/59285
Submitted by:	Andrey Beresovsky <and at rsu.ru>
MFC after:	1 week
2003-11-15 11:08:26 +00:00
tobez
0105a2bc6c Sync comment with code's reality.
MFC after:	1 week
2003-11-14 12:56:56 +00:00
peter
b35f301d40 Tidy up some xdrproc_t related warnings. 2003-10-26 04:32:53 +00:00
peter
9e4da6dd3b Pacify gcc warning with a Douglas Adams reference. 2003-10-26 04:30:05 +00:00
tjr
971569170c Make the warning message stand out more. 2003-10-11 07:37:55 +00:00
tjr
20b1e12f1f Warn users that makekey may disappear in a future release now that the
last in-tree consumer has gone.
2003-10-09 10:06:30 +00:00
tjr
e6d1ceacac Use the new style struct sockaddr instead of osockaddr in system calls
so that talkd works without COMPAT_43.

Obtained from:	NetBSD (christos), Rumi Szabolcs
2003-09-28 09:16:09 +00:00
ume
d25cb60913 Don't depend on IPv4-mapped IPv6 address to bind to both IPv4
and IPv6.

Wrote at:	Hakone.
Powered by:	Warner Losh's scotch whisky.
Requested by:	nork
2003-09-14 16:42:46 +00:00
mdodd
2641112114 Retire the WITH_LIBMAP compile knob; libmap is now a standard feature. 2003-09-13 21:50:36 +00:00
mdodd
df4cd81882 Change libmap.c:lm_init() to return a status value; 0 for success
(libmap available) and 1 for failure.  Assign this return to the
global 'libmap_disable' variable in rtld.c.

This totally prevents any libmap functions from being called after
lm_init() if no config file is present.
2003-09-13 21:43:08 +00:00
obrien
507c61e256 Deal with the LOGIN_NAME_MAX issue in the NetBSD->FreeBSD
translation^H^H^Hhack layer.
2003-09-11 03:28:21 +00:00
obrien
d98e23fbe8 Add a dependancy on 'nbsd2fbsd.h' 2003-09-10 19:03:48 +00:00
ru
1c23ef339b mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +00:00
kan
80babb4e26 Eliminate last three uses of varargs.h in the tree. These three files
were including varargs.h file but did not use any of its macros,
so they escaped the clean-up before.
2003-09-01 04:12:18 +00:00
ceri
d4a07597ca Add a note that the -u option can be overridden by settings in login.conf(5).
PR:		docs/56017
Submitted by:	Josef El-Rayes <j.el-rayes@daemon.li>
2003-08-31 07:45:48 +00:00
obrien
fb9845a19e Remove a useless '/'. 2003-08-24 17:35:52 +00:00
imp
6ff48acf08 Very minor style nit: sort include files alphabetically. 2003-08-22 02:22:59 +00:00
gordon
6d7920ab73 Forgot one instance of ld-elf.so.1. Convert to ${PROG}
Pointed out by:	obrien
2003-08-17 22:12:26 +00:00
gordon
bda0840bfc Don't forget to honor DESTDIR. Also switch over to using PROG instead of
the binary name directly.
2003-08-17 18:59:30 +00:00
gordon
649bbcf5e8 Don't forget to chflags noschg the existing binary so we can symlink
over it safely.

Pointed out by:	yosimoto@waishi.jp
2003-08-17 18:50:56 +00:00
gordon
1d5cce0fc0 As long threatened, stage 2 of making a dynamically-linked root a reality.
Install rtld into /libexec.
2003-08-17 08:06:00 +00:00
gordon
9c31ae1833 Prepend /lib to the builtin library search path in rtld. 2003-08-17 07:55:17 +00:00
markm
c26205b553 Make sure that a "make release" (more accurately the bit that makes
the crunched binary) get a non-cryptographic telnet. This is overkill
in that it covers stuff that is not normally used in a crunched binary.
2003-07-24 17:19:15 +00:00
markm
c0c9eb00ee Ensure that for the cryptographic instances of *telnet*, the "crypto"
distribution is used. This only affects release-building.
2003-07-24 07:19:55 +00:00
markm
284105499b Test correct macro for "without crypto" option(s). 2003-07-20 23:29:46 +00:00
yar
cd9f8ef58b Prototype defttymode() instead of just declaring it. 2003-07-18 16:25:55 +00:00
markm
d6aec2b6d6 Very big makeover in the way telnet, telnetd and libtelnet are built.
Previously, there were two copies of telnet; a non-crypto version
that lived in the usual places, and a crypto version that lived in
crypto/telnet/. The latter was built in a broken manner somewhat akin
to other "contribified" sources. This meant that there were 4 telnets
competing with each other at build time - KerberosIV, Kerberos5,
plain-old-secure and base. KerberosIV is no longer in the running, but
the other three took it in turns to jump all over each other during a
"make buildworld".

As the crypto issue has been clarified, and crypto _calls_ are not
a problem, crypto/telnet has been repo-copied to contrib/telnet,
and with this commit, all telnets are now "contribified". The contrib
path was chosen to not destroy history in the repository, and differs
from other contrib/ entries in that it may be worked on as "normal"
BSD code. There is no dangerous crypto in these sources, only a
very weak system less strong than enigma(1).

Kerberos5 telnet and Secure telnet are now selected by using the usual
macros in /etc/make.conf, and the build process is unsurprising and
less treacherous.
2003-07-16 20:59:15 +00:00
yar
beedaf29a1 Block SIGURG while reading from the control channel.
Rationale:

SIGURG is configured by ftpd to interrupt system calls, which is useful
during data transfers.  However, SIGURG could interrupt I/O on the
control channel as well, which was mistaken for the end of the session.

A practical example could be aborting the download of a tiny file,
when the abort sequence reached ftpd after ftpd had passed the file
data to the system and returned to its command loop.

Reported by:	ceri
MFC after:	1 week
2003-07-09 13:54:33 +00:00
yar
94167f7347 Improve error handling in getline():
- always check the return value from getc(3) for EOF;
- if the attempt to read the TELNET command byte has
  returned EOF, exit from the loop instead of using
  the EOF value as a normal character.

MFC after:	1 week
2003-07-09 13:15:32 +00:00
yar
72eaf383f4 Make a malloced copy of "chrootdir" even if it points to an absolute
pathname inside "residue" so "chrootdir" can be simply freed later.

PR:		bin/53435
Submitted by:	Yutaka Ishihara <yutaka at fandc.co.jp>
MFC after:	1 week
2003-07-09 12:46:24 +00:00
gshapiro
e95dd66c1f Remove MAINTAINER= lines from individual Makefiles in favor of the
MAINTAINER file (which already had entries for sendmail).
2003-07-07 03:54:04 +00:00
jake
151e14e2da Avoid using the global offset table to get the address of _DYNAMIC in
rtld.  When _DYNAMIC is referenced normally from C the global offset
table is used implicitly, but newer versions of binutils don't initialize
it statically in the binary, so this doesn't work until rtld is relocated,
which _DYNAMIC is needed for...  So, as on other systems with the same
problem, we disassemble a call instruction to _DYNAMIC in order to get
its address.
2003-07-04 00:05:15 +00:00
yar
3b7c9bf6da Don't declare unneeded extern variables,
leave alone specifying a wrong type for one of them.
2003-06-21 10:45:38 +00:00
mdodd
51b79512bb Fix warnings on 64 bit platforms.
Noticed by:	 jake
2003-06-19 16:09:18 +00:00
mdodd
9e70570ef3 Add function prototypes. 2003-06-19 05:28:26 +00:00
mdodd
ddf3836c5b LD_DUMP_REL_PRE and LD_DUMP_REL_POST don't output to stderr; don't
claim that they do.
2003-06-19 04:34:09 +00:00
mdodd
ca4dc26350 Provide a mechanism for dumping relocation information.
Setting the LD_DUMP_REL_PRE or LD_DUMP_REL_POST environment variables
cause rtld-elf to output a table of all relocations.

This is useful for debugging.
2003-06-19 03:55:38 +00:00
mdodd
5a91e1d61c Move MD function prototypes together. 2003-06-19 02:42:04 +00:00
mdodd
891d6a9a98 Fix warnings; no parameters in function prototypes. 2003-06-19 02:39:37 +00:00
mdodd
af80699b54 Avoid a NULL pointer dereference. 2003-06-18 16:17:13 +00:00
yar
7673764aa8 - Use the initial terminal mode instead of the current mode
as the source of defaults for terminal device parameters.

- Do duplucate code reduction and simplification enabled by
  the above.

Reviewed by:	green
MFC after:	1 month
2003-06-18 13:22:44 +00:00
mdodd
39e51d22ff Include libmap.h for prototypes. 2003-06-18 05:31:08 +00:00
mdodd
b466954d4e - Add support for DT_FLAGS.
- Define various things from the most recent ELF spec.
2003-06-18 03:34:29 +00:00
dougb
0f32441f35 More correctly spell "-static" as "NOSHARED?=YES" 2003-06-17 20:07:49 +00:00
yar
aa7c2defa2 Improve the manpage language a bit.
A PPP login program is started _automatically_ (i.e., without
human intervention) even with the "pl" capability unset, as soon
as a PPP frame is detected.  But with "pl" set, a PPP login program
is started independently of the result of PPP detection (which is
rendered unnecessary then,) i.e. _unconditionally_.
2003-06-17 12:29:36 +00:00
dougb
9d0a07cbbd Link named-xfer -static. This is the only binary that needs to be
statically compiled for named to work chroot'ed, and we'd like
to be able to do that from /etc/rc.d without additional user
intervention.
2003-06-17 08:53:27 +00:00
yar
478d73b235 If ftpd is run with an -h option (hide host-specific info,)
don't reveal the info in reply to the SYST command.

Get rid of using the "unix" macro at the same time.  It was a rather
poor way to check if the system was Unix since there were quite a
few Unix clones out there whose cc didn't define "unix" (e.g.,
NetBSD.)  It was also sensitive to the C standard used, which caused
unnecessary trouble:  With -std=c99, it should have been "__unix__",
and so on.

PR:		bin/50690
Submitted by:	Alex Semenyaka <alexs _at_ snark.ratmir.ru>
MFC after:	1 week
2003-06-16 11:30:23 +00:00
jmg
80728f5713 fix a couple typos in the comments
From NetBSD's bootpd (in src/usr.sbin/bootp)
2003-06-15 03:08:37 +00:00
jmg
215585360b fix bootpd to use fd_set. For some reason on Sparc, using int with
select is broken.
2003-06-15 03:05:14 +00:00
obrien
7ea86c6d90 Remove MAINTAINER lines. 2003-06-14 19:32:52 +00:00
green
d4b26c1142 In the last clean-up of this code, the fact that the default tty mode
information could only be gleaned from the the tty descriptor itself
was neglected, so never did the tty's default settings get copied from
the kernel.  Specifically, this caused all manner of ctrl-keys to not
work.  Fix this by calling dogettytab() in all the proper places, and
retrieving the terminfo temporarily in dogettytab().
2003-06-14 08:26:47 +00:00
yar
957fe1b56f Read gettytab(5) soon enough to fill in all necessary values.
Re-read gettytab(5) only if needed.

This fixes bugs introduced as long ago as in getty/main.c rev.1.15.

PR:		bin/18181
MFC after:	1 month
2003-06-10 18:30:41 +00:00
yar
e46b9f99ca Spot one more place where boolean variables were incremented
instead of just being assigned a truth value.
2003-06-10 16:34:03 +00:00
yar
151ea28b4a Coding style fix: Use "foo = 1" instead of "foo++" to assign
the truth value to a boolean variable, especially when inside
a loop.  The variable can overflow otherwise, at least in theory.
2003-06-10 15:38:35 +00:00
yar
1e04cff15e Break sentences.
MFC after:	1 week
2003-06-10 15:03:35 +00:00
yar
e02d96106b General mdoc(7) markup fixes:
- Use .Va, not .Em, to mark up variable-like identifiers
  (capability and database entry names.)
- Stop abusing .Tn (trademark) to emphasize general phrases.
- Spot unmarked capability references.
- Add a missing line break.

Discussed with:	ru
MFC after:	1 week
2003-06-10 14:46:43 +00:00
yar
e23db6df64 Improve the language and markup of the description of the pp and pl
capabilities:

- Mark up capability identifiers.
- Don't squeeze much text into the capability table given the options
  will be described below in detail.
- Keep the capability table sorted.
- Use a consistent term for a PPP login program.

MFC after:	1 week
2003-06-10 14:20:38 +00:00
charnier
eeb46390af Add section number to .Xr 2003-06-08 12:40:50 +00:00
charnier
04bdd1fc48 The .Xr utility 2003-06-08 12:38:18 +00:00
marcel
f5de8effa1 Don't fail if we encounter a relocation of type "none". Just ignore
it. It's a no-op relocation.

Trigger case: ports/x11-toolkits/pango
2003-06-07 07:52:17 +00:00
yar
ed74f4db3d Fix some minor bugs, namely:
- Initialize "rval", which would be used uninitialized
  if al or pl options were set.

- Don't pass an empty string to login(1) as a user name
  (this could be triggered by entering a name and then killing it
  with backspace or ^U.)

- Don't loop endlessly if the al option specifies a bogus (i.e.,
  not alphanumeric) auto-login name.

- Don't pass a bogus user name to login(1) if a good name were
  entered and then killed with ^U.

- Exit with status 0, not 1, on receiving an EOF character,
  since it's not a error condition.

MFC after:	1 week
2003-06-06 14:36:41 +00:00
markm
96556bceb3 Drop MAINTAINER Bit. Not needed any more. 2003-06-04 15:59:13 +00:00
obrien
1646a714c5 Set CSTD to gnu99. We can only use on of the gnu?9 C languages.
We can't use c89 due to use of 'inline', and c99 produces bad code.
2003-06-04 05:42:04 +00:00
ru
29f9643911 Assorted mdoc(7) fixes. 2003-06-02 15:02:06 +00:00
obrien
e6934e172e Best we can do with this is c89. 2003-06-02 02:35:58 +00:00
obrien
60184b4b7e Include stdlib.h to get exit()'s prototype. 2003-06-02 02:35:18 +00:00
obrien
f40f81aa0c Add the variable's type to the declaration. 2003-06-02 02:34:36 +00:00
ru
d727dda421 Assorted mdoc(7) fixes. 2003-06-01 19:52:36 +00:00
mdodd
73a7f529f4 - use issetugid()
- be paranoid about honoring LD_LIBMAP_DISABLE.

Suggested by:	 rwatson
2003-05-31 15:24:29 +00:00
mdodd
49fb693df9 Simplify map_object() by breaking out the ELF header validation bits
into a separate function.
2003-05-31 14:48:59 +00:00
mdodd
59d2c4e02e Provide function entry debugging messages. 2003-05-31 14:46:38 +00:00
mdodd
f365a266e1 Use the environment variable LD_LIBMAP_DISABLE to disable
libmap.conf(5) functionality.
2003-05-31 14:45:11 +00:00
mdodd
de8f54e71e Don't post-increment pointers inside a loop conditional.
While I'm here:
- Let lm_add() call strdup() on its own behalf.
- Use a temporary pointer when parsing constraints; only set the
  constraint pointer on a totally successful match.

PR:		 bin/52783
Submitted by:	 David P. Reese Jr. <daver@gomerbud.com>
Approved by:	 re (rwatson)
2003-05-30 00:49:16 +00:00
kan
949c40c5fd Allow threading libraries to register their own locking
implementation in case default one provided by rtld is
not suitable.

Consolidate various identical MD lock implementation into
a single file using appropriate machine/atomic.h.

Approved by:	re (scottl)
2003-05-29 22:58:26 +00:00
peter
469c0a1ad7 Do not exclude amd64 from rtld-elf builds.
Approved by:  re  (safe amd64 support commits)
2003-05-24 17:38:45 +00:00
peter
0c9262fefa Initial pass at supporting shared libraries on amd64. There are still
a few missing relocation types in amd64/reloc.c, but I have not found
any of them in use yet. :-)

Approved by:  re (amd64/* blanket)
2003-05-24 17:37:51 +00:00
des
e5d2d778eb Retire the useless NOSECURE knob.
Approved by:	re (scottl)
2003-05-19 15:52:01 +00:00
mdodd
221bfcf450 - Use xmalloc() and xstrdup() instead of malloc() and strdup().
- Add a global mapping if we have a successful constrained match.

Approved by:	re
2003-05-19 07:10:12 +00:00
rwatson
320fc630d4 Since libmap.conf is referenced in rtld.1, include it in the references
section.

Approved by:	re (scottl)
2003-05-17 19:46:49 +00:00
ru
d51b17e639 mdoc(7) police: Properly markup the previous revision.
Approved by:	re (blanket)
2003-05-16 21:36:10 +00:00
ru
d09772e6f4 mdoc(7) police: Normalize the FILES section.
Approved by:	re (blanket)
2003-05-16 21:34:21 +00:00
markm
64cd7ea15d Allow a NOPIC "make world" to complete.
OK'ed by:	re(scottl)
2003-05-11 18:48:29 +00:00
markm
fc4822f39a Mrege from crypto telnet with "make unifdef". This gets a bunch of
$FreeBSD$ tags and some debug variable safety belts.
2003-05-11 18:27:49 +00:00
peter
10cba42d09 Exclude rtld-elf for amd64. More porting is still needed.
Approved by:  re (scottl)
2003-05-08 06:37:12 +00:00
kan
c47ebbd98f Rethink the way we count module references. Simply following
DT_NEEDED links is not flexible enough for cases where dynamically
loaded modules form a dependency cycle.

This should fix an infinite recursion problem encountered by Yahoo.

Approved by:	re (jhb)
2003-05-08 01:31:36 +00:00
markm
ee63e7dc15 Turn MAKE_KERBEROS5 into NO_KERBEROS by negating the logic. Some extra
cleanups were necessary in release/Makefile, and the tinderbox code
was syntax checked, not run checked.
2003-05-05 07:58:44 +00:00
obrien
e6de895e83 Use __FBSDID vs. rcsid[]. 2003-05-04 00:59:13 +00:00
obrien
43ecc39077 Fix signed/unsigned comparison warnings. 2003-05-04 00:56:00 +00:00
obrien
bef29d279b Fix a sign/unsigned comparison. 2003-05-04 00:43:39 +00:00
ru
0deec148ba Build non-crypto telnet(1) and telnetd(8) if NO_OPENSSL is defined.
Submitted by:	Marius Strobl <marius@alchemy.franken.de>
2003-05-01 19:38:15 +00:00
peter
c03c53916e Remove 80386 bandaids from code repocopied from i386. rtld_start.S still
todo.
2003-04-30 21:09:06 +00:00
kan
75fd435e27 Remove redundant strlen checks, do not check the same
symbol twice.
2003-04-30 19:05:53 +00:00
ru
13592a9888 Don't clobber Kerberos5 telnet(1) and telnetd(8) with non-crypto versions. 2003-04-30 07:24:35 +00:00
imp
2bde9db9c2 Add back # accidentally deleted in 1.54 2003-04-27 06:16:52 +00:00
imp
733bde7ebe This is no longer needed after tw is gone.
Approved by: re@ (scottl)
2003-04-27 05:43:42 +00:00
billf
614e371cc3 properly refuse a connection in the -c case if the client ip's subdirectory
does not exist.

PR:		bin/38303
Submitted by:	Woei-Luen, Shyu <m8535@cn.ee.ccu.edu.tw>
the committed patch differs from the submitted one, any inaccuracies are mine.
2003-04-19 10:14:43 +00:00
mdodd
55f9c171d4 Code cleanups and sanity checking for config file parser. 2003-04-10 01:44:19 +00:00
mdodd
5ce5797f85 Dynamic object dependency mapping: libmap.
This is an optional feature, disabled by default.

This will be useful to people testing the various POSIX threading
libraries under -CURRENT but can easily serve other needs.
2003-04-07 16:21:26 +00:00
jmallett
eba71bcf69 MFp4 @27667: WARNS=5 cleanup on i386.
Remove the unused FILE\ *tf from print_mesg args, and the
    bogus passing in of an uninitialised FILE* for it.

    Call a timeval 'now' instead of 'clock' due to shadowing.

    Remove a nested localtime declaration.

    Make the delete invite argument match the ID type, u_int32_t.

    Use const for pointers to const items.

    Cast to long where printing as such.

    Include netinet/in.h for htonl/htons.

Reviewed by:	imp
2003-04-03 05:13:27 +00:00
ru
6b0e3863ff Mark bits that do not require an object directory as such. 2003-04-01 12:37:54 +00:00
silby
dc7f6e718f Update the description of the -u option to mention that IP_PORTRANGE_HIGH
and _DEFAULT are the same for 5.x.

Committed under threat of action from:	The mdoc police
2003-03-25 22:20:02 +00:00
dwmalone
a3529ba22b Clean up some warnings that don't result in a change in the object file:
Constness, missing prototypes, non-ansi prototypes, missing
initialisers, unnecessary declarations, shadowing.

Reviewed by:	md5
2003-03-20 22:42:22 +00:00
arun
59b094fe43 Fix for ia64/48024 - ensure function pointer equality across elf
objects.

Programs such as sshd depend on two pointers to the same function being
equal in a given process. However, the current ia64 implementation
ensures that they're equal when both the pointers are instantiated in
the same ELF object. The attached patch ensures that they're equal
irrespective of where they're instantiated.

Reviewed by marcel@ (mentor) and kan@
2003-03-19 21:38:27 +00:00
phk
f432014308 Run a revision of the devstat interface:
Kernel:

Change statistics to use the *uptime() timescale (ie: relative to
boottime) rather than the UTC aligned timescale.  This makes the
device statistics code oblivious to clock steps.

Change timestamps to bintime format, they are cheaper.

Remove the "busy_count", and replace it with two counter fields:
"start_count" and "end_count", which are updated in the down and
up paths respectively.  This removes the locking constraint on
devstat.

Add a timestamp argument to devstat_start_transaction(), this will
normally be a timestamp set by the *_bio() function in bp->bio_t0.
Use this field to calculate duration of I/O operations.

Add two timestamp arguments to devstat_end_transaction(), one is
the current time, a NULL pointer means "take timestamp yourself",
the other is the timestamp of when this transaction started (see
above).

Change calculation of busy_time to operate on "the salami principle":
Only when we are idle, which we can determine by the start+end
counts being identical, do we update the "busy_from" field in the
down path.  In the up path we accumulate the timeslice in busy_time
and update busy_from.

Change the byte_* and num_* fields into two arrays: bytes[] and
operations[].

Userland:

Change the misleading "busy_time" name to be called "snap_time" and
make the time long double since that is what most users need anyway,
fill it using clock_gettime(CLOCK_MONOTONIC) to put it on the same
timescale as the kernel fields.

Change devstat_compute_etime() to operate on struct bintime.

Remove the version 2 legacy interface: the change to bintime makes
compatibility far too expensive.

Fix a bug in systat's "vm" page where boot relative busy times would
be bogus.

Bump __FreeBSD_version to 500107

Review & Collaboration by:	ken
2003-03-15 21:59:06 +00:00
phk
fe4be9d4fc Update to current devstat API. 2003-03-15 21:04:50 +00:00
kan
74e308b959 Free obj->priv field in obj_free functions. This field is NULL
on all architectures except ia64, which uses it to keep function
description table.
2003-03-14 21:11:28 +00:00
kan
64afb9f4ca No need to zero fill memory, mmapped anonymously. Kernel will
return pre-zeroed pages itself.

Noticed by:     jake
2003-03-14 21:10:13 +00:00
ru
0dea541567 mdoc(7) police: Scheduled sweep. 2003-02-24 22:53:26 +00:00
ru
02bba10246 mdoc(7) police: expand contraction. 2003-02-23 01:45:51 +00:00
kan
80e27851f2 Do not remove object from the lists at the unref_dag() stage.
Introduce a new unlink_object() function and call it in
unload_object() instead. Removing the object in unref_dag() is
too early, rtld calls _fini() function after that and shared
objects might fail resolve their own symbols.
2003-02-17 20:58:27 +00:00
phk
b13e5a7950 Add #include <sys/resource.h> 2003-02-16 15:21:26 +00:00
phk
016baafb55 Remove <sys/dkstat.h> #include 2003-02-16 14:09:16 +00:00
phantom
2c40bad85c Advertize rtld(1) as ld.so(1) in manual pages world 2003-02-13 23:07:28 +00:00
kan
fc08397161 Fix a typo in rtld_dirname. 2003-02-13 22:47:41 +00:00
kan
ff89904c5f Implement dlinfo() function.
Introdice RTLD_SELF special handle and properly process it within
dlsym() and dlinfo() functions.

The intention is to improve our compatibility with Solaris and
to make a Java port easier.

Partially submitted by:	phantom
2003-02-13 17:47:44 +00:00
kan
3d24733b3f Add missing include files I forgot about in previous commit. 2003-02-13 17:35:00 +00:00
kan
debc727d4e Remove /usr/lib/elf from a default search path.
Move xprintf to malloc.c, it is only used there. Make static.

Submitted by:	phantom
2003-02-13 17:05:10 +00:00
yar
cd7b1c298a Kill unnecessary vertical whitespace. 2003-02-11 14:10:48 +00:00
yar
f6108273cb Use LOG_AUTHPRIV to hide the username attempted during an invalid login
from everyone but sysadmins.

PR:		bin/29487
MFC after:	3 days
2003-02-11 11:58:33 +00:00
kan
76b4e9c51c When unloading dependencies make sure they are removed from all the
associated lists:
   remove RTLD_GLOBAL objects from global objects list;
   remove the parent object from dldags list of its children.

Previosly we were doing that only to the top-level object OF the DAG
being unloaded and all its dependencies were ignored, leading to
mysterious crashes later.

Submitted by:	peter (partially)
2003-02-10 23:15:07 +00:00
charnier
6e45bdfe12 Add FBSDID. udp/bootps -> bootps/udp. Use err(3). 2003-02-05 13:45:25 +00:00
yar
5d11fbeaec Allow "~/" in pathnames to work for a chrooted user. 2003-02-05 11:11:32 +00:00
yar
92b68c7646 Let tilde expansion be done even if a file/directory doesn't exist yet.
This makes such natural commands as "MKD ~user/newdir" or "STOR ~/newfile"
do what they are supposed to instead of failing miserably with the
"File not found" error.

This involves a bit of code reorganization.  Namely, the code doing
glob(3) expansion has been separated to a function; a new function
has been introduced to do tilde expansion; the latter function is
invoked on a pathname before the former one.  Thus behaviour mimicing
that of the Bourne shell has been achieved.
2003-02-04 17:50:38 +00:00
yar
b1a2e9acb4 RFC 959 doesn't list reply code 550 as a valid responce to STOR/STOU,
so return reply code 553 to indicate a error from open(2) for consistency,
as long as the code is used in the rest of the STOR/STOU handler.
2003-02-04 03:33:25 +00:00
obrien
c3523316fa Add OPIE and PAM libs to the mix. 2003-02-02 21:11:15 +00:00
obrien
001be11d96 OPIE and PAM bits to agument LukeMftpd.
Submitted by:	mikeh (reworked by me)
2003-02-02 21:06:10 +00:00
yar
02d8e2b208 Let real users access special files through FTP
if allowed by their filesystem permissions.

This doesn't break anything since using sendfile(2)
is triggered later by a separate S_ISREG conditional.

PR:		bin/20824
MFC after:	1 week
2003-01-31 13:18:55 +00:00
yar
6962d02957 When searching for a unique file name in guniquefd(),
distinguish between the cases of an existing file and
a real system error, such as I/O failure, no access etc.

MFC after:	3 days
2003-01-29 17:04:07 +00:00
yar
6284753cac Add a new option to ftpd(8), "-h", to disable printing any
host-specific information in FTP server messages (so paranoid
admins can sleep at night :-)

PR:		bin/16705
MFC after:	1 week
2003-01-29 10:58:58 +00:00
yar
e6e9500985 Give the code around chroot(2)/chdir(2) a major overhaul by
separating its part around chroot(2) from that around initial
chdir(2).  This makes the below changes really easy.

Move seteuid(to user's uid) to before calling chdir(2).  There are
two goals to achieve by that.  First, NFS mounted home directories
with restrictive permissions become accessible (local superuser
can't access them if not mapped to uid 0 on the remote side
explicitly.)  Second, all the permissions to the home directory
pathname components become effective; previously a user could be
carried to any local directory despite its permissions since the
chdir(2) was done with euid 0.  This reduces possible impact from
FTP server misconfiguration, e.g., assigning a wrong home directory
to a user.

Implement the "/./" feature.  Now a guest or user subject to chrooting
may have "/./" in his login directory, which separates his chroot
directory from his home directory inside the chrooted environment.
This works for ftpchroot(5) as well.

PR:		bin/17843 bin/23944
2003-01-29 10:07:27 +00:00
yar
a322ce3682 Actually extract the second field from a line in ftpchroot(5)
instead of just using the rest of the line behind the first field.
2003-01-27 15:34:22 +00:00
yar
704ec7b02a Allow more than one separator character between fields in ftpchroot(5). 2003-01-27 14:41:08 +00:00
yar
411365f15d Extend the format of /etc/ftpchroot so an alternative chroot
directory can be specified for a user or a group.

Add the manpage ftpchroot(5) since the file's format has grown
complex enough.

PR:			bin/45327
Portions submitted by:	Hideki SAKAMOTO <sakamoto@hlla.is.tsukuba.ac.jp>
MFC after:		1 week
2003-01-26 19:02:56 +00:00
yar
e67bf5e192 GLOB_MAXPATH has been deprecated in favour of GLOB_LIMIT. 2003-01-25 14:59:48 +00:00
yar
3d2488fff7 - Add a new option, ``-P port'', to specify the port for ftpd(8)
to listen at in daemon mode.
- Use the port by 1 less than the control port as the default
  data port instead of always using hard-coded port 20.

Submitted by:	roam
MFC after:	1 week
2003-01-23 18:39:48 +00:00
yar
f5eff04464 Prevent server-side glob(3) patterns from expanding
to a pathname that contains '\r' or '\n'.

Together with the earlier STAT bugfix, this must solve
the problem of such pathnames appearing in the FTP control
stream.
2003-01-22 16:25:22 +00:00
cjc
29a813efb6 The FTP daemon was vulnerable to a DoS where an attacker could bind()
up port 20 for an extended period of time and thus lock out all other
users from establishing PORT data connections. Don't hold on to the
bind() while we loop around waiting to see if we can make our
connection.

Being a DoS, it has security implications, giving it a short MFC
time.

MFC after:	1 day
2003-01-21 05:13:02 +00:00
sobomax
b5161aafed Fix a typo (missed &&).
Submitted by:	marcus
2003-01-20 10:33:35 +00:00
sobomax
2435c6cf8e Add a new gettytab(5) option - `pl', which if set tells getty that the line
in question is PPP-only line, i.e. no PPP-sequence detection is necessary and
PPP login program referenced by `pp' should be started automatically instead of
login(1)

Feature suggested and sponsored by:     United Networks of Ukraine
No reply from:  re
MFC after:	2 weeks
2003-01-19 20:59:52 +00:00
yar
65804c6d3c Prepend a space character if a line begins with a digit
in the output to the "STAT file" request.

This closes one discrepancy with RFC 959 (page 36.)

See also http://www.kb.cert.org/vuls/id/328867

Obtained from:	OpenBSD
2003-01-16 14:25:32 +00:00
yar
999cc66112 Replace the instances of literal "/bin/ls"
with the _PATH_LS macro to be consistent
with the rest of the ftpd(8) source.
2003-01-16 13:27:58 +00:00
obrien
1d7140c9c9 We have a usable 'LOGIN_NAME_MAX' now. 2003-01-06 04:42:20 +00:00
obrien
245822d35f Need to prototype strsuftollx() to quiet a warning. 2003-01-06 04:09:20 +00:00
obrien
c5fa1fb790 Make the "nbsd_20030105" import build. 2003-01-06 03:03:53 +00:00
jmallett
a33543dd92 Implement POSIX grantpt(3) functionality, and add a pt_chown utility (akin
to Solaris, it is in /usr/libexec) to perform the handing over of tty nodes
to the user being granted the pty.

Submitted by:	Ryan Younce <ryany@pobox.com>
Reviewed by:	security-officer@, standards@, mike@
2003-01-02 20:44:41 +00:00
schweikh
d3367c5f5d Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.
2003-01-01 18:49:04 +00:00
schweikh
86f7487fb6 Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/
Add FreeBSD Id tag where missing.
2002-12-30 21:18:15 +00:00
schweikh
fec6546e12 english(4) police. 2002-12-27 12:15:40 +00:00
ru
4979ab8d81 mdoc(7) police: Deal with self-xrefs. 2002-12-24 13:41:48 +00:00
ru
301b96498b Fixed the abuses of .Ql visible on stderr in troff mode.
PR:		docs/37176
2002-12-23 16:04:51 +00:00
dillon
be3db49c80 Change the way ELF coredumps are handled. Instead of unconditionally
skipping read-only pages, which can result in valuable non-text-related
data not getting dumped, the ELF loader and the dynamic loader now mark
read-only text pages NOCORE and the coredump code only checks (primarily) for
complete inaccessibility of the page or NOCORE being set.

Certain applications which map large amounts of read-only data will
produce much larger cores.  A new sysctl has been added,
debug.elf_legacy_coredump, which will revert to the old behavior.

This commit represents collaborative work by all parties involved.
The PR contains a program demonstrating the problem.

PR:		kern/45994
Submitted by:	"Peter Edwards" <pmedwards@eircom.net>, Archie Cobbs <archie@dellroad.org>
Reviewed by:	jdp, dillon
MFC after:	7 days
2002-12-16 19:24:43 +00:00
ru
041d1287e8 Uniformly refer to a file system as "file system".
Approved by:	re
2002-12-12 17:26:04 +00:00
kan
f7319be8e1 Fix rtld to handle SPARC_R_UA{16,64} relocations correctly.
Approved by:	re (rwatson)
2002-12-05 16:58:31 +00:00
grehan
fdd44c57ca rtld support for PowerPC. Mostly obtained from NetBSD, with mods
for binutils 2.13

Reviewed by:  benno

Approved by:  re (blanket)
2002-12-04 07:32:20 +00:00
kan
7edfa0142f Put back a test for binaries with no PT_LOAD entries I over-jealosly
removed in r1.69.

Apploved by:	re (rwatson)
2002-11-29 16:41:31 +00:00
ru
146b294736 mdoc(7) police:
Properly sort options, spell "file system" correctly, expand contraction.

Catch up to the src/etc/syslog.conf,v 1.23 change: ftpd(8) session logs
are now by default get logged to /var/log/xferlog.

Approved by:	re
2002-11-25 15:20:06 +00:00
tmm
bd3dff9a70 Fix the handling of high PLT entries (> 32764) on sparc64. This requires
additional arguments to reloc_jmpslot(), which is why MI code and MD code
of other platforms had to be changed.

Reviewed by:	jake
Approved by:	re
2002-11-18 22:08:50 +00:00
peter
570525a6c7 Oops. Some ut_time stuff slipped through the cracks. These turned out
to be non-fatal due to stack alignment roundups.
2002-11-17 23:46:45 +00:00
obrien
5a20d2febf [DAIVD O'BRIEN's OPINION]
Head off what I think is an abuse of the TRB, and disable lukemftpd.
2002-11-12 17:31:12 +00:00
maxim
c8298592e9 o Fix usage().
o Explicitly initialize domain pointer.
o Fix passwd file parsing.

PR:		bin/39671 (3)
MFC after:	2 weeks
2002-11-12 14:15:59 +00:00
obrien
e4a311f35f We don't use libpam, libopie, or libmd. 2002-11-12 07:41:59 +00:00
obrien
252278ff5d We have fparseln(3). Also libskey on RELENG_4. 2002-11-12 07:37:15 +00:00
obrien
b3245bbb2f Update for version 1.2 Beta 2. 2002-11-12 06:48:35 +00:00
yar
e2616c6490 Don't free the current addrinfo list, or else a pointer to a freed
memory area would arise.  Only an addrinfo list from an earlier
call to getaddrinfo() should be freed there because it will be
substituted by the current list referenced by "res".

Reported by:	John Long <fbsd1@pruam.com>
MFC after:	5 days
2002-11-11 07:31:48 +00:00
rwatson
71edd02c55 Have ftpd specify the LOGIN_SETMAC flag to setlogincontext() so that
MAC labels are set if MAC is enabled and configured for the user
logging in.

Note that lukemftpd is not considered a supported application when
MAC is enabled, as it does not use the standard system interfaces for
managing user contexts; if lukemftpd is used with labeled MAC policies,
it will not properly give up privileges when switching to the user
account.

Approved by:	re
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-24 16:19:52 +00:00
kuriyama
1a4ad6f685 Unbreak by merging the change in r1.51 of src/libexec/ftpd/Makefile. 2002-10-24 04:55:25 +00:00
rwatson
a20ce31a58 Teach "ls -Z" to use the policy-agnostic MAC label interfaces rather
than the LOMAC-specific interfaces for listing MAC labels.  This permits
ls to view MAC labels in a manner similar to getfmac, when ls is used
with the -l argument.  Next generation LOMAC will use the MAC Framework
so should "just" work with this and other policies.  Not the prettiest
code in the world, but then, neither is ls(1).

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-24 00:07:30 +00:00
kan
dca183b31a Add support for binaries with arbitrary number of PT_LOAD sections.
Reviewed by:	peter
2002-10-23 01:43:29 +00:00
kan
d675c525c1 Change the symbol lookup order to search RTLD_GLOBAL objects
before referencing object's DAG. This makes it possible for
C++ exceptions to work across shared libraries and brings
us closer to the search order used by Solaris/Linux.

Reviewed by:	jdp
Approved by:	obrien
MFC after:	1 month
2002-10-19 23:03:35 +00:00
sobomax
62ac3ba58f Fix a problem with RTLD_TRACE flag to dlopen(3), which sometimes can return
even if there was no error occured (when trying to dlopen(3) object that
already linked into executable which does dlopen(3) call). This is more
proper fix for `ldd /usr/lib/libc.so' problem, because the new behaviour
conforms to documentation.

Remove workaround from ldd.c (rev.1.32).

PR:		35099
Submitted by:	Nathan Hawkins <utsl@quic.net>
MFC after:	1 week
2002-10-19 10:18:29 +00:00
kris
10962700eb Don't call report() without a format string.
MFC after:	3 days
2002-10-13 11:27:36 +00:00
kris
2e6c3a2849 Mark the logerr() function __printflike().
MFC after:	3 days
2002-10-13 11:26:37 +00:00
kris
5b0c1af47d Use strlcpy instead of incorrectly using strncpy.
MFC after:	2 weeks
2002-10-13 11:25:31 +00:00
obrien
4c25a7d612 Use the new freebsd output format from Binutils 2.13.1. 2002-10-12 02:30:53 +00:00
alfred
4c4e655234 de-__P() 2002-10-09 23:22:11 +00:00
ru
908ae3fbf2 <machine/atomic.h> requires <sys/types.h>.
Reviewed by:	jake, mike
2002-10-09 20:20:43 +00:00
mike
f7bc6d5b05 Hook rpc.rstatd back up to the build now that it compiles. 2002-10-02 18:37:11 +00:00
mike
6a502b16ae Rename local function havedisk() to haveadisk() to avoid conflict a
with another function by the same name in a system header.
2002-10-02 18:29:50 +00:00
jhb
0f8f579414 Unhook rpc.rstatd from the build until it actually compiles. 2002-10-02 16:14:16 +00:00
mike
86a758e51b Use the standardized CHAR_BIT constant instead of NBBY in userland. 2002-09-25 04:06:37 +00:00
peter
a51c9b6627 Initiate deorbit burn for the i386-only a.out related support. Moves are
under way to move the remnants of the a.out toolchain to ports.  As the
comment in src/Makefile said, this stuff is deprecated and one should not
expect this to remain beyond 4.0-REL.  It has already lasted WAY beyond
that.

Notable exceptions:
gcc - I have not touched the a.out generation stuff there.
ldd/ldconfig - still have some code to interface with a.out rtld.
old as/ld/etc - I have not removed these yet, pending their move to ports.
some includes - necessary for ldd/ldconfig for now.

Tested on: i386 (extensively), alpha
2002-09-17 01:49:00 +00:00
tmm
208c1cb767 Return an error if a symbol is not found in reloc_jmpslots() instead of
crashing.
2002-09-14 12:14:24 +00:00
obrien
3b8e2fbae0 Was mising ftpchroot.5
PR:		40717
Submitted by:	Andrew <andrew@ugh.net.au>
2002-08-30 06:50:08 +00:00
yar
f8c5ceb68d The mode can be "r+" as well on PUT, but only "a" on APPE. 2002-08-29 09:53:51 +00:00
yar
c4deb81f31 Fix lexer jam on unimplemented commands.
Submitted by:	maxim
MFC after:	5 days
2002-08-29 09:23:08 +00:00
yar
906476b28e Remove variables no longer used. 2002-08-27 09:05:03 +00:00
yar
9841ff7102 More inithosts() fixes:
o Don't free(3) memory occupied by host structures
  already in the host list.
o Set hrp->hostinfo to NULL if a host record has to stay in
  the host list, but is to be ignored.  Selecthost() knows that.
o Reduce the pollution with excessive NULL checks.
o Close a couple of memory leaks.

MFC after:	1 week
2002-08-27 09:02:52 +00:00
yar
57e404b3cd Fix an inconsistency between a printf-like format and its argument list.
Submitted by:	kris
MFC after:	3 days
2002-08-27 07:38:55 +00:00
charnier
4966efff7b Replace various spelling with FALLTHROUGH which is lint()able 2002-08-25 13:10:45 +00:00
yar
8edf222b9e Add option '-W': don't log FTP sessions to wtmp.
Submitted by:	maxim
MFC after:	1 week
2002-08-23 09:06:28 +00:00
marcel
68f14f0597 Fix a nasty memory corruption bug caused by having a bogus pointer
for the DT_IA64_PLT_RESERVE dynamic table entry. When a shared object
does not have any PLT relocations, the linker apparently doesn't find
it necessary to actually reserve the space for the BOR (Bind On
Reference) entries as pointed to by the DTE. As a result, relocatable
data in the PLT was overwritten, causing some unexpected control flow
with annoyingly predictable outcome: coredump.
To reproduce:
	% echo 'int main() { return 0; }' > foo.c
	% cc -o foo foo.c -lxpg4
2002-08-22 03:56:57 +00:00
imp
eb79b6a23b Include stddef.h for NULL definition, rather than rolling our own here.
Reviewed by: jdp
2002-08-21 19:03:26 +00:00
yar
a5929f9a88 Clean up hostname and hostinfo handling in inithosts():
o check getaddrinfo(3) return value, not result pointer
o getaddrinfo(3) returns int, not pointer
o don't leak memory allocated for hostnames and hostinfo structures
o initialize pointers that will be checked for NULL somewhere

MFC after:	1 week
2002-08-20 14:56:06 +00:00
marcel
1e66a9327a Add support for the R_IA64_IPLTLSB relocation in non-PLT context.
This relocation creates a function descriptor at the specified
address and is commonly used for C++ to create virtual function
tables.
2002-08-20 00:24:33 +00:00
bde
a8e6e41c88 Include <nlist.h> for nlist interfaces instead of depending on namespace
pollution in <kvm.h>.
2002-08-18 17:57:08 +00:00
johan
3fcc723a46 Bump document date for the 'beep only' change. 2002-08-16 03:08:25 +00:00
ru
ce971426f4 mdoc(7) police: Removed redundant .Ns calls. 2002-08-13 16:07:28 +00:00
yar
2a6f0e09d3 Fix a wrong comment on (hopefully) right code.
MFC after:	3 days
2002-08-13 14:08:38 +00:00
dwmalone
374c5261af Add tcpd to the build - though we don't need to for inetd, someone might
want it for some other service-running program.

Approved by:	markm
MFC after:	1 week
2002-08-13 14:03:40 +00:00
yar
6c62e6d106 Fix command help lines:
o PORT takes six byte values, not five.
o TYPE argument is mandatory.

Submitted by:	demon (the 1st part)
MFC after:	3 days
2002-08-13 13:56:42 +00:00
ru
5727268ab3 mdoc(7) police: nits. 2002-08-13 11:11:32 +00:00
ru
cef88805d9 mdoc(7) police: tidy up. 2002-08-13 11:05:04 +00:00
schweikh
b2bb39b1eb Fix typos; each file has at least one s/seperat/separat/
(I skipped those in contrib/, gnu/ and crypto/)
While I was at it, fixed a lot more found by ispell that I
could identify with certainty to be errors. All of these
were in comments or text, not in actual code.

Suggested by:	bde
MFC after:	3 days
2002-08-11 13:05:30 +00:00
yar
1402e3c762 Rework storing files thoroughly. This includes:
o Remove the race between stat(2) & fopen(3) when creating
  a unique file.

o Improve bound checking when generating a unique name from
  a given pathname.

o Ignore REST marker on APPE.  No RFC specifies this case,
  but the idea of resuming APPE's implies this.

o By default, deny upload resumes and appends by anonymous users.
  Previously these commands were translated to STOU silently,
  which led to broken files on server without any notification
  to the user.

o Add an option, -m, to allow anonymous users to modify
  existing files (e.g., to resume uploads) if filesystem
  permissions permit.

Portions obrainded from:	OpenBSD
MFC after:			3 weeks
2002-08-08 17:53:52 +00:00
jdp
2f9d7d8897 Don't acquire the writer lock in rtld_exit when clearing the shared
objects' reference counts.  This function is called by the atexit
mechanism at program shutdown.  I don't think the locking is necessary
here.  It caused OpenOffice builds to hang more often than not.
Credit to Martin Blapp and Matt Dillon for helping to diagnose this
problem and for testing the fix.
2002-08-08 15:53:23 +00:00
yar
dbe59dc029 1) Use "pathstring" instead of "STRING" consistently.
2) Remove unneeded "if not NULL" props from "pathstring",
   which will never be NULL by the lexer design.

Inspired by:	OpenBSD
MFC after:	1 week
2002-08-05 17:34:15 +00:00
yar
37e3668bf5 Since GLOB_NOCHECK is set in the glob(3) call,
glob(3) will return at least one pathname unless
a system error has occured.  It's not a "not found"
error otherwise.

MFC after:	3 days
2002-08-05 14:40:38 +00:00
yar
4396de5e38 Spot places where "pathname" hasn't been checked
for NULL.  The "pathname" rule may return NULL
on a glob(3) error.

Obtained from:	OpenBSD
MFC after:	1 week
2002-08-05 14:26:40 +00:00
yar
09fb3e817b Disallow invalid numeric mode values for SITE CHMOD.
Earlier, a decimal number (e.g., 890) could be passed
for mode, leading to dangerous permissions set:
-1, that is, 07777.

Obtained from:	OpenBSD
MFC after:	1 week
2002-08-05 14:10:57 +00:00
yar
87d654b4a4 Reflect in the ftpd(8) manpage the fact that ASCII SIZE
requests against large files will be denied.

MFC after:	10 days
2002-08-05 13:37:18 +00:00
yar
919470cf7d Deny the SIZE command on large files when in ASCII mode.
This eliminates an opportunity for DoS attack.

Pointed out by:	maxim
Inspired by:	lukemftpd, OpenBSD
MFC after:	2 weeks
2002-07-31 10:55:31 +00:00
yar
856a7116df Conform to RFC 959, Appendix II, when replying
to a successful MKD command.

MFC after:	1 week
2002-07-29 15:54:27 +00:00
yar
b0f2856844 Make the -v' option a synonym for -d'
(as it was intended initially)
and document it in the manpage.

MFC after:	2 weeks
2002-07-26 16:07:19 +00:00
yar
ae142b4144 Document the -u (set umask) option
(which has been there at least since 4.4BSD-Lite!)

MFC after:	2 weeks
2002-07-26 16:01:24 +00:00
yar
11df7e3f6f Sort command-line options according to the mostly used style:
alphabetical order, lower and upper case of the same letter
stick together, lower case first.

MFC after:	2 weeks
2002-07-26 15:46:08 +00:00
yar
01cbae6356 Use <arpa/ftp.h> stuff cleanly, without introducing
non-portable constants (in this case, hidden as offsets
to the "?AEIL" string.)

MFC after:	1 week
2002-07-25 17:41:47 +00:00
yar
90caf3dc00 Re-use passive data ports with the SO_REUSEADDR
socket option to avoid exausting the passive port
space by TIME_WAIT'ing connections.

PR:		bin/36955
Submitted by:	Maxim Konovalov <maxim@FreeBSD.org>
MFC after:	2 weeks
2002-07-24 16:11:34 +00:00
yar
b55ffaf6bb Remove the outdated casts to "char *" from the setsockopt(2),
write(2), and getipnodebyaddr(3) calls.  Now all the above functions
accept "void *" in that arguments and have prototypes.  Thus, the
casts are useless under the normal circumstances (and would be harmful
if the functions had no prototypes.)

MFC after:	2 weeks
2002-07-24 15:30:53 +00:00
yar
d19478c57f Clean up the syslog(3) messages on the setsockopt(2) errors:
o Always check a setsockopt(2) return value
o Use a consistent message format
o Don't abort if the failed setsockopt(2) was actually not vital
o Use LOG_WARNING, not LOG_ERR, in non-fatal cases

MFC after:	1 week
2002-07-24 14:50:17 +00:00
ume
9c2c51a1e6 use IPV6_V6ONLY instead of non standard IPV6_BINDV6ONLY.
MFC after:	1 week
2002-07-22 15:22:53 +00:00
yar
7825a53069 Fix one RFC 959 incompliance:
Double double-quotes in a PWD result
if they appear in the directory pathname.

PR:		misc/18365
MFC after:	1 week
2002-07-22 07:41:14 +00:00
charnier
9174768035 Correct wrong grammar from previous commit. Note that fingerd is not limited
to being an interface to finger(1), see -p flag. Remove a reference to
name(?) program we don't have.

Submitted by:	wollman
2002-07-21 13:02:13 +00:00
yar
81d786a9d6 Allow deleting and renaming stale symlinks and
deleting symlinks pointing to directories.

PR:		bin/37250
Submitted by:	Nino Dehne <TeCeEm@gmx.de>
MFC after:	1 week
2002-07-21 12:06:56 +00:00
jake
ddac48a07c Add END markers to asm functions so that debuggers can find their size. 2002-07-17 22:20:41 +00:00
yar
0e4b89607d Avoid passing NULL to freehostent(3).
MFC after:	1 week
2002-07-17 19:29:25 +00:00
yar
ab8d11d3a9 Fix setting parameters for getipnodebyaddr(3):
o "struct addrinfo" contains a pointer to "struct sockaddr,"
  not "struct sockaddr" itself
o the function takes a pointer to "struct in*_addr", not to
  "struct sockaddr," so the address length must be corresponding

MFC after:	1 week
2002-07-17 19:07:07 +00:00
mikeh
1bf2662143 GLOB_QUOTE has been retired. 2002-07-17 05:47:49 +00:00
yar
4410d83dcc Use the right indent for the closing brace: it belongs to `if',
not to `for'.  The previous indent was reather misleading for
the code reader.

MFC after:	1 week
2002-07-16 16:48:15 +00:00
yar
c2dfbe8244 Replace the awkward hackery about strtok(3)
by conventional one-way parsing of ftphosts(5).
Don't let NULL hostname pointers into virtual
host records as well.

PR:		bin/18410
MFC after:	1 month
2002-07-16 16:30:41 +00:00
alfred
83a53d0868 Port to TI/RPC and/or IPV6.
Submitted by: Jean-Luc Richier <Jean-Luc.Richier@imag.fr>
2002-07-15 18:51:57 +00:00
yar
eba11c79d0 Use fgetln(3) to read lines from configuration files (ftpusers, ftphosts.)
Thus lines of any length can be handled, unlike before.

Don't assume that each line read from the files ends with a newline.

As a side effect in inithosts(), don't use automatic buffer at all,
utilize malloc(3) when getting local host name instead.

PR:		misc/21494
Reviewed by:	maxim, mikeh
MFC after:	1 month
2002-07-12 15:51:15 +00:00
johan
784b48a6bb Add ability to only beep when mail arrives.
comsat:
        only send two bell charecters if S_IXGRP is set and S_IXUSR is not.

biff:
        add new option 'b' to set S_IXGRP.

PR:             10931
Submitted by:   Andrew J. Korty <ajk@purdue.edu>
Approved by:    sheldonh (mentor)
MFC after:      1 month
2002-07-09 02:16:49 +00:00
jdp
e26f3975bd Remove the nanosleep calls from the spin loops in the locking code.
They provided little benefit (if any) and they caused some problems
in OpenOffice, at least in post-KSE -current and perhaps in other
environments too.  The nanosleep calls prevented the profiling timer
from advancing during the spinloops, thereby preventing the thread
scheduler from ever pre-empting the spinning thread.  Alexander
Kabaev diagnosed this problem, Martin Blapp helped with testing,
and Matt Dillon provided some helpful suggestions.

This is a short-term fix for a larger problem.  The use of spinlocking
isn't guaranteed to work in all cases.  For example, if the spinning
thread has higher priority than all other threads, it may never be
pre-empted, and the thread holding the lock may never progress far
enough to release the lock.  On the other hand, spinlocking is the
only locking that can work with an arbitrary unknown threads package.

I have some ideas for a much better fix in the longer term.  It
would eliminate all locking inside the dynamic linker by making it
safe for symbol lookups and lazy binding to proceed in parallel
with a call to dlopen or dlclose.  This means that the only mutual
exclusion needed would be to prevent multiple simultaneous calls
to dlopen and/or dlclose.  That mutual exclusion could be put into
the native pthreads library.  Applications using foreign threads
packages would have to make their own arrangements to ensure that
they did not have multiple threads in dlopen and/or dlclose -- a
reasonable requirement in my opinion.

MFC after:	3 days
2002-07-06 20:25:56 +00:00
charnier
9639b20db6 The .Nm utility 2002-07-06 19:19:48 +00:00
dan
2bdfbbf7e6 Make sure to reset transflag back to zero upon succesfully using sendfile()
to transfer a file.

PR: 39362
Submitted by: TANAKA Hiroyuki <kattyo@abk.nu>
MFC after: 1 week
2002-07-03 00:12:00 +00:00
ume
8530756499 Cope with 2292bis-01 getaddrinfo (no NI_WITHSCOPEID, always attach
scope identifier).

MFC after:	3 weeks
2002-07-02 11:11:17 +00:00
maxim
2a203b39db Remove trailing whitespaces. 2002-07-01 14:30:38 +00:00
maxim
53025a95ff Move 'byte_count' calculation just before 'recvurg' check. It is a global
variable and used in myoob().

PR:		bin/38928
Submitted by:	Oliver Fromme <olli@secnetix.de>
MFC after:	1 month
2002-07-01 14:29:44 +00:00
mdodd
c8cc9e8e67 Implement a flag to disable directory creation for anonymous users.
PR:		misc/38987
Submitted by:	Peter da Silva <peter@abbnm.com>
MFC after:	1 week
2002-07-01 02:30:11 +00:00
markm
eaea972b25 Remove a GCC-specific command-line option. We should be using WARNS=n
for this stuff.
2002-06-28 10:36:14 +00:00
wollman
4a461e9ee1 When the -p flag is specified, set an environment variable to the name
of the remote host (or rather, the name as mangled by realhostname_sa())
so that the process can use it to behave differently depending on the
origin on the request.  We use this to implement rudimentary visibility
control on our user information.

Make sure that the child process's standard error goes through the same
NVT-ASCII filter as is applied to the standard output.

Don't attempt to call logerr() from the child since stdio is not safe in
a vforked process.  Just write a message to fd 2 instead.  (Ideally, the
parent would open two pipes, and siphon off our stderr to some place less
public, but I have not attempted to do so in this implementation.)
2002-06-26 21:46:56 +00:00
markm
33f0a5804d Gut out (by default unused) cruft, and tidy up warnings. 2002-06-26 17:09:08 +00:00
jdp
be1828addc Update the asm statements to use the "+" modifier instead of
matching constraints where appropriate.  This makes the dynamic
linker buildable at -O0 again.

Thanks to Bruce Evans for identifying the cause of the build
problem.

MFC after:	1 week
2002-06-24 23:19:18 +00:00
jake
57b695126f Add needed include of mman.h to fix sparc64 buildworld. 2002-06-24 05:23:46 +00:00
dillon
7b9815cfbe The last bits of the alloca -> mmap fix. IA64 and SPARC64 (current only).
Untested (testing request went unanswered), but sparc64 is not expected to
cause problems.  IA64 is not expected to cause problems but the patch was
slightly more complex so the possibility exists.

Approved by:    jdp
2002-06-22 18:36:21 +00:00