Commit Graph

3302 Commits

Author SHA1 Message Date
mrg 3b6cf52f57 also set -D_DEFAULT_SOURCE to open up more headers.
allow passing $(EXTRALIBS).
2021-01-17 00:15:14 +00:00
hannken cf205aa356 Bozohttpd clobbers files greater than 4GB on 32bit archs.
Make sure the alignment mask derived from pagesize is an off_t.
2020-11-19 10:45:36 +00:00
wiz 8f3596c5ac New sentence, new line. Fix xref. 2020-10-15 09:54:22 +00:00
mrg 4864410bbc various updates from <henrik@gulbra.net> / freebsd. the list from Henrik:
bozohttpd.8:
    o Added -d flag to the man page
    o Moved -E flag in man page to keep alphabetic order
    o Grammar fix for description of -E flag in man page
    o Moved a word in the man description for the -f flag
    o Made -f imply -b as a backwards-compatible shortcut
    o Updated man description of -n to mention Lua scripts
    o Moved -z below -Z to keep the uppercase options first

bozohttpd.c:
    o Removed obsolete comment about ~user missing cgi-bin support
    o Removed "/* ARGSUSED */" lines; was that a macro or a reminder?
    o Added USE_ARG macro call for sig, which was otherwise not used
    o Added USE_ARG macro call for msg (only used if debug is enabled)

bozohttpd.h:
    o Fixed typo in the include guard (BOZOHTTOPD_H_ -> BOZOHTTPD_H_)
    o Renamed have_all to have_core; it didn't mean "all" options

content-bozo.c:
    o Added USE_ARG macro call for signo, which was otherwise not used
    o Made -f imply -b as a backwards-compatible shortcut

main.c:
    o Simplified -b text to be symmetric with that for the -f option
    o Updated -C text to make "suffix" explicit; it's better than "arg"
    o Changed to only show the -E description if have_user is true
    o Always show the -e option, which incorrectly used the -E logic
    o Renamed have_all to have_core; it didn't mean "all" options
    o Added three missing tabs for the description of the -G option
    o Updated -L text to make "prefix" explicit; it's better than "arg"
    o Updated -M text to make "suffix" explicit; it's slightly better
    o Added a previously missing description for the -n option
    o Documented the otherwise obscure valid types for the -T option
    o Shortened "username" to "user" to match the actual help text
    o Moved handling of -c below that for -C to standardize the order
    o Broke the enabling test for -C into two lines for consistency
    o Inverted the enabling test for -E; this is what was meant, right?
    o Removed the enabling test for -e, which should always be enabled

ssl-bozo.c:
    o Added USE_ARG for httpd, which is not used if SSL has been excluded
2020-10-15 04:21:53 +00:00
mrg bf53dc2363 set -D_GNU_SOURCE in Makefile.boot. from hadrien.lacour@posteo.net.
also match %2F as well as %2f.  from leah@vuxu.org.
introduce defines for "80" and "443".  copyright maint.
2020-10-15 02:19:23 +00:00
kamil f420d54c39 Correct r_ldbase valuse
It shall be the relocbase value, not linkmap.
2020-09-22 00:41:27 +00:00
kamil f3656ffa1a Upgrade the SVR4 RTLD r_debug protocol to version 1
Changes:
 - Add a new field r_ldbase in the r_debug struct.
 - Set r_version to 1.

This harmonizes the support with OpenBSD and Linux.
FreeBSD uses version 0 (or no version).
Solaris uses version 2 that is not implemented elsewhere and relies on
SVR4 specific design and interfaces.

Update the code comments as r_debug and link_map is used by other software
than GDB, namely: sanitizers, rump, LLDB.
2020-09-21 16:08:57 +00:00
rhialto 7f9df6b3cc bozohttpd: correct .m4a to audio/mp4. 2020-09-12 14:44:25 +00:00
rhialto d4ca506457 bozohttpd: add .m4a and .m4v file extensions. 2020-09-12 12:39:28 +00:00
mrg c2082ece61 remove GCC_NO_ADDR_OF_PACKED_MEMBER for several subdir builds
that are now handled by lfs_accessors.h internally.
2020-09-07 03:09:53 +00:00
mrg cb93b81028 add support for new GCC 9 warnings that may be too much to fix
right now.  new address-of-packed-member and format-overflow
warnings have new GCC_NO_ADDR_OF_PACKED_MEMBER amd
GCC_NO_FORMAT_OVERFLOW variables to remove these warnings.

apply to a bunch of the tree.  mostly, these are real bugs that
should be fixed, but in many cases, only by removing the 'packed'
attribute from some structure that doesn't really need it.  (i
looked at many different ones, and while perhaps 60-80% were
already properly aligned, it wasn't clear to me that the uses
were always coming from sane data vs network alignment, so it
doesn't seem safe to remove packed without careful research for
each affect struct.)  clang already warned (and was not erroring)
for many of these cases, but gcc picked up dozens more.
2020-09-06 07:20:26 +00:00
mrg ea8f81f33c avoid passing NULL pointers to printf() like functions and %s. 2020-09-05 13:38:24 +00:00
leot 056172a33c Fix a typo in a comment 2020-08-25 20:02:33 +00:00
lukem 167898024d ftpd.conf(5): remove duplicate "be"
Two be or not two be.
Noted by SAITOH Masanobu in private mail.
2020-08-22 08:08:47 +00:00
mrg 1172b145cf call this bozohttpd/20200820 2020-08-20 07:57:01 +00:00
mrg 0370405840 compare mmap return again MAP_FAILED not -1 or 0. 2020-08-20 07:56:26 +00:00
mrg 560f0b4f2d update for recent changes. 2020-08-20 07:55:10 +00:00
spz 0acfa6caa5 send close_notify for the ssl connection before closing the TCP connection
Thanks to Dr. Thomas Orgis for reporting the issue.
2020-08-20 05:46:31 +00:00
jruoho 5f5a8e24b4 Add -DNO_BLOCKLIST_SUPPORT also to small/Makefile. 2020-07-13 10:35:17 +00:00
wiz 8062a6751f Use Nx. 2020-07-13 09:41:18 +00:00
jruoho 830b8c5218 Do not report status code 500 to blocklistd(8) Add -DNO_BLOCKLIST_SUPPORT
to Makefile.boot.
2020-07-13 09:38:57 +00:00
jruoho c0b4b2d279 Add blocklistd(8) support. 2020-07-11 08:10:52 +00:00
jmcneill 026e4ac043 Add -R flag to specify a README file to add at the bottom of directory
autoindex listings.
2020-07-06 23:31:36 +00:00
lukem 564e323839 add missing RCSIDs
(copyrights could be added too - that's up to christos@)
2020-07-04 05:18:37 +00:00
lukem 95fccb75a2 NetBSD-ftpd 20200615
Update version to "NetBSD-ftpd 20200615" for changes:
- Increase some buffer sizes.
- Rename blacklist to blocklist.
2020-07-04 01:20:42 +00:00
joerg 5df17207d3 R_ARM_TLS_TPOFF32 needs to adjust the existing value, not blindly
overwrite it.
2020-06-16 21:02:20 +00:00
joerg 41844ca786 Honor addend for R_AARCH64_TLS_TPREL relocation. 2020-06-16 21:01:30 +00:00
christos 2f0bfbf344 Rename blacklist -> blocklist 2020-06-15 01:57:29 +00:00
fox fe9ca5aa84 libexec/httpd: Fix the possible -Werror=stringop-truncation
Error was reported when build.sh was run with MKLIBCSANITIZER=yes flag.

Reviewed by: kamil@, mrg@
2020-06-07 23:33:02 +00:00
fox 7d0fd7a3da libexec/lfs_cleanerd: Suppress -Werror=stringop-truncation error
This logic correctly uses strncpy(3) to fully initialize a fixed-width field, and also ensures
NUL-termination on the next line as other users of the field expect.

Add -Werror=stringop-truncation to prevent build failure, when run with MKSANITIZER=yes.

Error was reported when build.sh was run with MKSANITIZER=yes flag.

Reviewed by: kamil@, riastradh@
2020-06-07 23:15:53 +00:00
macallan d4e6a9fda0 new binutils/gcc started emitting R_PPC_UADDR32 reloc entries, so for now
treat them like R_PPC_ADDR32
XXX
these relocs have been observed in the xf86-video-radeon driver, but only in
the AtomBios support code, which is unused on PowerPC. This allows the driver
to load but it's not clear if the affected parts would actually function.
2020-05-24 02:33:11 +00:00
skrll d736ede907 Fix debug build 2020-05-16 16:43:15 +00:00
skrll eeabd67ad2 Avoid compiler warnings about uninitialised symnum 2020-05-16 16:43:00 +00:00
skrll fab263653b Trailing whitespace 2020-05-10 06:42:38 +00:00
joerg ea47af4c11 Don't play #define games with extern, just have a separate list to avoid commons 2020-04-23 00:03:40 +00:00
joerg dca0c0f499 Mark _rtld_invalid_paths static as ldd can end up with two copies 2020-04-22 23:54:32 +00:00
joerg 25a494ecc4 Rename __atomic_fork to __locked_fork and give it &errno as argument.
rtld and libc use different storage, so the initial version would
incorrectly report the failure reason for fork().

There is still a small race condition inside ld.elf_so as it doesn't use
thread-safe errno internally, but that's a more contained internal
issue.
2020-04-19 01:06:15 +00:00
sevan 95b8f8498c document history 2020-04-18 22:03:51 +00:00
joerg 11954c74b6 Introduce intermediate locking for fork, so that the dynamic linker is
in a consistent state. This most importantly avoids races between dlopen
and friends and fork, potentially resulting in dead locks in the child
when it itself tries to acquire locks.
2020-04-16 14:39:58 +00:00
thorpej da570a6238 PT_GNU_RELRO segments are arranged such that their vaddr + memsz ends
on a linker common page size boundary.  However, if the common page size
used by the linker is less than the VM page size being used by the kernel,
this can end up in the middle of a VM page and when the region is write-
protected, this can cause objects in neighboring .data to get incorrectly
write-protected, resulting in a crash.

Avoid this situation by calculating the end of the RELRO region not by
rounding memsz up to the VM page size, but rather by adding vaddr + memsz
and then truncating to the VM page size.

Fixes PR toolchain/55043.

XXX pullup-9
2020-03-04 01:21:17 +00:00
kamil 0b0e2ac42c Add extra cast to suppress incompatible-pointer-types GCC warning 2020-02-29 18:53:55 +00:00
kamil 33f6117993 Fix vax and mips build 2020-02-29 18:45:20 +00:00
kamil e8e477017a Implement DT_GNU_HASH
DT_GNU_HASH serves the same purpose as DT_HASH, however it is a distinct
and faster apprach implemented and designed in the GNU toolchain in 2006.

DT_GNU_HASH is preferred whenever available.

Original GNU benchmarks claim 50% faster dynamic linking time.
https://www.sourceware.org/ml/binutils/2006-06/msg00418.html

Code based on FreeBSD and OpenBSD, both were based on DragonFlyBSD.
2020-02-29 04:24:33 +00:00
kamil 4e9bea3d5d Implement and integrate GNU Hashing function
Define Elf_Hash struct that contains ELF/SYSV and GNU hash checksum.
Implement _rtld_gnu_hash() for DT_GNU_HASH.
Adapt existing code to compute all Elf_Hash types, instead of only
the ELF/SYSV one.
Rename _rtld_elf_hash() to _rtld_sysv_hash() to match the GNU toolchain
terminology.

_rtld_gnu_hash() uses Dan Bernstein's string hash function posted eons ago
on comp.lang.c.
2020-02-29 04:23:05 +00:00
kamil e5a904478f Separate matched symbol functionality out of _rtld_symlook_obj()
Simplifies the code and it will allow to use the matched symbol
functionality by other users.
2020-02-29 04:21:42 +00:00
riastradh fcfd803846 uugetty is no more 2020-02-26 15:44:57 +00:00
kamil ac23308f24 Specify NOLIBCSANITIZER for the ELF loader
The sanitizer does not work reliably before finishing initialization of
ld.elf_so. There is also a number of false positives that are not real
problems here.
2020-02-09 09:11:59 +00:00
uwe 3582b90734 Use existing lo() and hi() macros. Same object code is generated. 2019-12-08 23:49:16 +00:00
uwe f3a8613fae Resolve ADDR16_LO, ADDR16_HI, and ADDR16_HA relocs.
Recent GNU ld does not resolve them statically if the reloc is in a
writable section and the symbol is not already referenced from text.
2019-12-08 22:57:51 +00:00
uwe 1cea4da77d Fix typo in a comment. 2019-12-08 22:41:42 +00:00