Commit Graph

1753 Commits

Author SHA1 Message Date
marius
a060d7dfbc - Fix the handling of R_SPARC_OLO10, which is a bit of a special case
in the way we implement handling of relocations.
  As for the kernel part this fixes the loading of lots of modules,
  which failed to load due to unresolvable symbols when built after
  the GCC 4.2.0 import. This wasn't due to a change in GCC itself
  though but one of several changes in configuration done along the
  import. Specfically, HAVE_AS_REGISTER_PSEUDO_OP, which causes GCC
  to denote global registers used for scratch purposes and in turn
  GAS uses R_SPARC_OLO10 relocations for, is now defined.
  While at it replace some more ELF_R_TYPE which should have been
  ELF64_R_TYPE_ID but didn't cause problems so far.
- Sync a sanity check between kernel and rtld(1) and change it to be
  maintenance free regarding the type used for the lookup table.
- Sprinkle const on lookup tables.
- Use __FBSDID.

Reported and tested by:	yongari
MFC after:		5 days
2007-10-16 19:17:48 +00:00
ru
62d48a1604 Fixed static linkage (build with -DNO_SHARED).
Approved by:	re (kensmith)
2007-10-01 18:17:24 +00:00
delphij
90cc29c58c Stop mentioning /usr/X11R6.
Approved by:	re (hrs)
2007-07-24 06:41:07 +00:00
marcel
127adac725 Unbreak the dynamic linker by not creating a cache for rtld-elf
itself. It needs mmap(2), which now needs getosreldate(3) and
which in turn uses a global variable to cache the result. This
cannot be done before linking is done.

See also: ../sparc64/reloc.c:1.15
Approved by: re (kensmith)
2007-07-15 22:52:15 +00:00
kensmith
bd3c8bf640 Cache does not serve any purpose when rtld is relocating itself, do
not bother allocating one.

Submitted by:	kan
Approved by:	re (bmah)
2007-07-13 16:18:43 +00:00
kan
312c816e62 Add r_debug_state to the list of symbols exported from rtld. GDB needs to
be able to find it in order to trap shared library events from rtld.

Approved by:	re (rwatson)
2007-07-11 23:07:37 +00:00
scf
196b6346ba Significantly reduce the memory leak as noted in BUGS section for
setenv(3) by tracking the size of the memory allocated instead of using
strlen() on the current value.

Convert all calls to POSIX from historic BSD API:
 - unsetenv returns an int.
 - putenv takes a char * instead of const char *.
 - putenv no longer makes a copy of the input string.
 - errno is set appropriately for POSIX.  Exceptions involve bad environ
   variable and internal initialization code.  These both set errno to
   EFAULT.

Several patches to base utilities to handle the POSIX changes from
Andrey Chernov's previous commit.  A few I re-wrote to use setenv()
instead of putenv().

New regression module for tools/regression/environ to test these
functions.  It also can be used to test the performance.

Bump __FreeBSD_version to 700050 due to API change.

PR:		kern/99826
Approved by:	wes
Approved by:	re (kensmith)
2007-07-04 00:00:41 +00:00
mlaier
83807ec50d Link pf 4.1 to the build:
- move ftp-proxy from libexec to usr.sbin
 - add tftp-proxy
 - new altq mtag link

Approved by:	re (kensmith)
2007-07-03 12:46:08 +00:00
yar
1d6d43b237 Note PAM support in atrun(8).
Sort FILES section while there.
Touch document date.
2007-06-17 14:02:31 +00:00
yar
73c6fd823f Add PAM support to atrun(8). 2007-06-15 12:02:16 +00:00
yar
62d3b985f5 Actually use new features of perr() and perrx(). 2007-06-15 10:34:36 +00:00
yar
79a90bc272 Catch up with perr() becoming variadic. 2007-06-15 10:12:37 +00:00
yar
0a5d437c3d Make perr() variadic and add perrx() to use in cases where
errno is irrelevant.  Some code duplication can be reduced
if perr() is variadic and perrx() is available.
2007-06-15 10:10:40 +00:00
yar
8a97efc414 Use a single setusercontext(3) instead of a bunch of basic syscalls.
Besides aesthetic benefits, that makes at(1) jobs subject to such
login.conf(5) settings as resource limits.
2007-06-14 22:16:21 +00:00
yar
b6a0b8bdc1 Spotted another copy of the loony error message. 2007-06-14 21:24:05 +00:00
yar
2c7e2004e3 Fix an error message that was beside the point. 2007-06-14 15:18:44 +00:00
yar
aaa29dd12a Fix a typical off-by-one error that can result in an unterminated string:
strncpy(dst, src, sizeof(dst));

by substituting the safer strlcpy() for strncpy().

X-Security:	none (the source string isn't user-supplied)
2007-06-14 14:44:04 +00:00
bz
e9cff2bb80 Correct a typo.
PR:		106049
Submitted by:	edwin (as part of a larger patch)
2007-06-03 15:32:06 +00:00
csjp
5e8c160d0b Update the man page to reflect that certain variables will be unset in
the case that the program is set-user-ID or set-group-ID. Add missing
annotations for LIBMAP and LIBMAP_DISABLE.
2007-05-17 19:14:25 +00:00
csjp
9c7934b018 In the event a process is tainted (setuid/setgid binaries), un-set any
potentially dangerous environment variables all together. It should be
noted that the run-time linker will not honnor these environment variables
if the process is tainted currently. However, once a child of the tainted
process calls setuid(2), it's status as being tainted (as defined by
issetugid(2)) will be removed. This could be problematic because
subsequent activations of the run-time linker could honnor these
dangerous variables.

This is more of an anti foot-shot mechanism, there is nothing I am
aware of in base that does this, however there may be third party
utilities which do, and there is no real negative impact of clearing
these environment variables.

Discussed on:	secteam
Reviewed by:	cperciva
PR:		kern/109836
MFC after:	2 weeks
2007-05-17 18:00:27 +00:00
marcel
15da83b5e9 Don't enable symbol versioning on ia64 for now. It causes
symbol lookup failures that later result in null-pointer
dereferences. This needs looking into, but since we're
close to release it's possible that it's not resolved before
that time.
2007-05-16 23:24:15 +00:00
marcel
43f7889dc6 We don't need --export-dynamic for ld-elf.so.1, because it's a
shared object.
2007-05-16 23:19:51 +00:00
deischen
bf3a79274d Enable symbol versioning by default. Use WITHOUT_SYMVER to disable it.
Warning, after symbol versioning is enabled, going back is not easy
(use WITHOUT_SYMVER at your own risk).

Change the default thread library to libthr.

There most likely still needs to be a version bump for at least the
thread libraries.  If necessary, this will happen later.
2007-05-13 14:12:40 +00:00
pav
587620304d Remove %m formatter, it's ifdef 0'ed in the code from the very beginning
MFC after:	1 week
2007-05-12 12:26:25 +00:00
pav
c4339791e9 Expand documentation for LD_TRACE_LOADED_OBJECTS_FMT? variables
PR:		docs/66265 (inspired by)
Submitted by:	Michel Lavondes <fox@vader.aacc.cc.md.us>
MFC after:	1 week
2007-05-12 12:24:49 +00:00
davidxu
a037728652 Fix a TLS memory leak.
PR: threads/112297
MFC: 1 week
2007-05-05 08:44:59 +00:00
ache
6ccaf050cc Back out all POSIXified *env() changes.
Not because I admit they are technically wrong and not because of bug
reports (I receive nothing). But because I surprisingly meets so
strong opposition and resistance so lost any desire to continue that.

Anyone who interested in POSIX can dig out what changes and how
through cvs diffs.
2007-05-01 16:02:44 +00:00
deischen
5850400608 Catch up with the private namespace change (s/FBSDprivate/FBSDprivate_1.0). 2007-05-01 13:46:27 +00:00
ache
4677e2577d Prepare for upcoming POSIXed putenv() rewrite:
don't allow putenv() arg be on the stack, replace putenv() with setenv()
2007-04-30 12:27:58 +00:00
kan
e7d29627ee Retire rtld-specific Versions.def. Symbols exported by rtld are supposed
to override weak symbols exported by libc, so by definition these two
are using the same symbol version names.

Reflect the reality by referring to libc's Versions.def directly.
2007-04-29 16:12:06 +00:00
deischen
bb377be75b Give the private version namespace a number to match libc. 2007-04-29 14:16:19 +00:00
deischen
2a7306fdc5 Use C comments since we now preprocess these files with CPP. 2007-04-29 14:05:22 +00:00
trhodes
c0ca7353a3 Remove references to S/Key and list OPIE. 2007-04-20 09:08:20 +00:00
yar
908756daef Reword the description of the UTF8 option (-8) so I can swear
to myself that I understand it.

Bump document date.
2007-04-19 17:30:19 +00:00
yar
021deab651 Add support for RFC 2389 (FEAT) and RFC 2640 (UTF8) to ftpd(8).
The support for RFC 2640 (UTF8) is optional and rudimentary.
The server just advertises its capability to handle UTF-8 file
names and relies on its own 8-bit cleanness, as well as on
the backward compatibility of UTF-8 with ASCII.  So uploaded
files will have UTF-8 names, but the initial server contents
should be prepared in UTF-8 by hand, no on-the-fly conversion
of file names will be done.

PR:		bin/111714
Submitted by:	Zhang Weiwu <see email in the PR>
MFC after:	1 week
2007-04-18 22:43:39 +00:00
kan
b9221e5c75 Bring rtld exports in line with corresponding symbols exported from
libc.

Disable SYMVER_DEFAULT n rtld until its implications are understood
better.
2007-04-09 23:00:29 +00:00
kan
639e7fc27d Remove reference to FBSDprivate version. We do not use it in this
module yet.
2007-04-07 23:23:10 +00:00
kan
0c81bcae73 Catch up on rtld's special status. Since it does not appear on
main object list, its versioning information needs to be examined
separately.

This hopefully fixes problems that people running with SYMVER_ENABLED
are experiencing.
2007-04-07 23:17:00 +00:00
kan
98adf88c30 Prepare rtld for symbol versioning. Disable it by default for now. 2007-04-03 19:01:06 +00:00
kan
0dd97e2c18 Implement dl_iterate_phdr function.
Convert boolean flags in internal Obj_Entry structure into bitfields.
Properly check for loaded segment alignment in map_object.
2007-04-03 18:31:20 +00:00
kan
34c2527aa4 Use u_int for variable manipulated by atomic ops to match atomic
ops function prototypes.
2007-04-03 18:28:13 +00:00
yar
7788a539e6 Let automatic TCP send buffer sizing do its job for ftpd(8): stop
setting the SO_SNDBUF socket option.  Using a hard-coded value for
it was a poor idea anyway in the face of diverse network conditions.
2007-02-09 17:18:39 +00:00
jhb
dcee465690 Document LD_UTRACE.
MFC after:	3 days
2007-01-23 22:38:39 +00:00
jhb
6952dd3772 Add various utrace's for use with ktrace to the ELF runtime linker. To
activate the traces, set the LD_UTRACE (or LD_32_UTRACE) environment
variable.  This also includes code in kdump(8) to parse the traces.

Reviewed by:	kan, jdp
MFC after:	2 weeks
2007-01-09 17:50:05 +00:00
kmacy
3785d22822 Fix TLS on sparc64 for statically and dynamically linked binaries
Approved by: rwatson (mentor)
Reviewed by: jmg and marcel
2006-10-08 02:50:34 +00:00
jkim
5f888e4283 Clean up white spaces and fix style(9). 2006-09-19 16:48:08 +00:00
kib
7c4f63574d Fix the buggy rev. 1.117. dagmembers are only initialized for dlopen'ed
dso that are actually loading. If dso a.so depends on b.so, then dlsym
with handle from dlopen("b.so") will fail unconditionally.

Correct implementation shall use the Obj_Entry.needed list to walk
dependencies DAG.

Test provided by: jkim
Tested (prev. version) by:	jkim, Nicolas Blais <nb_root at videotron ca>, h.blanke at chello nl
Pointy hat to:	kib
Approved by:	kan (mentor)
2006-09-19 12:47:13 +00:00
ru
18a5062f98 Markup fixes. 2006-09-17 21:48:47 +00:00
kib
c0568f66e0 When looking up the symbol by dlsym, look it not only in the object
given as dso handle, but also in the implicit dependencies of that dso.

Also, const-ify the read-only parameter objlist of symlook_list.

Reported by:	"Simon 'corecode' Schubert" <corecode at fs ei tum de>
Approved by:	kan (mentor)
X-MFC-After:	6.2
2006-09-08 14:59:54 +00:00
marcel
a2087dd751 Fix the variant I allocation for KSE: Allow a larger TCB and assume
that the documented TCB is at the tail of the extended TCB. In other
words, the base of the TCB has a negative offset from the TLS.
2006-09-01 06:13:16 +00:00
marcel
deb78746ab o Fix the static TLS relocation. We were subtracting the size of
the TCB.
o  Use NULL for null pointer argument.
o  Replace magic 8 with TLS_TCB_SIZE.
2006-09-01 06:08:50 +00:00
marcel
3b0abc3d1b Use NULL for null-pointer argument. 2006-09-01 06:07:26 +00:00
marcel
6defe18053 Replace magic 16 with TLS_TCB_SIZE. 2006-08-31 19:42:39 +00:00
obrien
c98a455106 Not needed any more, vendor sources have PAM support. 2006-08-31 17:12:33 +00:00
obrien
e2b445ed86 Catch up with the import of ftpd.c rev 1.1.1.6. 2006-08-31 17:02:05 +00:00
obrien
aeae00d8be FreeBSD doesn't have the simple pidfile(3), so craft it using FreeBSD's
primitives.
2006-08-31 16:57:46 +00:00
marcel
007866fe9c Prevent dead code elimination for the TP assignmient by using inline
assembly.
2006-08-30 00:39:07 +00:00
dougb
269fa0b3d5 1. Attempt to take one bullet out of the foot-shooting gun by silently
ignoring errors when sourcing rc.conf* files. The most common error
occurs when users put a command of some sort into those files.
(ifconfig is a popular choice)

2. Make the file rotation logic simpler by starting one down from
the "top" of the list, rather than at the top.

3. Try to make file rotation more secure by calling unlink(1) on all
new file names before rotating an old file to the new name, rather than
merely calling 'rm -f' on any files that exceed the number of files
to save.
2006-08-28 06:41:50 +00:00
ru
4d582ffe09 Remove alpha left-overs. 2006-08-22 08:03:01 +00:00
yar
20e3347b65 - Improve and extend mark-up.
- Don't use full path in .Nm (we just don't do that).
- Correct some frivolous and poorly rendering language,
  such as using possessive case for .Nm or .Fl .
- Use the same capitalization for "user ID" as in setuid(2) and getuid(2).
- Bring SEE ALSO in accord with the text.

MFC after:	5 days
2006-08-07 16:05:55 +00:00
delphij
bd6ce8ca51 In symlook_obj(): fix _rtld_error output.
MFC After:	2 weeks
2006-08-04 13:37:54 +00:00
yar
73ebfe88f6 inetd and telnetd are not included in the standard release
crunched floppies, but they can be included as options in
src/release/picobsd (omitted by default though.)  Therefore
preserve the RELEASE_CRUNCH knob in their Makefiles, but
tell its real purpose in a comment.
2006-07-31 19:15:10 +00:00
yar
fe55b573c0 Stop enforcing dependencies between MK_* options at Makefile level.
All the dependencies are satisfied now in <bsd.own.mk>.
2006-07-31 13:29:36 +00:00
yar
09bab3681d telnetd(8) doesn't really go to the crunched floppies,
so its Makefile needn't test for RELEASE_CRUNCH.

Suggested by:	ru
2006-07-31 13:20:44 +00:00
yar
7ed5788085 The lukemftpd code depends on INET6. Therefore MK_INET6_SUPPORT
should be respected.
2006-07-28 10:50:11 +00:00
yar
856c09a08a Respect MK_INET6_SUPPORT.
Apply style.Makefile(5).
2006-07-27 12:15:37 +00:00
yar
423dee4361 Cook CFLAGS by the modern recipe:
- use WARNS;
- respect MK_INET6_SUPPORT.
2006-07-27 12:05:05 +00:00
yar
5f5215a677 Fix compilation of ftpcmd.y without -DINET6.
Respect MK_INET6_SUPPORT in Makefile.

Requested by:	Attila Nagy <bra at fsn dot hu>
MFC after:	1 week
2006-06-05 15:50:34 +00:00
des
c3c1cc1abc *thwack*! all the world's not i386.
Pointy hat to:	des
2006-03-29 12:29:01 +00:00
des
ccc2cbd6d1 Don't use dbg if it isn't defined (such as when this file is used by
code outside of rtld-elf)
2006-03-28 18:28:07 +00:00
des
eaebf6a04f Use C99's varadic macro syntax instead of gcc's. 2006-03-28 18:26:47 +00:00
davidxu
88e93ccaa9 Er, forgot to clear tls space to zero for Variant II. 2006-03-28 06:14:22 +00:00
davidxu
f8168da7cf Allocate space for thread pointer, this allows thread library to access
its pointer from begin, and simplifies _get_curthread() in libthr.
2006-03-28 06:09:24 +00:00
pav
8f5f14e1c2 - Document LD_32_* environment variables
- Mention 32-bit files in FILES section

MFC after:	1 week
2006-03-27 00:53:58 +00:00
ru
388e590f95 Reimplementation of world/kernel build options. For details, see:
http://lists.freebsd.org/pipermail/freebsd-current/2006-March/061725.html

The src.conf(5) manpage is to follow in a few days.

Brought to you by:	imp, jhb, kris, phk, ru (all bugs are mine)
2006-03-17 18:54:44 +00:00
ume
2fdbdd8436 - Reduce needless DNS query by lookup only appropriate address
family. [1]
- Specify appropriate hints to getaddrinfo(3). [1]
- Obtain address family from peername in inet mode.

Submitted by:	Rostislav Krasny <rosti.bsd__at__gmail.com> [1]
Tested by:	yar, Rostislav Krasny <rosti.bsd__at__gmail.com>
MFC after:	1 week
2006-03-01 16:13:17 +00:00
peter
5d37faaea2 Fix a malloc overrun in 32-bit compat libmap lookup code. 2006-01-31 06:08:28 +00:00
yar
daeb2f2f38 Touch .Dd because the last commit was content-related. 2006-01-29 13:10:38 +00:00
marcel
597a7332d8 s/DT_IA64_PLT_RESERVE/DT_IA_64_PLT_RESERVE/ 2006-01-28 17:58:22 +00:00
marcel
07b3a00d83 s/R_IA64_/R_IA_64_/ 2006-01-28 17:56:16 +00:00
yar
1e8c9a7842 In the daemon code, check for and report possible errors
from accept(2) and fork(2).  Also close all unneeded fds
in the child process, namely listening sockets for all
address families and the fd initially obtained from accept(2).
(The main ftpd code operates on stdin/stdout anyway as it
has been designed for running from inetd.)

MFC after:	5 days
2006-01-21 13:06:37 +00:00
yar
a692e4fc42 The daemon's child shouldn't go on with the for loop
over ctl_sock's -- it is solely the parent daemon's
job.  So just break out of the loop in the child.

MFC after:	5 days
2006-01-21 12:34:28 +00:00
yar
c86031149b Use pidfile(3) provided by libutil to manage the deamon's pid file.
By default, create a pid file at the standard location, /var/run/ftpd.pid,
in accord with the expected behavior of a stock system daemon.

MFC after:	5 days
2006-01-21 12:21:41 +00:00
marcel
408ca433c5 s/R_IA64_/R_IA_64_/g as per the ia64 psABI. 2006-01-17 21:03:22 +00:00
jasone
3668a2e494 In preparation for a new malloc implementation:
* Add posix_memalign().

  * Move calloc() from calloc.c to malloc.c.  Add a calloc() implementation in
    rtld-elf in order to make the loader happy (even though calloc() isn't
    used in rtld-elf).

  * Add _malloc_prefork() and _malloc_postfork(), and use them instead of
    directly manipulating __malloc_lock.

Approved by:	phk, markm (mentor)
2006-01-12 07:28:21 +00:00
ceri
31d71e45b2 Don't be sexist - fix a typo. 2005-12-30 17:59:23 +00:00
trhodes
412f766852 Make tv_sec a time_t on all platforms but alpha. Brings us more in line with
POSIX.  This also makes the struct correct we ever implement an i386-time64
architecture.  Not that we need too.

Reviewed by:	imp, brooks
Approved by:	njl (acpica), des (no objects, touches procfs)
Tested with:	make universe
2005-12-24 22:22:17 +00:00
kan
7ed4cc5d21 Make lookups for relocations from old unversioned binaries return
oldest versioned symbol available. Do not accept hidden symbols for
all other versions.

Use "<obj->path>: <error message>" for all error messages in new
functions to make them more consistent.
2005-12-24 15:37:30 +00:00
kan
bb7dfbb0a8 Remove debugging statement that slipped into lone of the previous commits
unintentionally.
2005-12-23 15:30:53 +00:00
kan
0abef7d070 Initialize object dagmembers list before checking version dependencies. 2005-12-22 16:42:38 +00:00
kan
8d6f05d58b Implement ELF symbol versioning using GNU semantics. This code aims
to be compatible with symbol versioning support as implemented by
GNU libc and documented by http://people.redhat.com/~drepper/symbol-versioning
and LSB 3.0.

Implement dlvsym() function to allow lookups for a specific version of
a given symbol.
2005-12-18 19:43:33 +00:00
marcel
0a081d09f4 Make our ELF64 type definitions match standards. In particular this
means:
o  Remove Elf64_Quarter,
o  Redefine Elf64_Half to be 16-bit,
o  Redefine Elf64_Word to be 32-bit,
o  Add Elf64_Xword and Elf64_Sxword for 64-bit entities,
o  Use Elf_Size in MI code to abstract the difference between
   Elf32_Word and Elf64_Word.
o  Add Elf_Ssize as the signed counterpart of Elf_Size.

MFC after: 2 weeks
2005-12-18 04:52:37 +00:00
marcel
3394701ae1 Explicitly cast ELF_R_TYPE() to the right type. 2005-12-18 01:38:26 +00:00
jhb
2ef18a36a5 Fix a bug in dlinfo(RTLD_DI_SERINFOSIZE) requests. For each search path
we included the length of the path in the returned size but not the length
of the associated Dl_serpath structure.  Without this fix, programs
attempting to allocate a structure to hold the search path information
would allocate too small of a buffer and rtld would overrun the buffer
while filling it via a subsequent RTLD_DI_SERINFO request.

Submitted by:	"William K. Josephson" wkj at morphisms dot net
Reviewed by:	jdp
MFC after:	2 weeks
2005-11-11 19:57:41 +00:00
ru
e0a06587ac Style: move .PATH to where it belongs. 2005-10-14 15:41:09 +00:00
peter
db8830bc2d Clean out the leftovers from the i386_set_gsbase() TLS conversion.
Like on libthr, there is an i386_set_gsbase() stub implementation here
to avoid libc.so.5 issues.  This should likely be a weak symbol and I
expect this will be fixed soon.

Approved by:	re
2005-06-29 23:15:36 +00:00
ru
e2200cd04b Removed trailing whitespace.
Approved by:	re (blanket)
2005-06-14 08:41:11 +00:00
ru
bd91acfc56 Bump document date on behalf of a recent change.
Approved by:	re (blanket)
2005-06-14 08:40:10 +00:00
nectar
a23214e059 Remove rexecd(8), a server that implements a particularly insecure
method of executing commands remotely.  There are no rexec clients in
the FreeBSD tree, and the client function rexec(3) is present only in
libcompat.  It has been documented as "obsolete" since 4.3BSD, and its
use has been discouraged in the man page for over 10 years.
2005-06-10 20:52:36 +00:00
des
2bb8de20fe Remove kludges intended to support src trees with partial obj trees.
Discussed with:	ru
2005-06-10 06:12:53 +00:00
marius
4eca37e10b MFNetBSD: src/libexec/ld.elf_so/arch/sparc64/mdreloc.c 1.26 (partial)
Fix an obvious bug in the 64-bit PLT fixup: the SLLX was by 12 bits, when
it should be 32.

MFC after:	1 month
2005-06-04 20:49:15 +00:00
marcel
97c723a388 Fix the load64 and store64 macros, created to handle 8-byte unaligned
loads and stores (resp.) The ldq_u and stq_u instruction mask off the
lower 3 bits of the final address before loading from or storing to
the address, so as to avoid unaligned loads and stores. They do not
themselves allow loads from or stores to unaligned addresses. Replace
the macro definitions by a packed struct dereference.

Submitted by: Richard Henderson (rth at twiddle dot net)
2005-06-02 05:34:08 +00:00
maxim
7a5321874f o Missed colon in getopt(3) argument makes tftpd(8) crash. Fix that.
PR:		misc/81732
Submitted by:	Denis Grudkin
MFC after:	2 weeks
2005-05-31 17:22:53 +00:00
eivind
b83d3b8bcc Fixup of last commit: Use the name X instead of XFree86 for the server binary,
thus being compatible with both XFree86 and X.org.

Noticed by: danfe
2005-05-27 06:07:21 +00:00
eivind
5594ff1b13 Make the example for using xterm as a login manager to match the X of the
noughties, not eighties.
2005-05-27 00:39:11 +00:00
dfr
46ba1c3d37 Align the stack to a 16 byte boundary before calling _rtld so that we can
safely initialise shared libraries that use SSE in their init sections.

MFC After: 1 week
2005-05-19 07:32:42 +00:00
keramida
4bf80fbbcf Switch to WARNS=2 instead of tinkering directly with CFLAGS (level 2 was
picked because higher warn levels are broken for ftp-proxy at the moment).

Approved by:	mlaier
2005-05-18 12:19:50 +00:00
obrien
06fef1a964 Enable lukemftpd for 6.0-RELEASE. 2005-05-16 17:12:23 +00:00
ume
e33ba03345 NI_WITHSCOPEID cleanup. Neither RFC 2553 nor RFC 3493 defines
NI_WITHSCOPEID, and our getaddrinfo(3) does nothing special
for it, now.
2005-05-13 16:31:11 +00:00
jmallett
f0d513b44e Spell SHUT_RDWR as SHUT_RDWR not 2 as the how argument to shutdown(2). 2005-05-11 02:43:04 +00:00
jmallett
72198c2a2f Spell SHUT_RDWR as SHUT_RDWR not 1+1 as the how argument to shutdown(2). 2005-05-11 02:41:39 +00:00
delphij
847a7e5295 Prevent usage of nested externs. 2005-05-06 15:28:54 +00:00
davidxu
581ef8042b Fix compilation problem. 2005-04-27 13:17:23 +00:00
peter
55bba67087 Stop calling _amd64_set_gsbase() for COMPAT_32BIT. The amd64 kernel
implements i386_set_gsbase(), so there is no need for the variation.
2005-04-26 20:38:44 +00:00
das
e2b9708f18 s/int/size_t/ as appropriate.
Noticed by:	bde
2005-04-17 01:06:37 +00:00
peter
1fad513bbc Attempt to use i386_set_gsbase(), and gracefully fall back to LDT methods
if the direct access methods are not implemented.
2005-04-14 00:04:50 +00:00
dougb
bb01989367 The script mistakenly ignores the entropy_save_sz variable from
rc.conf[.local]. Fix this, and leave the default as 2048.

Update the copyright year to include the present.

Update the assignment of the copyright to be me personally,
instead of "The FreeBSD Project" which is not a legal entity,
and therefore not a proper assignee. My intention remains the
same however, that this code continue to be BSD licensed, and
freely available to anyone that wants it under those terms.

PR:		conf/75722
Submitted by:	Nicolas Rachinsky <list@rachinsky.de>
2005-04-11 02:07:33 +00:00
des
ca18f36fa5 Revert parts of previous commits and use a temporary variable to avoid
an invalid type pun.
2005-04-08 11:19:50 +00:00
cognet
6bb6868e16 No need to provide atomic_cmpset_32() anymore. 2005-04-07 22:04:49 +00:00
nectar
32eab0f970 An array was mistaken for a pointer in the previous commit.
Noticed by:	tinderbox, stefanf
Pointy hat to:	nectar
2005-04-07 19:26:35 +00:00
stefanf
e45b89dcfd Include gettytab.h before extern.h so that the declarations of struct
gettyflags, gettynums and gettystrs are available.
2005-04-06 17:42:24 +00:00
nectar
816af95a77 Correct type mismatch introduced in last commit.
Noticed by:	Steve Kargl <sgk@troutmask.apl.washington.edu>
2005-04-05 18:25:27 +00:00
nectar
6435ce940d DES pointed out that the PAM layer may change the target user name
during authentication.  Thus we need to call getpwnam *after* the user
has been authenticated.  Colin mentioned that we should also move the
check for root in that case.
2005-04-05 14:55:33 +00:00
dfr
cfeb84df7a When allocating TLS and DTV, make sure that any unused slots in the DTV
are initialised to zero. When freeing TLS, don't attempt to free DTV
slots which were not used.

Pointed out by: Joerg Sonnenberger
X-MFC-After: After the branch, probably
2005-03-30 08:28:26 +00:00
nectar
8f12f32e0d When PAM support was added to rexecd in revision 1.29 (just prior to
5.0-RELEASE), a visually elusive bug was introduced.  A comparison
operator was changed to assignment.  As a result, rexecd behaved
always as if the `-i' option had been specified.  It would allow root
logins.  This commit corrects the situation in the obvious way.

A separate bug was introduced at the same time.  The PAM library
functions are called between the invocation of getpwnam(3) and the use
of the returned static object.  Since many PAM library functions
result in additional getpwnam(3) calls, the contents of the returned
static object could be changed from under rexecd.  With this commit,
getpwnam_r(3) is used instead.

Other PAM-using applications should be reviewed for similar errors in
getpw* usage.

Security:	rexecd's documented default policy of disallowing root
		logins was not enforced.
Reviewed by:	cperciva
2005-03-27 13:59:44 +00:00
cperciva
fdbab8722b If "dangerous" environment variables (LD_PRELOAD, LD_LIBMAP,
LD_LIBMAP_DISABLE, LD_LIBRARY_PATH) are used, then make sure the
libraries being loaded aren't on a noexec-mounted filesystem.

This is a compromise position: I'm assuming that nobody will be silly
enough to set the noexec mount flag on part of the default library
path, in order to avoid adding extra overhead into the common case
(where those environment variables aren't used).

Discussed with:	csjp, secteam
MFC after:	1 week
2005-03-24 10:12:29 +00:00
das
930b2ee454 Use sysconf(_SC_ARG_MAX) instead of NCARGS. 2005-03-21 08:01:14 +00:00
davidxu
4da02be559 Add locking code for tls routines. 2005-03-20 23:28:25 +00:00
ru
860c6fe96a Install rlogind(8). Pointy hat is available on request. 2005-03-03 15:59:32 +00:00
trhodes
792676bbc2 Wrap BSD r* commands in NO_RCMDS.
Change NO_RCMDNS to NO_RCMDS and do the switch in bsd.compat.mk.

Discussed with: ru, nectar
2005-03-02 11:53:22 +00:00
ume
2da58c2233 correct WARNS=6 fix to use cast to (void *).
use of struct sockaddr_strage * is thought as not good manner. :)
2005-03-01 10:55:06 +00:00
dfr
0c34e7e727 Attempt to free any static TLS space used by a shared library when it
is unloaded. This allows applications which load and unload libraries
like libGL.so.1 several times to work properly.

MFC after: 2 days
2005-02-27 12:55:40 +00:00
cognet
3eb9286d7e Only provide the dummy, non-atomic atomic_cmpset_32() if
ARM_HAS_ATOMIC_CMPSET_32 isn't defined.
2005-02-26 22:49:19 +00:00
des
235eb699e1 If what we have is a struct sockaddr_storage * and what we want is a
struct sockaddr_storage *, there's no point in casting it prematurely
to a struct sockaddr *.  This unbreaks WARNS=6 on sparc64.
2005-02-23 21:26:55 +00:00
des
6b77db7044 Make WARNS=6-clean. 2005-02-23 17:13:28 +00:00
yar
e7b22678a4 Add some consistency checks to the signal-related code.
MFC:	along with rev. 1.202
2005-02-16 11:35:51 +00:00
yar
631e693b39 A call to maskurg() makes sense only when a transfer is under way,
the function will emit an annoying log message otherwise.

Reported by:	kris
MFC:		along with rev. 1.202
2005-02-16 11:22:20 +00:00
stefanf
08dca4373d - Use socklen_t.
- No need for 'fromlen' to have file scope.
- Remove an unused variable.
2005-02-14 17:59:52 +00:00
stefanf
03a2de3818 Fix most cases where the address of an int is passed to a function expecting a
socklen_t * argument.
2005-02-14 17:42:58 +00:00
ru
6b6b8c04f6 Expand contractions. 2005-02-13 23:45:54 +00:00
ru
1541af42f1 Expand *n't contractions. 2005-02-13 22:25:33 +00:00
ru
ad21eaf4a1 Sync program's usage() with manpage's SYNOPSIS. 2005-02-09 20:36:12 +00:00
ru
349a29d45a Removed Kerberos remnants. 2005-02-09 20:23:36 +00:00
ru
8f0a058ccf The only user of this utility (share/man/man0) was removed 2+ years ago. 2005-02-09 19:50:45 +00:00
mdodd
07c084eb10 Description from Dan:
Another handy libmap patch.  Lets you do stuff like this:

	LD_LIBMAP="libpthread.so.1=libthr.so.1" mythreadedapp

	If you already have a program-specific override in libmap.conf, note
	that you must use a program-specific override in LD_LIBMAP:

	LD_LIBMAP="[mythreadedapp],libpthread.so.1=libthr.so.1" mythreadedapp

PR:		bin/74471
Submitted by:	Dan Nelson <dnelson AT allantgroup.com>
MFC after:	2 weeks
2005-02-04 02:46:41 +00:00
mdodd
c0a4f2af34 style(9) 2005-02-04 02:13:37 +00:00
ru
e68efdc747 Let bsd.prog.mk set SRCS and MAN to their default values. 2005-01-28 16:08:11 +00:00
yar
2f9f83ffc7 Respect the `logging' flag.
Pointed out by:	Nick Leuta
MFC after:	3 days
2005-01-19 10:49:40 +00:00
yar
e3e66eec0c Improve handling SIGURG and OOB commands on the control channel.
The major change is to process STAT sent as an OOB command w/o
breaking the current data transfer.  As a side effect, this gives
better error checking in the code performing data transfers.

A lesser, but in no way cosmetic, change is using the flag `recvurg'
in the only signal-safe way that has been blessed by SUSv3.  The
other flag, `transflag,' becomes private to the SIGURG machinery,
serves debugging purposes only, and may be dropped in the future.

The `byte_count' global variable is now accounting bytes actually
transferred over the network.  This can give status messages looking
strange, like "X of Y bytes transferred," where X > Y, but that has
more sense than trying to compensate for combinations of data formats
on the server and client when transferring ASCII type data.  BTW,
getting the size of a file in advance is unreliable for a number of
reasons in the first place.  See question 18.8 of the Infrequently
Asked Questions in comp.lang.c for details.

PR:		bin/52072
Tested by:	Nick Leuta (earlier versions), a stress-testing tool (final)
MFC after:	1 month
2005-01-19 10:33:20 +00:00
ru
d95b3c4c8d Sort sections. 2005-01-18 09:29:40 +00:00
delphij
830453071a 64-bit clean + WARNS=6:
- Convert the (char *) cast+cast backs magic to
	  memcpy(3).  Without this, the resulting code
	  is potentially risky with higher optimization
	  levels.
	- Avoid same name when calling local variables,
	  as well as global symbols.  This reduces
	  confusion for both human and compiler.
	- Add necessary casts, consts
	- Use new style function defination.
	- Minor style.Makefile(5) tweak
	- Bump WARNS?= from 0 to 6

** for the aout code: changes are intentionally limited
   to ease maintaince.
2005-01-14 12:22:57 +00:00
trhodes
4fcbaea729 Restore these files to make ldconfig(8) happy. 2005-01-11 16:40:29 +00:00
trhodes
8af8fbaa58 Remove a.out runtime linker. It doesn't build and was removed from the
build over two years ago by peter.

The binary a.out version of ld.so can be obtained from misc/compat22 or
src/lib/compat/compat22.

Discussed on:	-arch
Voted yes:	jhb, ru, linimon, delphij
2005-01-11 06:15:19 +00:00
yar
d9ac4c4879 Replace err(3) calls when in daemon mode by syslog(3), too.
A daemon has no stderr to send its complains to.

Pointed out by:	Nick Leuta
MFC after:	1 week
2005-01-10 12:19:11 +00:00
ru
c8158555ed NOPAM -> NO_PAM 2004-12-21 12:49:24 +00:00
ru
5c04306fea NOINET6 -> NO_INET6 2004-12-21 10:49:29 +00:00
ru
f4c44b761b NOCRYPT -> NO_CRYPT 2004-12-21 10:16:04 +00:00
ru
74176cc161 NODOCCOMPRESS -> NO_DOCCOMPRESS
NOINFO -> NO_INFO
NOINFOCOMPRESS -> NO_INFOCOMPRESS
NOLINT -> NO_LINT
NOPIC -> NO_PIC
NOPROFILE -> NO_PROFILE
2004-12-21 09:33:47 +00:00
ru
cec60429bb Start the dreaded NOFOO -> NO_FOO conversion.
OK'ed by:	core
2004-12-21 08:47:35 +00:00
yar
32ba549445 Do a small style(9) fix before I'm hacking the code itself. 2004-12-16 07:27:28 +00:00
yar
33935e064e free(3) is void already. 2004-12-16 07:17:56 +00:00
yar
1a2e300653 Never emit a message to stderr: use syslog instead.
When in inetd mode, this prevents bogus messages from
appearing on the control channel.  When running as a
daemon, we shouldn't write to the terminal we used to
have at all.

PR:		bin/74823
MFC after:	1 week
2004-12-12 17:30:28 +00:00
cognet
d983d8756d Implement a dummy atomic_cmpset_32(). It should be safe to use it in rtld as
the signals are masked anyway.
2004-11-23 16:32:34 +00:00
yar
a4b5efda6e When looking for a virtual host to handle the connection,
stop the search on the first match for efficiency.

Submitted by:	Nick Leuta
2004-11-22 11:10:04 +00:00
yar
c859d46011 Calling pam_chauthtok() isn't really needed since
an FTP user has no chance to change password anyway.

Submitted by:	Nick Leuta
2004-11-22 11:02:42 +00:00
yar
0570780491 Don't log the chroot dir on every command since it's constant for a session.
Log it once at the beginning of the session instead.  OTOH, log wd each
time for the sake of better auditing and consistent log format.

Proposed by:	Nick Leuta <skynick -at- mail.sc.ru>
2004-11-22 10:48:29 +00:00
yar
87abae189e Always log remote IP.
PR:		bin/59773
2004-11-22 10:27:16 +00:00
yar
806e7b8b99 Treat host name buffers consistently. 2004-11-22 10:16:43 +00:00
yar
604b588faf Make chrootdir global and use it in log messages
regarding restricted users.

MFC after:	2 weeks
2004-11-18 14:15:32 +00:00
yar
d46c701ed5 Nitpicking on style(9) and whitespace.
Tested with:	md5(1)
2004-11-18 13:55:15 +00:00
yar
b18d29fccd Use __FBSDID. 2004-11-18 13:46:29 +00:00
yar
47da99e1ad Don't say, "file: permission denied," if the operation
is disabled entirely.
2004-11-18 11:50:01 +00:00
yar
e3b3851567 Use uniform punctuation, capitalization, and language style
in server messages wherever this doesn't contradict to a particular
message format.
2004-11-18 11:45:13 +00:00
yar
81121bedaf Apply __printflike() to the appendf() prototype so the compiler
can detect format errors.
2004-11-18 11:32:35 +00:00
yar
a6025b1cf1 Fix perror_reply() vs. reply() usage. 2004-11-18 11:27:31 +00:00
yar
3851ed3f4f '\n' needs not to appear in reply() strings. 2004-11-18 11:07:00 +00:00
yar
750c661453 Log pathname arguments to ftp commands as the user specified them;
add the working directory pathname to the log message if any of
such arguments isn't absolute.  This has advantage over the old
way of logging that an admin can see what users are actually trying
to do, and where.  The old code was also not too robust when it
came to a chrooted session and an absolute pathname.

Pointed out by: Nick Leuta
MFC after:      2 weeks
2004-11-18 10:02:28 +00:00
yar
6cd7428b13 Use S_ISDIR() macro instead of a hand-rolled test. 2004-11-18 09:26:58 +00:00
yar
28f076df82 getcwd() won't leave a error string in the buffer, unlike getwd(). 2004-11-18 00:14:09 +00:00
yar
95ee012f23 Use POSIX functions instead of legacy ones:
getwd() -> getcwd()
	wait3() -> waitpid()
2004-11-17 22:43:46 +00:00
yar
5bdd791606 Kill more unneeded casts found.
Noticed by:	Nick Leuta <skynick -at- mail.sc.ru> (some of them)
2004-11-17 11:52:41 +00:00
jhb
59f4aaaef0 Remove 80386 support from the ELF run time linker. 2004-11-16 20:45:51 +00:00
yar
ddaaf2c2ee Don't invent ways of capitalization orthogonal to the English grammar. 2004-11-15 12:47:44 +00:00
yar
93c067539e RFC 959 states that the following codes should be used
for status replies on file system objects:

 212 Directory status.
 213 File status.

Reported by:	Oleg Koreshkov <okor -at- zone.salut.ru>
MFC after:	1 week
2004-11-15 12:41:56 +00:00
ru
1808b89247 So do it like we do in usr.bin/tip/tip/Makefile. ;) 2004-11-14 22:18:31 +00:00
schweikh
de23b48160 Revert previous commit. As ru explains:
In the old world (as the surrounding comment in makefile says), there
 was the /usr/libexec/ld-elf.so.1 binary which is now a symlink to
 /libexec/ld-elf.so.1. To symlink, we need to make sure that the
 _target_ (and the target is /usr/libexec/ld-elf.so.1) doesn't have
 "schg" flag set. A real solution is to protect the chflags call only if
 target exists, like we do in usr.bin/tip/tip/Makefile.

Requested by:	ru
2004-11-14 21:14:06 +00:00
schweikh
d2fd075432 Avoid an (ignored) error by invoking chflags on the link target, not the
symlink.

PR:		kern/73016
Submitted by:	John E. Hein <jhein@timing.com>
MFC after:	1 week
2004-11-14 12:47:20 +00:00
bz
4b83c5852a Add knob NO_NIS (fka NO_YP_LIBC) and make world compileable when set.
If turned on  no NIS support and related programs will be built.

Lost parts rediscovered by:	Danny Braniss <danny at cs.huji.ac.il>
PR:		bin/68303
No objections:	des, gshapiro, nectar
Reviewed by:	ru
Approved by:	rwatson (mentor)
MFC after:	2 weeks
2004-11-13 20:40:32 +00:00
yar
c9044cf500 Using off_t to pass a block size is obvious overkill.
The size_t type is better suited for that, particularly because
the "blksize" argument is to be passed to malloc() and read().
On 64-bit archs it's more to a style issue, but the good style
of coding in C is also important.
2004-11-13 13:42:43 +00:00
yar
9e5ec41335 Kill ancient casts to integral types left from the K&R era.
They're unneeded and sometimes erroneous now.
2004-11-13 13:15:47 +00:00
jhb
c60825dcfe Remove these unused files before any other archs include the same bogus
file.
2004-11-12 18:05:30 +00:00
peter
39432ffbdf The 32 bit compatability ld-elf32.so.1 cannot use i386_set_ldt() when
running on an amd64 kernel.  Use the recently exposed direct %fs/%gs set
routines instead for the TLS setup of 32 bit binaries.
2004-11-06 03:32:07 +00:00
ru
f0fbc30e0d Introduce the PRECIOUSPROG knob in bsd.prog.mk, similar
to PRECIOUSLIB from bsd.lib.mk.  The side effect of this
is making installing the world under jail(8) possible by
using another knob, NOFSCHG.

Reviewed by:	oliver
2004-11-03 18:01:21 +00:00
yar
77ad2555a3 Fix logxfer() by using realpath(3) instead of playing with getwd(3).
Previously logxfer() used to record bogus pathnames to the log
in some cases, namely, when cwd was / or "name" was absolute.

Noticed by:	Nick Leuta
MFC after:	2 weeks
2004-11-03 06:52:40 +00:00
yar
9ff4238c2a Replace the last occurence of (long long) and %qd with
(intmax_t) and %jd, which is the right way to printf
an off_t in the presence of <stdint.h>.

Submitted by:	Nick Leuta
2004-11-02 18:48:44 +00:00
ssouhlal
7cf9959da0 Implement TLS relocations for powerpc.
Approved by:	grehan (mentor)
2004-11-02 09:47:01 +00:00
ssouhlal
d6dc36dcc0 Do the TLS offset allocations before relocations, as otherwise there
can be overlap in the TLS offsets, if the relocations are done in a
certain order.

Approved by:	dfr, grehan (mentor)
2004-11-02 09:42:21 +00:00
yar
75e4d56d9f OpenPAM allows passing a NULL "pamh" to pam_strerror() to indicate
that the creation of a PAM context has failed.

N.B. This does not apply to pam_strerror() in RELENG_4, it
will mishandle a NULL "pamh".

Discussed with:	des
2004-11-01 16:05:57 +00:00
yar
610346f6c5 - Stop shadowing global "pamh" by a local variable in auth_pam().
- Stop calling pam_strerror() with NULL pamh.
- Add a missing call to pam_end().

PR:		bin/59776
Submitted by:	Nick Leuta <see PR for email>
MFC after:	2 weeks
2004-10-30 17:30:56 +00:00
yar
4e42ff84eb Describe the semantics of the sgetpwnam() helper function
in the comment above it so that nobody will save pointers
returned inside "struct passwd" across the calls to the function.
2004-10-30 16:11:15 +00:00
yar
9167ecf0cb Log the actual number of bytes sent on the wire to /var/log/ftpd
instead of the disk size of the file sent.   Since the log file
is intended to provide data for anonymous ftp traffic accounting,
the disk size of the file isn't really informative in this case.

PR:		bin/72687
Submitted by:	Oleg Koreshkov
MFC after:	1 week
2004-10-24 20:12:08 +00:00
ru
5db2b9d5b3 For variables that are only checked with defined(), don't provide
any fake value.
2004-10-24 15:33:08 +00:00
stefanf
8d3bcc2e7a Remove definition of struct dom_binding, it's non-standard C code and
unnecessary since src/include/rpcsvc/ypclnt.h's revision 1.10.
2004-10-17 19:33:33 +00:00
yar
6cff4ecf57 We must not fall back to the old way (read-write)
if sendfile() transferred some data before throwing
a error condition because sendfile() won't move the
file offset for read() to start from.

MFC after:	2 weeks
2004-10-15 09:51:36 +00:00
yar
e6e865ec71 Clean-up around sendfile(): drop an excessive check for error condition. 2004-10-15 09:38:13 +00:00
yar
3cdbfddc40 Account for the fact that sendfile(2) may hit the end of file
prematurely, e.g., if the file has been truncated by someone else.

PR:		bin/72649
Submitted by:	Oleg Koreshkov (portions)
MFC after:	2 weeks
2004-10-15 09:31:08 +00:00
schweikh
e129b0abc5 Correct grammos. Added BUGS: may mishandle nonstandard manual pages,
especially third party junk^Wpages, like emulators/mtools(1) and friends.
2004-10-06 18:31:45 +00:00
imp
e1f9385d4b Report once that the device isn't there, but keep trying. Don't
filter the errno values.  They don't make as much sense as they used
to given how we do devices in /dev.
2004-09-29 20:55:14 +00:00
cognet
504d9a68b3 Don't try to relocate the dynamic loader in reloc_non_plt(). It has already
been done before.
2004-09-28 14:43:12 +00:00
cognet
a450d7f91f Use add instead of saving the sp in a register. 2004-09-28 14:41:15 +00:00
maxim
41902e813d Indent. 2004-09-24 13:22:45 +00:00
maxim
b218fbfba3 o Merge rev. 1.5 libexec/ftpd/ftpd.c from DragonflyBSD:
Do not unconditionally fork() after accept().  accept() can
  return -1 due to an interrupted system call (i.e. SIGCHLD).
  If we fork in that case ftpd can get into an
  accept()/SIGCHLD/fork/[fail]/repeat loop.

  Reported-by: fabian <fabian.duelli@bluewin.ch>

Obtained from:	DragonflyBSD
MFC after:	1 month
2004-09-24 13:21:52 +00:00
cognet
f73db50f56 Add stubs for TLS.
Arbitraly choose the 2nd variant until I figure out which one I should use.
2004-09-23 23:04:52 +00:00
trhodes
97ba99e4ad Remove named-xfer, it does not exist in BIND 9. 2004-09-22 14:17:56 +00:00
des
a4c12f8006 Switch from BIND 8 to BIND 9.
Submitted by:	(in part) dougb@, trhodes@
Reviewed by:	dougb@, trhodes@, re@
MFC after:	5 days
2004-09-21 19:01:48 +00:00
maxim
6c3a896977 Avoid accidental use of ANSI C trigraphs.
Spotted by:	Pawel Worach
Obtained from:	NetBSD (rev. 1.11, 1.13)
2004-08-21 07:23:41 +00:00
obrien
22dcfa59a7 Add some details about our wonderful system. 2004-08-21 03:36:47 +00:00
obrien
a1194af70b Turn on the FreeBSD login user capabilities database support. 2004-08-18 06:46:25 +00:00
marius
24ad8a9842 Instead of "OpenFirmware", "openfirmware", etc. use the official spelling
"Open Firmware" from IEEE 1275 and OpenFirmware.org (no pun intended).

Ok'ed by:	tmm
2004-08-16 15:45:27 +00:00
cperciva
e629b37603 Join the 21st century: Cryptography is no longer an optional component
of releases.  The -DNOCRYPT build option still exists for anyone who
really wants to build non-cryptographic binaries, but the "crypto"
release distribution is now part of "base", and anyone installing from a
release will get cryptographic binaries.

Approved by:	re (scottl), markm
Discussed on:	freebsd-current, in late April 2004
2004-08-06 07:27:08 +00:00
dfr
c42f6bfee0 Add stubs for powerpc TLS.
Submitted by: ssouhlal
2004-08-04 19:12:14 +00:00
dfr
4e9853427f Add support for Thread Local Storage. 2004-08-03 08:51:00 +00:00
yar
55224f76bf ftpd(8) seems to be WARNS=2 clean now.
Tested on:	i386, ia64, amd64, sparc64, alpha
2004-07-31 15:07:33 +00:00
yar
d786b94f15 Change `(foo *)0'' to `NULL'' where it's possible
(and it appears possible throughout ftpd(8) source.)

It is not a mere issue of style: Null pointers in C
seem to have been mistaken one way or another quite often.
2004-07-31 15:03:17 +00:00
yar
06b7ed859f Kill a small herd of casts to off_t where they were not needed.
Thank Fortune, the C compiler can figure out by itself the proper
conversion for assignments, comparisons, and prototyped function
arguments.
2004-07-31 14:46:41 +00:00
yar
634a2a6e4f Printf(3) off_t values through conversion to intmax_t since
we've got <stdint.h> et al now.  (This makes ftpd(8) WARNS=2 clean.)
2004-07-31 14:22:02 +00:00
yar
6f57f3272c Kill an unused variable (heading to WARNS=2.) 2004-07-31 14:03:59 +00:00
yar
81692845b8 Convert a couple of bogus null statements to the right form.
(Heading to WARNS=2.)
2004-07-31 14:03:14 +00:00
yar
4cacae89d9 Ditto for (gid_t). 2004-07-30 17:30:07 +00:00
yar
dc8c8c95c0 Kill casts to (uid_t) obviously left from the K&R era.
Prototyping library functions in header files has rendered
them superfluous.
2004-07-30 17:27:23 +00:00
yar
8839880434 Add a comment to explain that the loop around the call to bind(2)
is not a hack, but it has a clear purpose.
2004-07-30 17:18:57 +00:00
yar
9fb1cda8d0 Open a socket for a data transfer in active mode using euid
of the current user, not root.  This will allow neat things
like matching anonymous FTP data traffic with a single ipfw(8)
rule:
	ipfw add ... tcp from any to any uid ftp

Note that the control connection socket still belongs to the
user ftpd(8) was started from, usually root.

PR:		bin/65928
Submitted by:	Eugene Grosbein <eugen at grosbein.pp.ru>
MFC after:	1 month
2004-07-30 16:57:42 +00:00
kan
44ddf6cddd Call nmatch function with parameters casted to types the function actually
expects.
2004-07-29 18:05:20 +00:00
stefanf
e0b2a5b339 Fix a few cases that relied on 'implicit int' (constraint violation in C99). 2004-07-11 17:37:33 +00:00
ru
9f45c1d92e mdoc(7) fixes. 2004-07-07 19:57:16 +00:00
stefanf
9dea8aeba1 Consistently use __inline instead of __inline__ as the former is an empty macro
in <sys/cdefs.h> for compilers without support for inline.
2004-07-04 16:11:03 +00:00
ru
305463f129 Deal with double whitespace. 2004-07-03 00:06:28 +00:00
ru
20fbd172b2 Mechanically kill hard sentence breaks. 2004-07-02 21:28:50 +00:00
ru
4b39413aeb Removed trailing whitespace. 2004-07-02 19:07:33 +00:00
csjp
78ac741f00 The call to setuid(2) subsequently causes setgroups(2) to fail. setgroups(2)
requires super-user access in order to complete successfully.
Move setgroups(2) to execute before setuid(2) so that it is successful.
2004-06-30 18:58:19 +00:00
phk
f899356ae4 Nuke COMPAT_43 2004-06-25 10:11:28 +00:00
brian
453b5a4b34 Call tzset() at startup.
Submitted by:	Andrzej ToboÅa <ato@iem.pw.edu.pl>
2004-06-21 10:47:12 +00:00
brian
86ff38aa6a 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
1dc333167a 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
98a02072fc This comment should have been removed in the previous commit.
Spotted out by: marcus, simon
2004-06-17 19:01:53 +00:00
cognet
42e5ac9f05 Woohoo !
the latest binutils import mades this gross hack useless, so just remove it.
2004-06-17 17:53:16 +00:00
obrien
536504fc3c 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
0ac1bd72be Fall out from Binutils 2.15: don't bulid the ld.so on Sparc64. 2004-06-17 03:04:24 +00:00
bms
34bae8c803 Whitespace. 2004-06-14 22:44:13 +00:00
bms
bf98536752 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