Commit Graph

1312 Commits

Author SHA1 Message Date
brian
03cc5bebdf Call tzset() at startup.
Submitted by:	Andrzej ToboÅa <ato@iem.pw.edu.pl>
2004-06-21 10:47:12 +00:00
brian
e3eb78c150 o Reduce path names in RRQ and WRQ packets by:
Reducing "/+./" strings to "/"
    Reducing "/[^/]+/../" to "/"

o Don't send an OACK when the result of the [RW]RQ is an error.

These changes allow tftpd to interact with pxelinux.bin from the syslinux
package.

Whilst the path reducing code doesn't properly handle situations where the
path component before the "/../" is a symlink to (say) ".", I would suggest
that it does the right thing in terms of the clients perception of what
their path string actually represents.  This seems better than using
realpath() and breaking environments where symlinks point outside of the
directory hierarchy that tftpd is configured to allow.
2004-06-21 08:01:16 +00:00
tmm
b6293e1f53 Fix the problem that surfaced with the new binutils import on sparc64
(and that is for now being worked around by a binutils patch).

The rtld code tested &_DYNAMIC against 0 to see whether rtld itself
was built as PIC or not. While the sparc64 MD code did not rely
on the preset value of the GOT slot for _DYNAMIC any more due
to previous binutils changes, it still used to not be 0, so
that this check did work. The new binutils do however initialize
this slot with 0. As a consequence, rtld would not properly initialize
itself and crash.
Fix that by introducing a new macro, RTLD_IS_DYNAMIC, to take the role
of this test. For sparc64, it is implemented using the rtld_dynamic()
code that was already there. If an architecture does not provide its
own implementation, we default to the old check.

While being there, mark _DYNAMIC as a weak symbol in the sparc64
rtld_start.S. This is needed in the LDSCRIPT case, which is however
not currently supported for want of an actual ldscript.

Sanity checked with md5 on alpha, amd64, i386 and ia64.
2004-06-18 02:01:37 +00:00
cognet
a04f880b2c This comment should have been removed in the previous commit.
Spotted out by: marcus, simon
2004-06-17 19:01:53 +00:00
cognet
b0cb57b3d3 Woohoo !
the latest binutils import mades this gross hack useless, so just remove it.
2004-06-17 17:53:16 +00:00
obrien
60c1f23855 Commit a crude hack so we get sparc64 snapshots working again with a
stable ld.so.  We need to revisit the rtld-elf/sparc64/rtld_start.S
rev. 1.5 and rtld-elf/sparc64/rtld_machdep.h rev. 1.5, which was
suppose to allow stock Binutils 2.13 (and later) to be used.
2004-06-17 16:08:20 +00:00
obrien
b1e3bce66d Fall out from Binutils 2.15: don't bulid the ld.so on Sparc64. 2004-06-17 03:04:24 +00:00
bms
d28aefc2ff Whitespace. 2004-06-14 22:44:13 +00:00
bms
3c6a563aae Do not depend on the global 'sockt' being initialized to 0;
instead, use the symbolic constant STDIN_FILENO, as this is
a daemon invoked from inetd.
Remove 'sockt' as it is not referenced.
2004-06-14 22:43:05 +00:00
obrien
0952600013 Simplify conditional compilation logic some. 2004-06-13 19:54:12 +00:00
eik
5b95d0529f give out a little more information in case of a missing dependency
PR:		56549
Submitted by:	edwin
Reviewed by:	joerg, ru
Approved by:	joerg
MFC after:	2 weeks
2004-05-28 00:05:28 +00:00
mdodd
5102787d67 - Close fd if fdopen(fd) fails.
- Format return () to resemble the one 5 lines up.
2004-05-25 01:40:27 +00:00
mdodd
32d029277f Add two new flags: -w, which allows new files to be created,
and -U, which allows the umask to be set.

Obtained from:	 Patton Electronics, Co.
2004-05-24 22:56:15 +00:00
stefanf
aab0b7d72b Include <stdlib.h> for exit() and abort() prototypes.
Approved by:	das (mentor)
2004-05-24 13:21:24 +00:00
stefanf
6a060e0abd Include <netinet/in.h> for ntoh*() and hton*() prototypes.
Approved by:	das (mentor)
2004-05-24 11:59:17 +00:00
mdodd
93f8fa79b0 Support basename and path based constrained matches.
eg:
	[foo]
	...

	matches any executable 'foo'

	[/usr/bin/foo/]
	...

	matches any executable under the directory /usr/bin/foo/

Exact matches continue to function as before.

PR:		 bin/66769
Submitted-by:	 Dan Nelson
2004-05-24 01:24:13 +00:00
ru
aa74687086 Markup fixes. 2004-05-16 22:12:12 +00:00
ru
1d6c359bc3 Markup nit. 2004-05-16 22:11:56 +00:00
ru
73a0bc9d67 There's no such beast like AF_INET4, even when powered by whiskey. 2004-05-16 22:11:40 +00:00
ru
9f5dd164fa Bump document date for the latest change.
Minor markup tweaks.
2004-05-16 22:11:22 +00:00
cognet
9952d2078c Work around a problem somewhere with binutils (?) on arm, hopefully without
breaking any other arch this time.
2004-05-15 00:13:14 +00:00
se
f6e56dfefa Fix breakage caused by alphabetically sorting SRCS: rtld_start.S must come first!
The previous version made all shared binaries dump core.
2004-05-14 21:01:52 +00:00
cognet
014f12928e Import arm bits for rtld-elf.
Obtained from:	NetBSD
2004-05-14 12:15:51 +00:00
tjr
e552f9132c Handle variable argument lists correctly in reply() and lreply().
In particular, do not pass the same va_list to both vprintf() and
vsyslog() without first reinitializing it. This fixes ftpd -d
on amd64.
2004-05-13 05:36:38 +00:00
mux
7e77c2aeeb Cast the terminating NULL to char * in the execl() call.
Submitted by:	Stefan Farfeleder <stefan@fafoe.narf.at>
2004-04-04 20:53:23 +00:00
dfr
ecaeee9328 If we change obj_rtld.path after initialising __progname, make sure we
change __progname to point at the new storage otherwise it ends up
pointing at freed memory which leads to confusing garbled error messages.
2004-03-29 18:37:37 +00:00
pjd
af22f06b2f Make fingerd(8) WARNS2 clean. 2004-03-29 09:29:51 +00:00
peter
dca558e32f More stack alignment fixes. Arrange so we call _rtld() in ld-elf.so.1
with the correct alignment.  This is important because this calls to
library static constructors are made from here.  The bug in the old crt*.s
files hid this because in this case, two wrongs do indeed make a right.
Also, call _rtld_bind() with the correct alignment, because it calls back
into the pthread library locking functions.  If things happen just
the wrong way, we get a SIG10 due to the broken stack alignment.
2004-03-21 01:43:39 +00:00
peter
579f0ac7f2 Add initial support for compiling a special 32 bit version of
ld-elf.so.1 on 64 bit systems.  Most of this involves using alternate
paths, environment variables and diagnostic messages.

The build glue is seperate.
2004-03-21 01:21:26 +00:00
bde
3f5635b295 Fixed a misspelling of 0 as NULL. 2004-03-14 05:27:26 +00:00
mlaier
55ee1d7448 Link pf to the build and install:
This adds the former ports registered groups: proxy and authpf as well as
the proxy user. Make sure to run mergemaster -p in oder to complete make
installworld without errors.

This also provides the passive OS fingerprints from OpenBSD (pf.os) and an
example pf.conf.

For those who want to go without pf; it provides a NO_PF knob to make.conf.

__FreeBSD_version will be bumped soon to reflect this and to be able to
change ports accordingly.

Approved by:	bms(mentor)
2004-03-08 22:03:29 +00:00
markm
f1849df8d1 Make NULL a (void*)0 whereever possible, and fix the warnings(-Werror)
that this provokes. "Wherever possible" means "In the kernel OR NOT
C++" (implying C).

There are places where (void *) pointers are not valid, such as for
function pointers, but in the special case of (void *)0, agreement
settles on it being OK.

Most of the fixes were NULL where an integer zero was needed; many
of the fixes were NULL where ascii <nul> ('\0') was needed, and a
few were just "other".

Tested on: i386 sparc64
2004-03-05 08:10:19 +00:00
mlaier
9c3431aab1 Add skeleton build dirs for pf userland:
libexec/ftp-proxy	- ftp proxy for pf
 sbin/pfctl		- equivalent to sbin/ipf
 sbin/pflogd		- deamon logging packets via if_pflog in pcap format
 usr.sbin/authpf	- authentification shell to modify pf rulesets

Bring along some altq headers used to satisfy pfctl/authpf compile. This
helps to keep the diff down and will make it easy to have a altq-patchset
use the full powers of pf.

Also make sure that the pf headers are installed.

This does not link anything to the build. There will be a NO_PF switch for
make.conf once pf userland is linked.

Approved by:	bms(mentor)
2004-02-28 21:50:50 +00:00
kan
0571d794e8 Do not depend on existence of _end symbol in obj_from_addr, use
obj->mapbase and obj->mapsize instead.

Prompted by: 	OpenOffice debugging session at last BSDCon.
2004-02-25 17:06:16 +00:00
das
2b6841d337 Don't pass a pointer to a 'long' to a function that expects an 'int *'.
Submitted by:	Roop Nanuwa <roop@hqst.com>
PR:		62615
2004-02-16 10:03:44 +00:00
roam
baedd90207 Add the '-h hostname' to usage(), too.
While I'm here, sync the usage() synopsis with the manual page synopsis:
make the [-i | -s] explicit and sort the options alphabetically.

Reminded by:		ru
MFC after:		3 days
2004-02-13 09:26:54 +00:00
roam
feafab5651 Document the '-h hostname' option, which seems to have been present
ever since rev. 1.1 of bootpd.c.
While I'm here, rearrange the synopsis a bit: sort the options and
clarify that -i and -s are mutually exclusive.

Reported by:	Atanas Buchvarov <nasko@nove.bg>
MFC after:	3 days
2004-02-10 15:12:01 +00:00
yar
bf3e668790 NULL looks better than (char *)0 unless we're passing
an unprototyped argument to a function.
2004-02-07 14:59:11 +00:00
yar
65736ef532 Deny attempts to rename a file from guest users if the policy
says they may not modify existing files through FTP.

Renaming a file is effectively a way to modify it.
For instance, if a malicious party is unable to delete or overwrite
a sensitive file, they can nevertheless rename it to a hidden name
and then upload a troyan horse under the guise of the old file name.
2004-02-07 14:54:30 +00:00
yar
0f38f90465 perror_reply() should not be used where errno isn't meaningful. 2004-02-07 14:38:04 +00:00
yar
5b4d2bea08 Work around a bug in some clients by never returning raw directory
contents in reply to a RETR command.  Such clients consider RETR
as a way to tell a file from a directory.  Mozilla is an example.

PR:		bin/62232
Submitted by:	Bob Finch <bob+freebsd <at> nas <dot> com>
MFC after:	1 week
2004-02-07 14:11:38 +00:00
ru
4c72afa60b Fixed style of DPADD and LDADD assignments as per style.Makefile(5). 2004-02-05 22:44:25 +00:00
ru
72b546fae5 Removed unnecessary dependencies on librpcsvc.
Prodded by:	des
2004-02-04 11:59:08 +00:00
ru
c96d02bc13 Put libdevstat before libkvm, because the former depends on the latter. 2004-02-04 10:20:43 +00:00
ru
bd38f68b12 - Added the NOPAM knob, for consistency with ${.CURDIR}/../ftpd.
- Unbreak -DNOPAM -DNOSHARED build by putting -lmd after -lopie.

(Static build with PAM remains broken.)
2004-02-04 10:05:21 +00:00
fjoe
d8793a0c3c Fix "warning: value computed is not used".
Found by:	gcc 2.95.4 [FreeBSD]
2004-02-03 18:53:40 +00:00
ru
ee299b5724 Removed duplicate -lutil. 2004-02-02 18:23:18 +00:00
ru
0e945b7e9e Reorder dependencies to fix static NOPAM build.
Submitted by:	lorder(1)
2004-02-02 18:19:41 +00:00
charnier
4b7b246b74 add missing setusershell() calls.
PR: bin/2442
Reviewed by: Friedemann Becker <zxmxy33@mail.uni-tuebingen.de>
2004-01-18 21:29:33 +00:00
ru
161c3c9b9d - Build things in pure dictionary order (see sort(1)).
- Unify the conditional assignments section so that architectural
  exclusions come first, then options and !options, sorted by the
  option name, also in directory order, then architecture specific
  sections, sorted by the architecture name, with i386 being a
  traditional exception.

Prodded by:	bde
2004-01-16 15:23:19 +00:00