Commit Graph

2799 Commits

Author SHA1 Message Date
joerg
854e6cd69f Add TLS support for AMD64, i386 and SH3.
This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.
2011-03-12 22:54:36 +00:00
bouyer
72918bae56 Define qfextension here 2011-03-12 12:30:39 +00:00
matt
130f2d3d4c Add TLS support for PowerPC.
If the port has __lwp_gettcb_fast or __lwp_settcb use them instead of
__lwp_getprivate_fast or lwp_setprivate.
2011-03-12 07:43:53 +00:00
joerg
7197db08bd Add some clarifications 2011-03-10 17:38:30 +00:00
joerg
9c18c3d543 Add source reference for _lwp_makecontext and
__HAVE___LWP_GETPRIVATE_FAST. Fix enumeration.
2011-03-10 17:22:17 +00:00
reed
728c26c193 A filename with a colon in it made it appear to be the URI scheme
to various web browsers. So follow RFC 3986 4.2 and prepend ./
to the filename in the generated index hyperlink.

Okayed by mrg.
2011-03-10 14:39:40 +00:00
reed
92d8a7ba74 Fix typo. 2011-03-10 14:37:16 +00:00
joerg
de4cf97515 Fix prototype for __tls_get_addr. Add a generic implementation of it
using __tls_get_addr. Update TLS notes.
2011-03-10 14:27:31 +00:00
skrll
ff1072d23a Whitespace. 2011-03-10 12:53:42 +00:00
joerg
aad599979d Add TLS support infrastructure. For dynamic binaries, ld.elf_so exports
_rtld_tls_allocate and _rtld_tls_free. libpthread uses this functions to
setup the thread private area of all new threads. ld.elf_so is
responsible for setting up the private area for the initial thread.
Similar functions are called from _libc_init for static binaries, using
dl_iterate_phdr to access the ELF Program Header.

Add test cases to exercise the different TLS storage models. Test cases
are compiled and installed on all platforms, but are skipped on
platforms not marked for TLS support.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.

It is inspired by the TLS support in FreeBSD by Doug Rabson and the
clean ups of the DragonFly port of the original FreeBSD modifications.
2011-03-09 23:10:05 +00:00
bouyer
063f96f3c2 merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
2011-03-06 17:08:10 +00:00
matt
4fee4fe7b3 Don't rely on >32bit math. 2011-03-04 00:40:48 +00:00
pooka
33ee52c7dc make DEBUG compile without RTLD_DEBUG 2011-02-24 10:58:54 +00:00
matt
483a1c95a2 Fix problem with bss-plt objects which a reloc index, not offset.
(secure-plt uses an offset (index*sizeof(rela), bss-plt uses an index)
secure-plt will now take the offset and divide by 12 for an index.
2011-02-10 02:28:20 +00:00
pooka
eb725c2168 Call daemon() later to make sure there is a listening socket by
the time the foreground process exits.

discussed with mrg.
2011-02-06 19:00:53 +00:00
skrll
3770380428 Unbreak gdb by ensuring _rtld_debug_state is in the dynamic symbol table.
mmm 1 line diffs

mmm not breaking backwards compatibility for anything known/unknown or
public/private.
2011-01-25 12:25:43 +00:00
matt
709c8a2f01 Move powerpc gotptr to the end to preserve binary compatibility. 2011-01-16 15:56:37 +00:00
matt
b094d98191 Warn about DT_TEXTRELs 2011-01-16 02:36:05 +00:00
matt
d31dbd7578 Add secure-plt support for powerpc to ld.elf_so. As part of this, we have to
stop calling into the GOT/_DYNAMIC since they are no longer executable.
2011-01-16 01:22:29 +00:00
christos
bfd4da8575 PR/44390: Paul Koning: make code gcc-4.5.1 friendly. 2011-01-14 23:56:13 +00:00
pooka
09159e5c0a Make sure bozo_auth_check_401() isn't called with a NULL "request".
reviewed by mrg
2011-01-12 19:29:24 +00:00
plunky
f302f6417c the Name for this manpage is "ld.aout_so". Use it. 2011-01-01 16:34:52 +00:00
skrll
f1d73a2c94 Add support for DF_1_BIND_NOW, DF_1_NODELETE and DF_1_NOOPEN marked
objects, and the RTLD_NODELETE and RTLD_NOLOAD flags to dlopen(3).

Mark libpthread as DF_1_NOOPEN and use it to test the functionality.

Somewhat taken from FreeBSD.

Fixes PR 42029.

OK from christos and joerg.
2010-12-24 12:41:42 +00:00
mlelstv
e5275d16e0 Deduce raw device correctly by prepending "r" to basename. 2010-12-23 18:08:41 +00:00
skrll
1f45aab781 Sprinkle some KNF. 2010-12-19 17:26:51 +00:00
skrll
ad7786ec8b Remove unnecessary #ifdef RTLD_DEBUG 2010-12-19 17:17:50 +00:00
wiz
617acddc41 Remove superfluous Pp. 2010-12-17 08:50:26 +00:00
skrll
1ee8ff33ba Remove implementation detail.
Bump date.
2010-12-17 07:04:52 +00:00
joerg
c4120e324e Replace use of errlist with a single concatenated version and an offset
array. This requires less storage and avoids one runtime relocation per
errno value.
2010-12-16 22:52:32 +00:00
joerg
67cc8c0871 Don't use normal environment handling functions from libc, but iterate
once over the array and clean out entries as needed.
2010-12-16 22:47:27 +00:00
skrll
126c589398 s/rdbg/dbg/ in a few places. 2010-12-16 19:59:39 +00:00
skrll
76d5f138f4 Remove incorrect comment. 2010-12-16 19:35:38 +00:00
wiz
fbc697a1ed Note that $ORIGIN kernel support (in kern/kern_exec.c) is currently disabled.
Info from skrll@.
Bump date.
2010-12-16 19:25:41 +00:00
tls
eaa351b215 When invoking a content handler specified via -C, set the REDIRECT_STATUS
CGI variable to "200".  This approximates the Apache behavior which is
required by phpcgi in PHP 5.3 (and by some compilations of older PHP
versions).

I have a revolutionary idea.  Perhaps instead of imposing bizarre
requirements on other programs in the name of "security", the PHP
developers should make their own code compile with oh, I don't know,
maybe -Wuninitialized.  That might have an effect on the security of
systems using PHP rather than on the "security" of such systems...

...excuse me, got to go now, I think my airquotes just wore out.
2010-12-14 13:27:39 +00:00
joerg
67e01e0a99 Build ld.elf_so with -fvisibility=hidden. Exploit this for i386/x86_64
to simplify the assembler code.
2010-12-05 00:56:06 +00:00
joerg
91118529e4 ANSIfy 2010-12-03 23:07:49 +00:00
joerg
239c31f883 Add comment about the unusual stack alignment in .rtld_bind_start. 2010-12-03 22:48:25 +00:00
tron
1fbd900608 Don't use internal libc function __findenv(). 2010-11-14 22:09:16 +00:00
christos
acfd35dad9 PR/44010: YAMAMOTO Takashi: sbrk: grow 0xb3ba2000 failed, error = 12"
(due to setenv changes?)
Provide a mini unsetenv that does not allocate/free memory and does not
bother about locking.
2010-10-29 15:08:17 +00:00
skrll
8b916d603d Add cast so that usr.bin/ldd/elf32 builds. 2010-10-16 17:48:12 +00:00
skrll
e6cdac9c4b Implement dl_iterate_phdr.
Somewhat taken from FreeBSD. Manual page from OpenBSD.
2010-10-16 10:27:06 +00:00
skrll
0a77584d8f Revert previous for now. It's part of a larger commit which will arrive
soon.
2010-10-15 15:08:05 +00:00
skrll
a048346afd Be more tolerant to the location of PT_PHDR in the segment list. 2010-10-15 07:22:44 +00:00
christos
45bdf1678c restore binary compatibility for pre-2.0 binaries, requested by skrll and core. 2010-10-10 21:27:16 +00:00
skrll
a108583dc7 Oops. Remove trailing whitespace in previous. 2010-09-30 19:45:24 +00:00
skrll
d965c46816 Improve debug output. 2010-09-30 19:43:11 +00:00
skrll
0e07ba7138 Add the magic branch instruction that is used by GCC's
__canonicalize_funcptr_for_compare() function to fixup relocations in
order to do function pointer comparisons.

From OpenBSD.
2010-09-30 19:32:40 +00:00
skrll
06acf46b03 Introduce a new type Elf_Symindx for use in decoding the symbol hash table
section and allow this type to be overridden.

The ELF specification says it should always be uint32_t (Elf_Word), but
alpha decided to be different (not sure why). Define Elf_Symindx to be
uint64_t on alpha.

Alpha no longer uses non-standard definitions of Elf64_Sword and
Elf64_Word.  Remove the ability to override these types.

Fixes ld.elf_so after Herculean effort from me and martin.
2010-09-30 09:11:18 +00:00
matt
af56990d0c Make the GOT1_MASK 64-bit clean. 2010-09-24 15:20:52 +00:00
skrll
8f77c5159b Comment reformat. 2010-09-24 12:00:10 +00:00
skrll
2c56298dd9 Wrap long line. 2010-09-24 11:59:28 +00:00
skrll
09601c884f Whitespace. 2010-09-24 11:57:11 +00:00
skrll
6229c56fea Wrap long lines
Reformat comments.
2010-09-24 11:41:46 +00:00
joerg
11fdf81f84 Avoid casting from d_val to plttype of different signedness.
Just two booleans for the same purpose.
2010-09-23 13:03:35 +00:00
wiz
8d65c98f7a Fix typo. 2010-09-21 07:05:28 +00:00
mrg
df5be5736c merge bozohttpd 20100920 2010-09-20 23:11:38 +00:00
mrg
729c374954 initial import of bozohttpd 20100920. the only change missing in here is:
o  fix dynamic CGI content maps, from rudolf
2010-09-20 23:07:21 +00:00
mrg
44128f48a9 fix an error in the previous. 2010-09-20 22:18:22 +00:00
mrg
109d4102cc fix a serious error in virtual hosting support, noticed by seanb@netbsd,
and disallow ".." as a virtual host name!  also ".".

patch from sean.
2010-09-20 21:58:43 +00:00
skrll
07666b6356 Wrap long line. 2010-09-11 11:11:52 +00:00
mrg
e0a4d05008 fix another compile error if NO_DAEMON_MODE is defined. also from rudolf. 2010-09-09 04:41:49 +00:00
mrg
f3a95c474f fix a compile error if NO_DIRINDEX_SUPPORT is defined. from rudolf. 2010-09-08 00:47:44 +00:00
pooka
0fb1ef7452 Don't exit when running as a lib after FS is unmounted, just return
from the mainloop.
2010-08-16 22:11:55 +00:00
dogcow
172b076ece ...and free() memory malloc()ed by scandir so we don't leak. 2010-08-16 18:32:44 +00:00
dogcow
035f1ce17b readdir -> scandir and requisite changes, so that bozohttpd now sorts
directory listings.
2010-08-16 10:00:56 +00:00
joerg
6972211664 Stricter matching for _rtld_invalid_paths by ensuring separator.
Use mem* functions instead of str* for strings of known size.
2010-08-07 19:47:34 +00:00
joerg
f40b256f09 Reduce header pollution for mdreloc.c. Make Obj_Entry argument of
_rtld_relocate_nonplt_objects non-const in preparation for TLS support.
2010-08-06 16:33:17 +00:00
pooka
d9a3123e84 Do the semaphore trick only if the cleaner is run as a lib -- the
standard installation doesn't get linked against librt or libpthread.
2010-07-29 14:09:45 +00:00
pooka
4f52188eb0 Add a method for posting a semaphore when cleaner init has reached
the main loop.  This is useful for very quickly executed lfs runs
such as those in tests, as an initialization phase cleaner may
prevent file system unmount.
2010-07-29 14:07:39 +00:00
pooka
fc729209b1 always add to SRCS 2010-07-28 22:35:52 +00:00
mrg
c8cf27943d make sure to look in CFLAGS, COPTS and CPPFLAGS for abi options.
fixes sgimips64 build of n64 ld.elf_so.
2010-07-11 07:43:12 +00:00
mrg
ee1ac2b96d avoid an unused variable warning(error) for MKCRYPTO=no builds. 2010-07-11 03:13:08 +00:00
mrg
4c92852a80 remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format.  ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k.  this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
  down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h
2010-07-06 05:59:50 +00:00
wiz
88b9c8a3fe Fix typo, remove trailing whitespace. 2010-06-22 07:00:12 +00:00
mrg
30539536b5 merge bozohttpd 20100621 2010-06-22 05:24:12 +00:00
mrg
aeb27ed42c merge bozohttpd 20100617. 2010-06-17 19:43:30 +00:00
dholland
971935362c Remove zombie file. 2010-05-29 23:58:33 +00:00
dholland
8aaae434e3 Remove useless cast, probably motivated by an older and stupider lint. 2010-05-29 23:12:30 +00:00
dholland
3ba8be7347 Update outdated comment (and docs) about which header lines are printed.
I appear to have been carrying this patch around since 2002.
2010-05-29 23:08:06 +00:00
dholland
5f666bd308 Don't launder const 2010-05-29 23:05:22 +00:00
mrg
1fe1233e27 merge bozohttpd 20100512 2010-05-15 06:48:27 +00:00
mrg
d4586f7382 merge 20100510 properly 2010-05-10 14:53:17 +00:00
mrg
a07e0db33b merge bozohttpd 20100510. 2010-05-10 14:44:19 +00:00
mrg
ce2063081a merge bozohttpd 20100509. 2010-05-10 03:37:45 +00:00
mrg
390458fa54 import bozohttpd 20100509. it has these changes:
o  major rework and clean up of internal interfaces.  move the main
   program into main.c, the remaining parts are useable as library.
   add bindings for lua.  by Alistair G. Crooks <agc@netbsd.org>
o  fix http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=566325


special thanks to al for the majority of these changes.
2010-05-10 03:30:04 +00:00
wiz
55767fc891 Wording. 2010-04-29 21:34:04 +00:00
hubertf
81fae5271a Rename -w to -c by popular demand
(allow file 'c'reation - 'w'riting was always available, with some twist;
 plus there's already such a feature elsewhere, so let's try to not
 diverge needlessly)
2010-04-29 20:13:46 +00:00
wiz
c80baa2258 Sort options in SYNOPSIS; improve wording. 2010-04-29 07:04:44 +00:00
hubertf
cb578cac71 tftpd(8): Add -w so files can be uploaded without requiring them
to be created before the upload. See the section on security
	considerations before enabling. [hubertf 20100429]

Addresses PR bin/43164.
2010-04-28 22:21:51 +00:00
joerg
ff0f2fb483 Use fast_remainder32 for the ELF hash. For the hot cache case, this
speeds up Firefox startup by over 2% on AMD64.
Limit hash table buckets to 32bit.
2010-04-05 14:01:26 +00:00
joerg
5e015e5e29 Use .In instead of .Aq Pa for header files. 2010-03-22 18:58:31 +00:00
lukem
f009f7a2e4 Update version to 20100320 for Christos' commit to popen.c 1.37 for:
PR/43023: Bruce Cran: FTPD bug remote crash
2010-03-21 20:27:26 +00:00
christos
692b0132a0 PR/43023: Bruce Cran: FTPD bug remote crash
Since we specify NOCHECK, in the NOMATCH case gl_pathv can be NULL.
(From FreeBSD)
2010-03-20 18:23:30 +00:00
skrll
134b0fcc8f Only apply -Wno-stack-protector where alloca is used. 2010-03-20 16:36:35 +00:00
roy
51085124f6 Use the gcc directive to disable SSP warnings. 2010-03-19 20:53:50 +00:00
roy
d5e8f757b8 Use alloca(3) instead of local xmalloc for creating our DoneLists.
This allows threaded programs to use us a little better, PR lib/43005.
We need to disable SSP when using alloca.
2010-03-18 22:17:55 +00:00
roy
b02ec7e9f8 Implement negative cache checks for symbol lookups.
Uses the Donelist idea from FreeBSD.
2010-02-27 11:16:38 +00:00
mlelstv
b076c4eba1 Read the padded superblocks to avoid problems with disks that have
larger sectors than 512 Bytes.
2010-02-16 23:13:13 +00:00
roy
98eb889579 Userland now builds and uses terminfo instead of termcap.
OK: core@, jdc@
2010-02-03 15:34:37 +00:00
skrll
d306de736d Restore backwards compatibility for binaries referencing the main
Obj_Entry.
2010-01-17 08:04:20 +00:00
skrll
2e0bcc8d3b Remove cargo cult dlinfo entry point. 2010-01-16 10:37:51 +00:00
skrll
418048d731 Put the dlopen,and friends entry points back.
They're needed by pre-2.0 binaries. Backward compatibiliity for these
was broken by another commit recently which I'll fix shortly.
2010-01-15 07:07:11 +00:00
skrll
699646b3ea Remove the entry points for dlopen() and friends. They haven't been used
since Aug 2003.
2010-01-14 21:52:07 +00:00
skrll
15b7ff0199 Make DEBUG build compile. 2010-01-14 12:12:07 +00:00
skrll
f88b3d9061 Wrap a few long lines. 2010-01-14 11:58:31 +00:00
skrll
c2796a5929 Shut gcc up. 2010-01-14 11:57:06 +00:00
skrll
8b4b9f3e56 Shut gcc up. 2010-01-13 22:34:07 +00:00
christos
12bd4dbd45 PR/39240: Satoshi Suetake: Don't fail when attempting to resolve weak symbols
when we are doing immediate binding, leave them alone and they will be dealt
with later during lazy binding. From skrll@
2010-01-13 20:17:21 +00:00
skrll
8f7db61734 Reset the COMBRELOC cache Obj_Entry if it was freed.
Fixes PR 41482. Done slightly differently to the patch in the PR.
2010-01-10 07:29:47 +00:00
skrll
fa7832d0b1 Fixup comment. 2010-01-10 06:37:32 +00:00
skrll
09298c1411 Small tidyup. 2010-01-09 15:36:43 +00:00
mbalmer
b877ced633 fix build 2010-01-09 10:46:31 +00:00
christos
77c1fa357d newer versions of NetBSD turn on -Wsign-compare 2010-01-09 01:25:09 +00:00
wiz
b54de515fb Sync usage with man page. 2010-01-08 23:27:08 +00:00
wiz
c13fde4224 Sort options in SYNOPSIS.
New sentence, new line.
Use only mdoc markup.
Make HTML-ready.
2010-01-08 23:25:07 +00:00
christos
73a2253ad9 Patrick Welche <prlw1@cam.ac.uk>
- add -p pathsep option
    - make wrap to zero work, but produce a warning
While here:
    - fix gcc warnings, in particular variable clobbered warnings
      (compiling with fewer warnings does not really fix the problem)
2010-01-08 21:05:14 +00:00
mrg
249d1f1111 use COPTS for -G0.
replace ${CPUFLAGS:M-mabi=64:M-mabi=o64} with two constructs.
the former doesn't seem to work anymore.
2009-12-18 17:10:07 +00:00
matt
d8d1440d5c Merge from matt-nb5-mips64:
Add N32/N64 support for mips dynamic loader.
2009-12-14 00:41:18 +00:00
mrg
750ad3d59d simplify the logic for compat ld.elf_so and move it here. we now can
find the libc objdir for multiple compat ld.elf_so's, too.
2009-12-13 09:31:47 +00:00
mrg
6af15ae20b if BSD_MK_COMPAT_FILE is defined, .include it. 2009-12-13 09:01:45 +00:00
mrg
f7f0bc40ae rename LD32DIR to MLIBDIR. 2009-12-13 08:25:20 +00:00
christos
1dc0b61eca If the environment is corrupt, die. From FreeBSD. 2009-12-02 15:50:13 +00:00
mbalmer
124961627e s/the the/the/ 2009-11-22 18:40:26 +00:00
skrll
77fd7698f3 Make _rtld_pagesz of type size_t.
Fixes round_down for alpha which made ldd(1) break.
2009-11-17 18:44:33 +00:00
skrll
b9fe4e7d17 Add RCSID 2009-11-11 14:15:41 +00:00
lukem
11a6d49961 NetBSD-ftpd 20091107:
* Fix WARNS=4 issues (const & sign mismatches, etc)
* Ensure various ftpd.conf values can't exceed their underlying types.
* Fix for 64 bit time_t and dev_t
* Rename internal getline() function to get_line() so it does
  conflict with the getline(3) libc function.
* Log both the hostname and numeric address.
* Improve man page mdoc formatting
2009-11-07 03:10:05 +00:00
agc
96b6b6617b Re-add two files necessary for the testsuite to run properly. 2009-11-05 07:46:10 +00:00
joerg
33d938a5e5 Do not indent global variables. 2009-11-04 18:32:27 +00:00
skrll
ef99e95537 Fix start symbols for new binutils. 2009-11-04 17:02:43 +00:00
agc
ac9efee5f2 Plug a memory leak for ssl-protected formatted output 2009-11-04 15:37:39 +00:00
skrll
d43e9fc212 Fix start symbol for newer binutils. 2009-10-22 21:56:13 +00:00
snj
550147bd6a Remove 3rd and 4th clauses in christos' license. OK christos. 2009-10-21 01:07:44 +00:00
pooka
977fb405f8 LDADD+= instead of LDADD= 2009-10-09 20:19:44 +00:00
pooka
494379efaf Attempt to recover slightly more gracefully if the kernel socket is shutdown. 2009-10-09 16:35:17 +00:00
skrll
15653ebb45 ld.elf_so grew more PLABELS with dlinfo so bump HPPA_PLABEL_PRE. 2009-09-25 17:49:56 +00:00
pooka
4c1e54d82b Add Solarisa-like dlinfo() interface to the ELF dynamic linker.
Implement RTLD_DI_LINKMAP which returns a pointer to the linkmap
chain at the given object.  Other Solaris queries are currently
unimplemented.
2009-09-24 21:21:33 +00:00
skrll
ffb28af545 Fix start symbol. I have no idea how this worked before. 2009-09-19 14:54:17 +00:00
skrll
4b849729b2 Fix the start symbol. 2009-09-12 07:22:16 +00:00
jmmv
2cb749c2fd Remove trailing \n in calls to _rtld_error: a newline is automatically
added by a call to the function.
2009-08-29 13:46:54 +00:00
martin
c69e3f0a0e Add <sys/exec_aout.h> includes 2009-08-16 18:01:49 +00:00
wiz
175898c4a2 Describe -D. Bump date. 2009-08-06 21:18:54 +00:00
pooka
709a4d5bb6 Define syscalls of lfs userspace tools (cleaner, mainly) through
a struct called kernelops, which contains standard system calls
for the normal case and rump system calls for the rump case.

Make it possible to run the lfs cleaner in a library fashion (taking
the quick route with the implementation).
2009-08-06 00:51:55 +00:00
pooka
0013bbb8eb add D to getopt so that previous actually works 2009-08-06 00:23:08 +00:00
pooka
b5cf475347 add -D, which prompts to stay on foreground without debug spewage 2009-08-06 00:20:45 +00:00
pooka
e2863984f7 Check main loop fcntl return value and error out if it fails.
Prevents e.g. from 5.0 cleaner looping forever against -current
lfs driver (fcntl data structure sizes are different).
2009-08-06 00:05:01 +00:00
roy
7027866a09 Rename internal getline() function to get_line() so it does
conflict with the soon to be added getline(3) libc function.
2009-07-13 19:05:39 +00:00
mbalmer
bf31e2ab08 Remove an old workaround from SCCS times (%M% would insert the filename). 2009-07-04 13:24:09 +00:00
christos
1b829b2a68 PR/40965: NAKAJIMA Yoshihiro: lfs_cleanerd isn't adapted to !MKDYNAMICROOT 2009-06-21 20:20:50 +00:00
he
45932f91e5 Apply fix borrowed from i386: Fix const issue (cast const pointers
to "const uint8_t *" instead of "caddr_t").
2009-05-24 20:35:41 +00:00
he
237687b934 Copy build fix from i386: Fix const issues (cast const pointers
to "const uint8_t *" instead of "caddr_t").
2009-05-24 18:29:03 +00:00
wiz
81ea280bf2 Sort options in SYNOPSIS. 2009-05-23 20:26:18 +00:00
mjf
27cb8d0e73 After a recent WARNS= bump on ld.elf_so it fails to build on hppa,
complaining that we're "discarding qualifier from pointer target
type".

Use const char * instead of caddr_t to avoid the warning and get
distribution building on hppa again.
2009-05-23 17:50:34 +00:00
mrg
4157d76654 fix a new -Wsign-compare bug. 2009-05-23 08:26:26 +00:00
mrg
67eebf838c fix a merge botch in previous 2009-05-23 06:45:28 +00:00
mrg
c6e75af28a merge bozohttpd 20090522 2009-05-23 02:26:03 +00:00
mrg
36a7970f3c import bozohttpd 20090522, which has these changes:
o  close more leaking file descriptors for CGI and daemon mode
	o  add subdirs for build "debug" and "small" versions
	o  clean up a bad merge / duplicate code
	o  make mmap() usage portable, fixes linux & ranges: support
	o  document the -f option
	o  daemon mode now serves 6 files per child
2009-05-23 02:21:19 +00:00
martin
c131490c29 Use the new Elf_SOff (signed offset) type to fix a few signed/unsigned
problems.
2009-05-22 21:47:46 +00:00
christos
b19e027aab fix signed/unsigned comparisons and const cast away (untested) 2009-05-20 22:31:46 +00:00
ad
51a76d6f11 Add a reminder about ldd depending on ld.so. 2009-05-20 19:38:38 +00:00
christos
fa64a5bf9b warns=4 2009-05-19 20:44:52 +00:00
wiz
93dafb2e39 Drop trailing whitespace. 2009-05-01 10:53:27 +00:00
lukem
24c7ea10da Simplify the example command used to extract a wu-ftpd compatible xferlog. 2009-05-01 09:47:26 +00:00
mrg
68b1f14092 oops. these files should never have made it in here. 2009-04-19 21:43:44 +00:00
mrg
bbbdac0a6f merge bozohttpd 20090418. remove a couple of minor do-nothing local
changes that don't need to cause conflicts.
2009-04-18 21:22:03 +00:00
mrg
5de1fbc2cb import bozohttpd 20090418. changes include:
o  avoid dying in daemon mode for some uncommon, but recoverable, errors
o  close leaking file descriptors for CGI and daemon mode
o  handle poll errors properly
o  don't try to handle more than one request per process yet

this covers PR#38489 and PR#40079, as well some some issues reported
privately.
2009-04-18 21:09:40 +00:00
wiz
98d3964304 Remove duplicate part (pasto?). Remove trailing whitespace.
Use Aq where easily possible.
2009-04-18 12:35:51 +00:00
mrg
74dbf40e6b re-add a lot of the distribution files 2009-04-18 07:48:02 +00:00
mrg
f32af62cb7 return a value when the function wants to. 2009-04-18 07:38:40 +00:00
mrg
ca01226b20 de-const some variables passed to free(). 2009-04-18 07:37:08 +00:00
mrg
033876329d merge bozohttpd 20090417 2009-04-18 07:28:24 +00:00
mrg
8033ac319d import latest bozohttpd sources. changes include:
o  make bozohttpd internally more modular, preparing the way
           to handle more than one request per process
        o  fix http-auth, set $REMOTE_USER not $REMOTEUSER.  also fix
           cgi-bin with cvsweb, from Holger Weiss <holger@CIS.FU-Berlin.DE>
        o  fix an uninitialised variable use in daemon mode
        o  fix ssl mode with newer OpenSSL
        o  mmap large files in manageable sizes so we can serve any size file
        o  refactor url processing to handle query strings correctly for CGI
           from Sergey Katsev at Coyote Point
        o  add If-Modified-Since support, from Joerg Sonnenberger
           <joerg@netbsd.org>
        o  many more manual fixes, from NetBSD
2009-04-18 07:09:27 +00:00
snj
4657fc1128 Fix typo in email address. Pointed out by Mirko Thiesen in PR 41229. 2009-04-16 21:26:57 +00:00
christos
f42cbba55c provide more info on decoding errors. 2009-04-13 03:38:15 +00:00
lukem
e91bd42f43 Fix const issues (cast const pointers to "const uint8_t *" instead of "caddr_t") 2009-04-12 13:29:29 +00:00
joerg
95f7f57dfb Remove physical markup. 2009-04-09 04:02:32 +00:00
joerg
3b17d40bfb Don't use .Xo/.Xc or .Oo/.Oc over .It lines to work around the macro
argument limit in ancient groff versions.
2009-04-09 02:25:45 +00:00
joerg
5b2aa3c892 Don't use .\" as callable macro. 2009-04-08 15:05:58 +00:00
joerg
f4bfcdb4ae Improve markup. 2009-04-08 13:36:32 +00:00
apb
33c39aadf2 In addwhatis(), two items should not be treated as duplicates unless
both the "data" and "prefix" elements are identical.  For example, the
two lines

	amiga/boot (8) - system bootstrapping procedures
	amd64/boot (8) - system bootstrapping procedures

both appear with data = "boot (8) - system bootstrapping procedures" but
with different values for prefix, and we do not want to reject one of
them as a duplicate.
2009-04-02 21:39:33 +00:00
reinoud
ce5ceeea15 Fix redirection core dump as reported in PR#41042. 2009-03-23 12:49:28 +00:00
lukem
fd6e87486b Fix 'vfork clobber' warning on vax.
Problem noted by and fix confirmed by Olaf 'Rhialto' Seibert.
2009-03-18 02:27:41 +00:00
lukem
b4fba76b41 Fix const issues (cast const pointers to "const uint8_t *" instead of "caddr_t")
NOTE: change based on ../i386/mdreloc.c 1.27
XXX: not compile tested
2009-03-16 02:46:47 +00:00
lukem
337930db10 Fix const issues (cast const pointers to "const uint8_t *" instead of "caddr_t") 2009-03-16 02:44:47 +00:00
lukem
500db00274 Default to WARNS=4
Exceptions that need a lower level are:
	getty ld.elf_so lfs_cleanerd makewhatis telnetd tftpd
	hpropd ipropd-master ipropd-slave kadmind kpasswdd
2009-03-16 02:24:55 +00:00
lukem
024b6bdcb7 fix sign-compare issue 2009-03-16 02:18:39 +00:00
lukem
c12ec9011a fix shadowed variable 2009-03-16 01:56:21 +00:00
lukem
7056a59163 fix WARNS=4 issues (const & type mismatches) 2009-03-16 01:13:38 +00:00
lukem
46067dc349 ANSI KNF 2009-03-16 01:04:32 +00:00
lukem
22fa21205e fix WARNS=4 issues.
(arguably usr.bin/who/utmpentry.c::getutentries() could return size_t not int)
2009-03-16 00:56:16 +00:00
lukem
eccb8fb7be WARNS=4 2009-03-16 00:43:33 +00:00
lukem
bb15c5ac36 fix WARNS=3 issues;
* sprinkle const
* avoid tests < 0 on unsigned types
* test fwrite() returns nmemb not <0
2009-03-16 00:08:10 +00:00
lukem
f3479fb8e4 avoid a shadowed variable 2009-03-15 23:56:24 +00:00
lukem
b8276deac1 rename a variable to avoid a compiler warning 2009-03-15 23:53:03 +00:00
joerg
854ee47087 Declare all columns. 2009-03-15 08:05:22 +00:00
lukem
0053962f9d Fix WARNS=4 issues (const & sign mismatches, etc)
Ensure various ftpd.conf values can't exceed their underlying types.
2009-03-15 07:48:36 +00:00
lukem
dfbb3f921a apply some __UNCONST(). 2009-03-14 13:59:28 +00:00
lukem
434441debd fix sign-compare issue 2009-03-14 11:43:24 +00:00
joerg
edbcd7c8fd Fix preamble 2009-03-11 13:39:33 +00:00
mrg
932fbc87d9 use SIMPLEQ_FOREACH_SAFE(), to avoid a use-after-free.
picked up by coverity.
2009-03-11 06:53:25 +00:00
lukem
a341f7315c bump version for remoteloghost & portability changes 2009-03-02 03:48:43 +00:00
lukem
6269ac3894 Use LLF (et al) instead of "%lld" (et al). 2009-03-02 03:47:44 +00:00
tls
7184d23274 More CGI handling fixes from Sergey Katsev at Coyote Point.
1) Fix an issue where because of the reordering of transform_request
   and process_cgi, the cgi-script name was being cut off
   by one character (transform_request for some reason
   cuts off the leading '/' for the file name as part of its
   processing).  As an 'easy' fix, simply re-add the '/' to the
   front of the filename, which means that we don't have to
   mess with the logic that sometimes adds +1 and sometimes doesn't.

2) Work around ridiculous bug in PHP reported by lukem in 2004,
   but stubbornly never fixed by the PHP maintainers:

   Change the SCRIPT_NAME and SCRIPT_FILENAME variables
   to contain the file name only, not the query if one exists.
   Having the query in SCRIPT_FILENAME causes php-cgi to not
   work, as per the bug information here:
   	 http://bugs.php.net/bug.php?id=28227

3) Fix a memory leak because URL wasn't being freed.
2009-02-19 22:33:39 +00:00
joerg
7925dff4ee Add If-Modified-Since support. 2009-02-09 17:06:11 +00:00
tls
f0f7a44ff5 From Sergey Katsev at Coyote Point: fix bugs in request transformation and
CGI handling, including bin/40355 .  There are two main changes here:

1) call process_cgi() after transform_request(), not before.  Now it is
   possible to have a default cgi handler catch a request for a path that
   was produced by transformation, e.g. by index generation -- so now the
   index can be "generated" by a CGI if that is what the user desires.

2) More clearly distinguish "file" from "query" portions of the request
   URL, so we do not feed ?-suffixed "arguments" to plain files, fail to
   match filename extensions due to ?-suffixes, etc.

   After this change, there are only two cases which use the "query"
   portion of the request (the portion after the ?):

     a) A redirect issued by HTTPD will redirect to the new file, but
	with the same query string.

     b) process_cgi() will, of course continue to use the query string.
2009-02-04 22:55:58 +00:00
jmmv
0cdcf7cea6 Remove ATF 0.5 from dist/atf and all of the reachover Makefiles used to
build it.  0.6 is going to be imported in external/bsd/atf, with all the
necessary Makefiles in that same hierarchy.
2009-01-19 07:08:14 +00:00
lukem
fb103c5334 fix -Wsign-compare issues 2009-01-18 00:37:53 +00:00
lukem
70d3d32311 fix -Wsign-compare issues 2009-01-18 00:36:20 +00:00
christos
313780f726 PR/40339: Ed Ravin: make ftpd log both the hostname and numeric address. 2009-01-08 18:47:49 +00:00
mrg
fb3cc85fef add some (uintptr_t) to some casts, so these compile with ELFSIZE=32
*and _LP64.  necessary for 32/64 bit combo ldd support.
2009-01-06 04:01:46 +00:00
mrg
9108f12f6b move the defines for RTLD_ARCH_SUBDIR into a sub-sub-makefile so we can
grab these values via reach-over more easily.
2009-01-06 02:15:06 +00:00
christos
0d7dc435fd fix for 64 bit time_t and dev_t 2008-12-29 00:33:34 +00:00
wiz
859dc97d79 Move all subsections to main DESCRIPTION, noted by John Nemeth. 2008-12-06 14:17:43 +00:00
wiz
b05af3b178 Fix some more mdoclint warnings.
Add commas in enumerations.
2008-12-06 13:30:35 +00:00
jnemeth
8c012591df add -t chrootdir to SYNOPSIS, mdoclint 2008-12-06 13:18:09 +00:00
dholland
855e61a2e0 Minor KNF and whitespace nits. No functional change. 2008-11-16 06:26:12 +00:00
dholland
9e9d6e3a61 Close possible race conditions if multiple copies of makewhatis end up
running concurrently. Other half of the fix for PR 35619.
2008-11-16 06:17:05 +00:00
mrg
ac1ceac37d pull across the fix from my master bozohttpd cvs tree for PR 38466. 2008-11-06 06:38:43 +00:00
mrg
9b0170606d make MKPIC=no builds work on i368, shark, vax, pmax, sgimips, sparc,
maybe all mips and all arm as well.
2008-10-31 20:24:51 +00:00
lukem
a69f51a660 Constify.
Rework an expression to make it easier to conditionally compile.
2008-10-28 08:05:26 +00:00
mrg
8679e33545 if LD32DIR is defined:
- look in src/compat/lib/libc for libc_pic.
- define RTLD_ARCH_SUBDIR to "i386" or "sparc" for amd64 and sparc64
  builds, respectively
if RTLD_ARCH_SUBDIR is defined, add this path before
RTLD_DEFAULT_LIBRARY_PATH in the default search path.
2008-10-26 07:11:54 +00:00
christos
3b55965a05 Never build this with PIE. 2008-10-16 14:36:20 +00:00
skrll
8c9056ada8 lib/39649: dlsym(3) does not follow dependencies
Pull across code from FreeBSD to do a search of the passed object and it's
NEEDED objects (dependencies).

Reviewed by gimpy.
2008-10-04 09:37:12 +00:00
reed
f2f50da6cf Fix the Document Title of manual page so it our official name (ntalkd).
Install so first file installed matches this correct manual page
name.

(Both manual pages are still installed. And only ntalkd binary is
installed. So no change.)
2008-09-27 04:41:20 +00:00
macallan
982ae38f15 avoid usind __builtin_return_address(0) on PowerPC because it fails in
Xorg's module loader.
Should fix PR37812
2008-09-27 03:52:05 +00:00
lukem
b9b397131e Use passwd(5) instead of /etc/pwd.db as the name of the "password data base". 2008-09-21 06:20:46 +00:00
lukem
d451eab1e2 Enhance -C to support an optional @host ('-C user[@host]'):
checks whether user as connecting from host would be granted
access by ftpusers(5).

Support IPv6 in the host directive of ftpusers(5).
(May resolve PR 26555)

Both features from Rudolf Cejka <cejkar@fit.vutbr.cz>
(FreeBSD's tnftpd port maintainer).
2008-09-16 12:30:38 +00:00
lukem
de99131c2b Support building with -DNO_INTERNAL_LS 2008-09-16 12:23:28 +00:00
reed
cb656a8c3e Fix spelling of my name. While here add my middle initial. 2008-09-13 14:00:34 +00:00
lukem
2332514a42 Don't split large commands into multiple commands; just fail on them.
This prevents CSRF-like attacks, when a web browser is used to access
an ftp server.
Reported by Maksymilian Arciemowicz <cxib@securityreason.com>.
Fix mostly derived from OpenBSD, written by Moritz Jodeit <moritz@OpenBSD.org>
2008-09-13 03:30:35 +00:00
lukem
f1d75d00ca Crank copyright dates 2008-09-13 02:41:52 +00:00
gmcgarry
3c9a95916d Wrap compiler-specific flags with HAVE_GCC and HAVE_PCC as necessary. Add a few flags for PCC. 2008-08-29 00:02:21 +00:00
gmcgarry
e2e3c64b70 Don't build atf tools with (${MKATF} == no). 2008-08-16 23:51:15 +00:00
matt
86d6d815ae Make sure to call dlerror() to clear any error messages after the relocations
are done and there are no errors.  This will prevent spurious undefined weak
symbol errors being returned by dlerror().

Fixes PR bin/39240.
2008-07-29 16:27:01 +00:00
skrll
dccd9ddf7f RCSID police 2008-07-24 06:51:58 +00:00
matt
38bdc8954f Refactor common code to _rtld_relocate_plt_object to i386 and arm so they
act like the other versions.
In _rtld_bind, if the result is 0, call _rtld_die.
Initialize _rtld_sym_zero.st_value to -_rtld_objself.maprelocbase.  Now when
the symbol is resolved, st_value + maprelocbase will equal 0 and the above
check in _rtld_bind will fire and a call to NULL will be avoided.
2008-07-24 04:39:25 +00:00
christos
d3b459e727 abort() if we are trying to use an undefined weak symbol from the plt. Remove
check from relocate_plt_object() since we cannot return _rtld_sym_zero anymore.
Code from gimpy.
2008-07-23 18:16:42 +00:00
christos
0d33a45b97 handle sym_zero like x86_64; other ports might need this too. 2008-07-22 22:27:07 +00:00
christos
56e895e29f deal specially with sym_zero, returned by a weak symbol that was not found,
by retrieving it's name instead of printing random garbage.
2008-07-21 20:19:28 +00:00
lukem
f0bccc0f62 Remove the \n and tabs from the __COPYRIGHT() strings. 2008-07-21 13:24:38 +00:00
lukem
0c4ddb1599 Remove the \n and tabs from the __COPYRIGHT() strings. 2008-07-20 01:09:06 +00:00
dholland
16e3bec279 Clarify how one is supposed to use the pointers returned by getutentries()
(the utmpentry.c code), specifically with respect to who owns them and
when to free them. Now they're owned by utmpentry.c, only. Abolish the
freeutentries() function, which was the wrong abstraction; add instead
endutentries(), which flushes out the internally managed memory.

Update callers as necessary. Some (e.g. talkd) had been leaking memory;
others (e.g. syslogd) had been accidentally freeing and reloading utmp
more often than necessary. There are a couple untidy bits in users and
rwhod that someone should look after sometime, maybe.

Fixes PR bin/35131, which was about talkd's memory leak.
2008-07-13 20:07:48 +00:00
lukem
8cc604a385 Add missing RCSID. 2008-06-09 01:00:23 +00:00
lukem
ef70558f4f Don't use non-standard "u_<foo>" types.
Strip trailing whitespace (as well as ':'s) off PAM password prompts.
Improve some debug logging related to PAM.
2008-06-09 00:33:39 +00:00
ad
156176be13 Fix error in previous. From nakayama@. 2008-06-05 00:03:20 +00:00
ad
53c5ea5da9 Don't bother unmapping the ELF header unless it overlaps the first load
section.
2008-06-03 19:32:32 +00:00
ad
9795e155ec __progname isn't const. 2008-06-03 19:22:07 +00:00
ad
36b49f84f3 Try read() on ld.so.conf. If the file is small, it avoids stat+mmap+munmap. 2008-06-03 18:36:59 +00:00
mrg
c2b95373bf remove clause #3 from my license where there are no other
copyright holders involved.
2008-05-29 14:51:25 +00:00
dholland
cc6b2d9854 Urgh, part of another patch for PR 35619 (which is for after the freeze)
snuck in by accident, corrupting an error message. Fix.
2008-05-27 01:42:40 +00:00
dholland
7edb76a2e6 Update whatis.db atomically, by dumping out into whatis.db.new and
renaming. PR 35619 from uwe@.
2008-05-27 01:25:46 +00:00