o fix some cgi header processing, from <thelsdj@gmail.com>
o add simple Range: header processing, from <bad@bsd.de>
o man page fixes, from NetBSD
o clean up various parts, from NetBSD
o prefix some function names with "bozo"
o align directory indexing <hr> markers
o clean up some code GCC4 grumbled about
for PT_PHDR headers when the program has been loader to a vaddr other than
then one specified (a randomized one), and modifying the relocation base
address appropriately (idea from elad)
- Apply patch from J.T. Conklin to execute .init/.fini functions in order.
- Support DF_1_INITFIRST and mark libc with DF_1_INITFIRST. Shared libs
should be recording a dependency on libc, but it's too late to do that.
Ok christos@.
This adds reachover Makefiles to build and install the atf tools.
Some are public, thus installed in /usr/bin, and others are internal
and therefore installed in /usr/libexec.
- remove unused write_str var
+ move header parsing to new function separation of parsing vs processing
+ alter some variable names to avoid confusion between header value and
header name (caused breakage with previous rev)
(i.e. free(): warning: modified (chunk-) pointer))
+ don't leak memory for ptr actually returned from strdup()
+ don't strdup() if we don't have to
+ don't break without free() if we did strdup()
+ as well as freeing h_value also free the header.
avoid wasting OS flag bits. In the future we'll probably use fileassoc to
achieve this (once there is a way to make fileassoc persistent) or in the
shorter term libelf, so that we can add and remove the note on demand instead
of burning bits on each binary. Of course since this is a tool, this means
that we'll need to think about how to handle libelf...
FORTIFY_SOURCE feature of libssp, thus checking the size of arguments to
various string and memory copy and set functions (as well as a few system
calls and other miscellany) where known at function entry. RedHat has
evidently built all "core system packages" with this option for some time.
This option should be used at the top of Makefiles (or Makefile.inc where
this is used for subdirectories) but after any setting of LIB.
This is only useful for userland code, and cannot be used in libc or in
any code which includes the libc internals, because it overrides certain
libc functions with macros. Some effort has been made to make USE_FORT=yes
work correctly for a full-system build by having the bsd.sys.mk logic
disable the feature where it should not be used (libc, libssp iteself,
the kernel) but no attempt has been made to build the entire system with
USE_FORT and doing so will doubtless expose numerous bugs and misfeatures.
Adjust the system build so that all programs and libraries that are setuid,
directly handle network data (including serial comm data), perform
authentication, or appear likely to have (or have a history of having)
data-driven bugs (e.g. file(1)) are built with USE_FORT=yes by default,
with the exception of libc, which cannot use USE_FORT and thus uses
only USE_SSP by default. Tested on i386 with no ill results; USE_FORT=no
per-directory or in a system build will disable if desired.
Some statistics:
base + COMBRELOC
$ time (for i in `seq 100`;do noatun --help>/dev/null;done)
(; for i in `seq 100`; do; noatun --help > /dev/null; done; ) 148.64s
user 4.82s system 99% cpu 2:33.93 total
base + DF caching:
$ time (for i in `seq 100`;do noatun --help>/dev/null;done)
(; for i in `seq 100`; do; noatun --help > /dev/null; done; ) 151.15s
user 5.53s system 99% cpu 2:37.23 total
base:
$ time (for i in `seq 100`;do noatun --help>/dev/null;done)
(; for i in `seq 100`; do; noatun --help > /dev/null; done; ) 492.36s user
5.34s system 99% cpu 8:19.17 total
bin/ls sources to libutil:
o Bump libutil minor version number
o Fix uses to include <util.h> to pick up the function definitions
o Fix most uses of flags_to_string() to release the now-malloc()ed result
for set{u,g}id binaries, so that in case they are playing with set{u,g}id
and exec'ing other binaries they don't get affected by the
LD_{PRELOAD,DEBUG,LIBRARY_PATH} environment setup. We leave LD_BIND_NOW alone.
There are no binaries affected in the base system.
20060201
debug -> ftpd_debug
xstrdup -> ftpd_strdup
20060317
* Make sure that "su" is initialized before dereferencing it.
Fixes Coverity CID 1075.
* Set file to NULL after calling fclose().
Fixes Coverity CID 2669.
* Remove unreachable code (res could never be NULL here).
Fixes Coverity CID 712.
20060509
change (mostly) int to socklen_t. GCC 4 doesn't like that int and
socklen_t are different signness.
20060923
Apply patch from PR bin/33261 sent by FUKAOMI Naoki:
"ftpd does not update wtmpx".
While touching all vptofh/fhtovp functions, get rid of VFS_MAXFIDSIZ,
version the getfh(2) syscall and explicitly pass the size available in
the filehandle from userland.
Discussed on tech-kern, with lots of help from yamt (thanks!).
matter how empty they are.
Note that if two blocks have the same inode and block number, they sort
the same (this should never happen, but if it does there's no reason to
have qsort scramble the list).
Add some diagnostic syslog messages for unusual cases.
In determining when to stop reading segments when counting bytes (-b flag),
total the sizes of the blocks we're actually writing instead of assuming
they are all full blocks: many could be fragments or inode blocks. This
increases the number of segments per Ifile write, markedly improving the
efficiency of the cleaner in the small file case.
indirect block when considering the cleaning of block numbers less
than NDADDR (which do not use indirect blocks).
Also, note the loss of only half a block per segment to fragmentation
when considering the benefit function, rather than a whole block.
- avoid double slashes when displaying man pages (got tired
of '/usr/share/man//cat1/man.0').
- got rid of __P() while working on it.
- incorporate some of my old notes explaining how manpath works into the
comments of the code itself.
- renamed some of the vars so that the code is consistent throughout
(and hopefully clearer and easier to understand)
- fixed relative man paths for multiple man pages (man did a chdir()
on the first man page it had to format --- this broke any remaining
relative path man pages left to process). save old directory and
fchdir() back to it after formatting.
- improved doc on "man -h" which does more than just whatis(1) [e.g.
"man -h fopen" prints the required include files and the prototypes
rather than just the one-liner you get with whatis(1)]
- manconf.c now fills in the "len" length field in the TAG/ENTRY
structures (man now uses len).
revise man.conf file reading stuff to return error on failure in
addentry/gettag (fka getlist) rather than just err()ing out. this
allows man(1) to call cleanup and delete its tmp files rather than
just leave them floating. revise other apps using this code
(makewhatis, apropos, catman, whatis) to expect this. also remove
__P on updated files.
cleaner, but with more legible code.
Includes code for reading and writing to the raw disk device (so that an
unmounted fs could be cleaned), for the use of a single daemon to clean
multiple filesystems to save on resources, and for recording the old
contents of cleaned segments to offline storage for regression testing of
the LFS system as a whole; though these new features are not properly
tested at this point.
free() call, change the allocation policy to leave the responsibility for
allocation/freeing the pathname to _rtld_map_object(), instead of having
the caller allocate it and _rtld_map_object() free it. This simplifies the
code a lot and it is more efficient.
"Fix a bug that showed up when debugging dynamically linked programs.
References from GDB to "printf" and various other functions would
find the versions in the dynamic linker itself, rather than the
versions in the program's libc. This fix moves the GDB link map
entry for the dynamic linker to the end of the search list, where
its symbols will be found only if they are not found anywhere else."
"printf" isn't true for us, but various libc symbols are, e.g. "malloc".
Fixes PR 32074 as noted by uwe@
OK'd by christos@
declaration too.
32-bit SuperH can not pretend that _GLOBAL_OFFSET_TABLE_ is a normal
variable, because of the way PIC variable references is generated, but
as compiler arranges for _GLOBAL_OFFSET_TABLE_ address to be in r12
anyway, just use that value by declaring it as a global register
variable. Makes sh3 compile with RTLD_DEBUG.
_rtld_find_symdef use _rtld_symlook_default.
This reduces the code size and means that dlsym(RTLD_DEFAULT,...) has the
correct lookup order.
Reviewed by kleink. Thanks.
only the second part of the previous revision was needed.
put the logic for the initial icache invalidation of the PLT
back the way it was, but in a way that makes clearer what's going on,
and add some comments explaining it.
This allows for setting the passive socket's SO_RCVBUF. Option works
similarly to the current sendbufsize configuration option.
* Change how recveive_data() works
When reading data from the socket for passive transfers to the server,
receive_data() now works very similar to send_data_with_read(). Reads
from the network are now done using either the filesystem block size or
the configuration option readsize chunks.
* Crank version.h
[Changes discussed with lukem.]
ftpd will listen on the default FTP port for incoming connections and fork
a child for each connection. This is lower overhead than starting ftpd from
inetd(8) and thus might be useful on busy servers to reduce load.
Inspired by FreeBSD.
Reviewed by lukem@.
* Improve some comments and (error) messages.
* Use EXIT_FAILURE and EXIT_SUCCESS.
* Add function `maybe_syslog' (only log when -l is enabled).
Reviewed by christos.
(What would one look at for Kerberos?)
* Be a bit more explicit about the security implications of rsh & friends,
as suggested by Steven M. Bellovin and OK'd by Christos Zoulas
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.
Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.
Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.
Discussed with thorpej and christos.
This adds a -L to all ls command arguments so that the file or directory
the link references is listed rather than the link itself. This was
inspired by IRIX ftpd's -S option.
[Discussed with lukem some time ago.]
* Crank version.h [right Luke? :-)]
* Adapt lfs_cleanerd to use the fcntl call to get the Ifile filehandle,
so it need not be in the namespace.
* Make lfs_cleanerd be more careful when there are very few available
segments.
* Remove the Ifile from the filesystem namespace. The cleaner now uses
a fcntl call on the root inode to find the Ifile filehandle.
* Make lfs_cleanerd less verbose when the filesystem is unmounted.
- Fix how _rtld_relocate_nonplt_self deals with REL32 relocations.
- Change the assert so that it is correct for binutils 2.14 and 2.15.
There are still problems with the libraries generated with binutils 2.15,
but at least ld.elf_so doesn't crash.
that is required to change their password will not be allowed FTP
access. Inspired by similar functionality in other FTP daemons.
(approved by lukem)
* Crank version to 20041119 per lukem's request.
a particular user if the first tty is not writable. This broke in
revision 1.9 when it was strl'ified incorrectly (hi itojun). Thanks
to enami for spotting this.
* Fix yacc parser error recovery so that setjmp(3)/longjmp(3) is unnecessary.
* Fix SIGURG handler to set an urgflag that's later tested, rather than
abusing setjmp(3)/longjmp(3).
* Use "volatile sig_atomic_t" as the type of variables modified by sig handlers.
* Use sigaction(3) instead of signal(3) to set the signal handlers.
* Only set the main SIGALRM handler once. If we need to change it,
cache the old handler and restore appropriately...
* Remove a bunch of signal races by improving the signal handlers.
* Fix memory leak with 'ESPV ALL'.
My stuff:
* Clean up the debug message in reply(); use vsnprintf(3) instead of vsyslog(3).
* Rework parsing of OOB commands to _not_ use the yacc parser, since the
latter isn't reentrant and the hacks to work around that are ugly.
We now examine urgflag at appropriate locations and call handleoobcmd()
if it's set. Since the only OOB commands we currently implement are
ABOR and STAT, this isn't an issue. (I also can't find the reference in
RFC2228 where MIC, CONF & ENC are OOB-only commands. Go figure.)
I could clean up the is_oob stuff some more, but the remaining stuff
in ftpcmd.y is harmless and it's unnecessary churn right this moment.
around the delimiters (commas and colons). Also, at the end of
the "RESPONSE TYPES" section for "USERID" it is explicitly noted
that any spaces after the colon following the OSTYPE field *are*
part of the identifier.
versions used by others in libc weak, so that we have:
name: weak
__name: weak
___name: strong
- Add __name strong aliases of the dlfcn names in ld.elf_so, so that we have:
name: strong
__name: strong
This allows ld.elf_so to self-resolve both the name and __name variants
of the dlfcn functions, the former being required for dlfcn support in
applications, the latter being required for dlfcn support in libc.
Fixes the problem described in:
http://mail-index.netbsd.org/tech-toolchain/2004/07/17/0000.html
Reviewed by Nick.
sysctl variable name in /etc/ld.so.conf. It also makes the ld.elf_so
binary slightly smaller (at least on i386), and has no impact on
performance.
Fixes PR 26100.
one command line option to specify which firewall it is meant to interact
with. The implementation here puts the firewall specific code into separate
files with markers for future changes that could enable a fully transparent
mode for non-private network proxying.
point to directories which do not exist (and are not wanted) in our source tree.
While we're here, was `libexec/spamd' approved for import? It conflicts with the
name of a tool in pkgsrc which a _lot_ of developers and users of NetBSD are using...
Lazy binding doesn't work 100% of the time so force immediate binding.
One possible reason is that the PLT stub blows away r20 which the
compiler might not take into account.
Add some paragraph breaks to make the man page more readable.
Add the history of the talkd -> ntalkd change as I recall it to
the HISTORY section. All of this to answer PR 13433