Commit Graph

2631 Commits

Author SHA1 Message Date
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
wiz 488200e6ea Remove trailing whitespace and superfluous .Pp. 2008-05-25 19:48:35 +00:00
hannken 5d2bff060a Make sure all cached buffers with valid, not yet written data have been
run through copy-on-write.  Call fscow_run() with valid data where possible.

The LP_UFSCOW hack is no longer needed to protect ffs_copyonwrite() against
endless recursion.

- Add a flag B_MODIFY to bread(), breada() and breadn().  If set the caller
  intends to modify the buffer returned.

- Always run copy-on-write on buffers returned from ffs_balloc().

- Add new function ffs_getblk() that gets a buffer, assigns a new blkno,
  may clear the buffer and runs copy-on-write.  Process possible errors
  from getblk() or fscow_run().  Part of PR kern/38664.

Welcome to 4.99.63

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>
2008-05-16 09:21:59 +00:00
mlelstv 2e45fdea28 new openssl returns const method objects. 2008-05-10 19:25:20 +00:00
manu 5ae0f4961a Make sure temporary errors are reported as such, using status code
EX_TEMPFAIL (cannot lookup user through NSS, may be because of an
unreachable NIS or LDAP server), or EX_OSERR (other file or memory
related problems).

Sendmail and Postfix should honour EX_TEMPFAIL and EX_OSERR by
queueing the message.

This avoids problems with transcient NSS errors, where the MTA may
successfully lookup a user at a time while mail.local can fail a
few secoonds later.
2008-05-04 03:03:11 +00:00
degroote e20ddcfff5 slen must be initialized before the call to accept 2008-05-02 19:14:03 +00:00
martin cd22f25e6f Move TNF licenses to 2 clause form 2008-05-02 18:11:04 +00:00
jmmv 75562a3ca6 Adjust the build of the ATF tools to use the new paths to the source files
and the new library names.  Per import of atf-0.5.
2008-05-01 15:35:14 +00:00
martin 11a6dbe728 Convert TNF licenses to new 2 clause variant 2008-04-30 13:10:46 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
christos ffeec10260 warns=4 2008-04-25 17:34:38 +00:00
dholland 6fc636d882 '_' is functionally alphanumeric in many contexts, including login names.
Since it doesn't have case, treat it like a digit. While here, avoid
setting the associated flag variable by incrementing it.
Fixes PR bin/33521; patch based on one from Dieter Roelants.
2008-04-13 02:38:01 +00:00
tsutsui 5e574c5a4a Add more required libraries by libkrb5 and libroken in NOPIC case. 2008-04-10 14:26:33 +00:00
christos 8a487dca06 Fix build from dieter roelants 2008-04-05 20:17:37 +00:00
lukem 4f3847e772 Reorganize USE_PAM support so that the reply(331,) from USER is
performed by the pam_conv (PAM conversation) callback, which then
getline()s the PASS reply internally.  This involves calling
auth_pam() from user() and caching the result to use later in pass().
This allows the PAM modules to present a different password prompt
dialog if necesary.  For example:
  Name (localhost:lukem):
  331 User lukem accepted, provide password [ otp-md4 89 xxxx12345 ].
versus
  Name (localhost:lukem): root
  331 User root accepted, provide password.

This is independent of (and effectively exclusive to) USE_SKEY support.

Previously ftpd with USE_SKEY=yes would provide the skey prompt
if the user had an skey configured, even if /etc/pam.d/ftpd didn't
have pam_skey in use.
I.e., ftpd shouldn't need special support for custom password prompts
(such as skey) if PAM is in use.
2008-03-27 08:12:09 +00:00
mlelstv 2370a334ab Import Heimdal-1.1
more missing files
2008-03-22 09:29:55 +00:00
mlelstv b0f88a0388 Import Heimdal-1.1 2008-03-22 08:36:48 +00:00
lukem e9810351a7 Switch from lockf() to (more portable) fcntl() locking 2008-03-09 20:11:43 +00:00
mrg 37b5177b06 fix a problem in %xy decoding. 2008-03-07 18:20:20 +00:00
dholland 6e8d2b936b y2038 fixes: time_t != long. 2008-03-04 03:05:00 +00:00
dholland c6b9477692 'struct timezone' belongs in the dustbin of history. 2008-03-04 02:57:33 +00:00
dholland 769bcbf94c fix typo in comment 2008-03-04 02:45:01 +00:00
dholland 6c41aa55b8 Sort includes, removing duplicate <time.h>. 2008-03-04 02:34:27 +00:00
mrg 2e2c24f48c merge bozohttpd 20080303 2008-03-03 22:30:34 +00:00
mrg 707281a285 merge bozohttpd 20080303 2008-03-03 22:15:08 +00:00
mrg e1e74f372d import latest bozohttpd. changes include:
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
2008-03-03 22:03:08 +00:00
mrg 9240578f89 use BUILDSYMLINKS to not have to rename bozohttpd.8 while still
having this manual installed as httpd.8.  now updates from my
repo to bozohttpd.8 will appear in this file.
2008-03-03 03:10:53 +00:00
jmmv d8ef502768 Add the atf-exec and atf-killpg tools that come with atf 0.4. 2008-02-04 20:31:32 +00:00
christos b11674e1a4 move gettytab to paths.h 2008-02-04 15:27:20 +00:00
mrg e972654d70 support MKCRYPTO=no:
- don't link -lssl -lcrypto
- -DNO_SSL_SUPPORT
2008-02-03 23:48:09 +00:00
lukem d9ce2acdd5 Explicitly note the unsupported requests from RFC 2228.
Improvements from FreeBSD:
* Document `ftp-chroot' from login.conf(5).
* Document that SIZE is prevented for files > 10240 bytes via ASCII transfers.
2008-01-30 02:16:35 +00:00
yamt 8c93baa802 constify 2008-01-14 08:53:42 +00:00
yamt 8a58f724e1 tabify 2008-01-14 08:52:16 +00:00
simonb d8de5b102b Remove support for NetBSD/pc532. 2008-01-09 11:25:58 +00:00
christos 8fb14189dc make this compile again. 2007-12-29 01:44:03 +00:00
ad 2b5d04688e Make it build with src/sys from the vmlocking2 branch. 2007-12-28 21:44:32 +00:00
christos 716fde8fa0 simplify; mapbase == vaddrbase from the PaX author. 2007-12-28 19:36:21 +00:00
christos 8636ab52f6 Deal with ASLR PIE executables, by recognizing that phdr != phdr->v_addr
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)
2007-12-26 21:14:41 +00:00
christos 8b0637156f No need for stack_protector.o if USE_FORT is no.
XXX: compiling a binary with -Wl,--dynamic-linker,${NETBSDSRCDIR}/libexec/...
results in stack overflow. Investigate!
2007-12-26 21:11:52 +00:00
christos 5ad1b72097 print the symbol we are seaching for [when debugging] 2007-12-26 21:10:03 +00:00
perry 9dfe283011 remove cdefs.h at mrg's request 2007-12-16 02:38:24 +00:00
perry 8b0f9554ff convert __attribute__s to applicable cdefs.h macros 2007-12-15 19:44:37 +00:00
perry 36c7456d7c include sys/cdefs.h so that __attribute__ can be fixed later 2007-12-15 16:32:05 +00:00
ad 558a5ffd0f rtld changes for PR bin/37347:
- 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@.
2007-12-07 20:34:04 +00:00
isaki 5b22b72692 white space fix. 2007-12-03 09:54:24 +00:00
wiz 04cd5014b6 filetypes -> file types. 2007-12-02 19:15:07 +00:00
christos 496f9be3e8 support %z 2007-11-24 18:32:26 +00:00
ad 71ac015ebf stack_protector.c has moved. 2007-11-13 15:34:51 +00:00
jmmv 9d5a9c0d86 Add the atf tools
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.
2007-11-12 15:00:00 +00:00
rtr 3aa5278c3a - remove const from h_header, this pointer is occasionally free'd
- 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)
2007-11-04 15:20:11 +00:00
rtr 6dc1829962 + don't free strdup()'d ptr that was manipulated.
(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.
2007-11-04 06:07:52 +00:00
skrll 29353f93e2 Build a local copy of exit that doesn't call __cxa_finalize. It's not
needed and drags in a lot of libc via free.
2007-10-30 17:19:59 +00:00
christos ed1a8fea8d build stack protector locally so that we don't call syslog_ss that results
in 1/2 of libc dragged in.
2007-10-29 20:36:31 +00:00
ad bc89ba23ac Make the dir indexes less ugly (horizontal rules were out of place). 2007-10-18 18:53:59 +00:00
he a9cf29f812 A build for sun2 reveals that we also need -lcrypt, as auth-bozo.c
otherwise gets an unsatisfied reference to crypt().
2007-10-18 17:43:02 +00:00
tls 18c80b6525 RCS IDs 2007-10-17 18:47:59 +00:00
tls 13d3c473b0 Fix two memory leaks noted by Coverity (CID-4694, CIT-4695) and use
SIMPLEQ_FOREACH where possible.  Patch from Arnaud Lacombe.
2007-10-17 18:43:46 +00:00
reed 15823ba9ad Document .htpasswd / HTTP "Basic" authentication support.
Update date of man page too.
2007-10-17 13:55:46 +00:00
reed 7c5821fbe4 Fix typo in EXAMPLES (unknown service).
While there mention inetd.conf(5) again (since in a new section of man page).
2007-10-17 13:33:18 +00:00
reed dbfaed2362 Fix typo on Makefile which causes HTTP Authentication support
to not be used.

Now fix auth-bozo.c to not have warnings "may be used uninitialized"
and pointer targets "differ in signedness".
2007-10-17 13:27:19 +00:00
reed ca8ed3ab02 Remove extra period. 2007-10-16 22:50:01 +00:00
tls 215e50961e Add httpd to the build. Add _httpd to passwd and groups and postinstall.
Add /var/www to mtree, add example line to inetd.conf.
2007-10-16 02:47:12 +00:00
tls 1d63366b2d Get httpd ready for inclusion in build. 2007-10-16 01:31:03 +00:00
tls ba6eac50dd Move bozohttpd.8 to httpd.8 2007-10-16 01:29:44 +00:00
tls 60dbe74596 Import of bozohttpd for its originally intended purpose: a small (~30k)
simple run-from-inetd httpd suitable for small systems (and some large
ones).
2007-10-16 01:14:01 +00:00
ad 9c5739f1c6 brelse() now takes two arguments. 2007-10-08 21:41:12 +00:00
ad bf4b000d16 - Don't use the names malloc/free/etc, since we can end up pulling in libc's
malloc which is not what we want.
- Remove ancient memory compaction hack. Realloc on free memory is now an
  error again (from joerg@).

Ok christos@.
2007-10-05 22:21:07 +00:00
christos 596c6ec5db provide xrealloc, and don't cast and use malloc and realloc directly. 2007-09-27 17:52:16 +00:00
christos 2cce1500a2 If we are using SSP, compile in a separate copy of the stack protector
functions so that we don't end up calling syslog_ss() which drags in
a large portion of libc. Found by skrll...
2007-09-27 17:51:40 +00:00
christos 6f875d32e2 Don't trust AT_SUN_EXECNAME, if we are set{u,g}id. 2007-09-21 13:57:09 +00:00
christos 6eac115581 delete debug printf
make regress compile again.
2007-09-20 19:42:53 +00:00
christos 40cfdb5e3a Use AT_SUN_EXECPATH instead of argv[0] for the executable name. This needs
kernel support, which is not there yet, thus $ORIGIN is broken at this time.
This is ok, nothing uses it yet.
2007-09-20 14:14:25 +00:00
cube f7779133cd Don't remove the last component of filename before calling
_rtld_digest_dynamic:  it is done in expand(), and doing it twice is once
too much.  This fixes $ORIGIN expansion for dependencies.
2007-09-20 07:50:32 +00:00
tnn ea0fc2f827 5 is not a valid version for .Nx, so change it to 5.0. 2007-09-13 21:32:14 +00:00
joerg ad61ac15d2 Don't define bool, false and true. Use stdbool.h. 2007-09-02 09:57:16 +00:00
tls b8360b28b0 Oops. USE_FORT needs to be in Makefile.inc, not Makefile, to cause the
programs in subdirectories here to get -D_FORTIFY_SOURCE.
2007-08-16 18:36:46 +00:00
lukem f21ab048da Rename cred_t to ftpd_cred_t; the former causes a nameclash on Solaris. 2007-07-23 10:41:05 +00:00
lukem 0def0e3a66 Rename HAVE_SOCKADDR_SA_LEN to HAVE_STRUCT_SOCKADDR_SA_LEN.
Use defined(HAVE_foo) instead of just testing HAVE_foo.
2007-07-22 05:06:45 +00:00
christos 2ffe4b875f Use an elf note to handle pax arguments. This is a temporary solution to
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...
2007-06-24 20:35:36 +00:00
christos b7c1cbea43 PR/36468: Andreas Wrede: ftpd(8) always logs hostnames. Add -n option to display
addresses.
2007-06-10 20:24:31 +00:00
tls 4147a3c54a Add new Makefile knob, USE_FORT, which extends USE_SSP by turning on the
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.
2007-05-28 12:06:17 +00:00
christos 3b320420fe fix a comment. 2007-05-18 21:46:39 +00:00
christos 04ee85ad50 Support Solaris-like $ORIGIN etc. expansions in paths. 2007-05-18 21:44:08 +00:00
lukem aeb5730de8 Replace references from draft-ietf-ftpext-mlst-NN to RFC 3659. 2007-05-10 05:59:30 +00:00
christos 8cb0a31f67 PR/36266: David A. Holland: Don't read and write sig_atomic_t variables in
signal handlers; only write them.
2007-05-03 15:09:41 +00:00
lukem 0f13d99318 Expand documentation on numeric argument suffix parsing, and convert
to IEC 60027-2 prefixes for 2^n multiples ("KiB" instead of "KB", etc.)
2007-04-13 01:36:10 +00:00
scw 596a371d09 Remove a test for defined(__SH5__). 2007-04-08 10:02:35 +00:00
scw 5764a76889 Remove support for NetBSD/{,evb}sh5. 2007-04-08 09:35:21 +00:00
matt 549524f84f Deal with MKPICLIB != no. 2007-03-15 17:27:15 +00:00
matt ee98d74a6b Remove MD COMBRELOC support since it's now MI.
Enable COMBRELOC for all arches
2007-02-23 01:17:11 +00:00
matt 364993dede Don't use cached results for plt lookups (nor save them). 2007-02-23 01:16:32 +00:00
matt 4d10e5e667 Make the COMBRELOC support generic. 2007-02-22 18:57:48 +00:00
hubertf 9c23f96c50 Move ctype.h from headers to files which really need it
From: Slava Semushin <slava.semushin@gmail.com>
2007-02-21 21:14:07 +00:00
hubertf ee68ca46c0 Remove unnecessary ctype.h from libexec/comsat/comsat.c file
From: Slava Semushin <slava.semushin@gmail.com>
2007-02-21 21:06:26 +00:00
martin 3cc1de3d7b Add COMBRELOC support 2007-02-15 19:42:13 +00:00
skrll 1fddd99f52 Provide COMBRELOC support for amd64 in answer to PR/35589.
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
2007-02-15 15:44:28 +00:00
christos 8fdab46bcc PR/35449: Shigeya Suzuki: ftpd does not register socket address into PAM +FIX 2007-01-20 17:26:32 +00:00
hubertf d405d8ca2b Remove duplicated #includes and some trailing whitespace while here.
From Slava Semushin <slava.semushin@gmail.com>
2007-01-17 21:44:50 +00:00
christos 129c516e3b - use getnameinfo instead of gethostbyaddr
- add tsa2sa and use it
2007-01-08 17:51:34 +00:00
wiz fc86b06120 Bump date for previous. 2006-12-23 07:21:34 +00:00
christos aca8873558 fix volatile and initialization issues, from Anon Ymous 2006-12-17 20:04:09 +00:00
he 0a97c3f688 Complete the move of string_to_flags() and flags_to_string() from the
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
2006-12-14 20:09:35 +00:00
jdolecek 20480d6fc5 allow compilation without SUPPORT_UTMP 2006-12-04 21:13:22 +00:00
wiz 09cb1d6f1c s/existance/existence/, from Zafer. 2006-11-24 22:52:16 +00:00
christos 1665d5e960 fix spelling of accommodate; from Zapher. 2006-11-24 19:46:58 +00:00
christos aac134252a From defend dot the dot world at gmail dot com: Sanitize environment variables
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.
2006-11-22 21:46:36 +00:00
tls 86c7b9ff84 Temporarily disable -c (file coalescing) until data corruption issues can
be resolved.
2006-11-18 18:43:25 +00:00
atatat bade8c3805 remove stray links 2006-11-16 04:43:32 +00:00
christos 2343154519 pass lint 2006-11-16 04:31:24 +00:00
christos f8013c3836 fix gcc4 sign issues. 2006-11-16 04:15:13 +00:00
christos a682c5bf65 - remove stray mlinks
- remove gcc4 hacks
2006-11-16 04:14:50 +00:00
christos 96a58b2a60 more uucp cleanup 2006-11-16 00:49:20 +00:00
christos bc2479d202 no more rmail. 2006-11-12 01:27:29 +00:00
jmmv 2947e73b43 Move lfs_cleanerd from /usr/libexec to /libexec. This is to allow putting
the root file system on a LFS volume.

Addresses PR bin/30407.  No objections in tech-userlevel@.
2006-11-11 14:47:27 +00:00
christos 161813f9e4 eliminate alloca for ssp. 2006-11-09 19:45:57 +00:00
skrll 6f388cd224 Create _rtld_relocate_plt_object and use it in _rtld_bind and
_rtld_relocate_plt_objects.

No functional change.
2006-10-17 08:33:36 +00:00
skrll 152e43d87a Support unaligned DIR32 relocs.
Closes PR 18293
2006-10-17 08:28:06 +00:00
skrll edf13fb5fb Reformat a comment. 2006-10-16 13:53:09 +00:00
skrll 78b8583054 Correct the frame size for a couple of ENTRYs 2006-10-16 13:52:47 +00:00
wiz 818a1c08a3 Fix typo in macro. 2006-10-13 20:28:06 +00:00
wiz f10fc51879 Sort SEE ALSO. 2006-10-13 20:27:42 +00:00
peter e263dfd62f WFORMAT is no more... 2006-10-08 17:52:28 +00:00
elad 7d7720ce94 Don't print uninitialized errno, from David A. Holland on #NetBSD-code 2006-10-07 18:26:40 +00:00
elad 516c371048 PR/13478: Greg A. Woods: some tty-related documentation fixes
Patch applied with "minor tweaks" from me, thanks!
2006-10-06 22:07:44 +00:00
christos a0feefba6a Avoid buffer overflow. 2006-09-29 17:02:04 +00:00
christos 36ac62d963 PR/34658: der Mouse: identd truncates queries to first segment 2006-09-29 15:49:29 +00:00
christos fec1382c1e Coverity CID 3931: Fix memory leak. 2006-09-27 17:15:20 +00:00
lukem c7e71f1d87 Fix -ULOGIN_CAP compile. 2006-09-26 06:47:20 +00:00
lukem 6dd25eb757 Update to 20060923 for the following changes:
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".
2006-09-25 06:30:55 +00:00
xtraeme 47e7cfa9b7 Apply patch from PR bin/33261 sent by FUKAOMI Naoki:
"ftpd does not update wtmpx".

Thanks.
2006-09-23 16:03:50 +00:00
hubertf 5163058672 Handle .br - this makes processing of the netbsd-4
src/dist/bzip2/bzip2.1 file work:

Before:
	% getNAME /usr/cvs/src-4/dist/bzip2/bzip2.1
	bzip2, bunzip2 (1) - a block-sorting file compressor, v1.0.2 .br bzcat (1) - decompresses files to stdout .br bzip2recover (1) - recovers data from damaged bzip2 files

After:
	% getNAME /usr/cvs/src-4/dist/bzip2/bzip2.1
	bzip2, bunzip2 (1) - a block-sorting file compressor, v1.0.2
	bzcat (1) - decompresses files to stdout
	bzip2recover (1) - recovers data from damaged bzip2 files

Verified with code from src/share/man/man0 that nothing else was
broken by this change.
2006-09-12 21:56:43 +00:00
perseant a2ecf39b35 Pay attention to the new LFS_CLEANER_MUST_CLEAN flag in the Ifile. 2006-09-01 19:43:51 +00:00
christos e3b62f5882 Only include libutil if !HOSTPROG 2006-08-30 12:11:40 +00:00
simonb 676a630d08 Simplify multiple MACHINE_ARCH endian checks with single MACHINE_CPU
checks.
2006-08-27 07:22:02 +00:00
christos 5a7156cc58 use efun(3) 2006-08-26 18:18:16 +00:00
martin b4cb63a646 Make filehandles opaque to userland 2006-07-31 16:34:42 +00:00
martin a3b5baed42 Fix alignement problems for fhandle_t, exposed by gcc4.1.
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!).
2006-07-13 12:00:24 +00:00
perseant 21393db687 Place an upper bound on the number of segments to clean at one time, no
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.
2006-07-07 18:19:30 +00:00
skrll a238470b22 Add (back) -Wl,-static to the link. 2006-06-29 19:30:59 +00:00
simonb 428d37fad6 Fix unaligned loads and stores generated by gcc4. Problem described in
http://mail-index.NetBSD.org/tech-toolchain/2006/06/27/0001.html.
This cleaner version of the patch from Christos - thanks!
2006-06-28 16:48:38 +00:00
simonb 7d5684f475 Use .previous at the end of the NetBSD ident note so that we switch
back to the previous section.  Fixes build problems on MIPS with gcc4
and -g.
2006-06-13 13:55:58 +00:00
mrg 0f0f2b4e93 in _rtld_bind() initialise new_value for GCC4. 2006-05-23 16:27:41 +00:00
drochner eb92277cd7 sprinkle some __noreturn__ attributes, saves gcc4 warnings elsewhere 2006-05-22 19:49:09 +00:00
mrg d677e4a13a avoid more GCC4 uninitialised variable problems. (sh3 known, vax guessed.) 2006-05-21 04:17:35 +00:00
dan b995f58933 appease gcc4 uninitialiased warning
ok mrg.
2006-05-20 23:38:27 +00:00
mrg 82f7733046 in _rtld_bind() initialise result to appease GCC4. 2006-05-20 07:09:44 +00:00
christos df73c1693c Coverity CID 3766: Avoid null pointer deref 2006-05-19 14:46:17 +00:00
perseant 45dc123d6e Be more careful about checking return value of {m,re}alloc().
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.
2006-05-12 19:33:02 +00:00
mrg aadd7d4847 sprinkle some -fno-strict-aliasing and -Wno-pointer-sign with GCC4. 2006-05-11 23:16:28 +00:00
mrg 6daaa2e383 use a u_char[] when it is expected. 2006-05-11 12:27:21 +00:00
mrg bb50bce731 avoid some char * vs. u_char * issues. 2006-05-11 12:26:38 +00:00
mrg 4bc6feceb6 end the argument list to exec*(3) with a NULL instead of a bare '0', as
the latter isn't a pointer context in these varargs functions.
2006-05-11 00:22:52 +00:00
mrg 084c052803 quell GCC 4.1 uninitialised variable warnings.
XXX: we should audit the tree for which old ones are no longer needed
after getting the older compilers out of the tree..
2006-05-10 21:53:14 +00:00
mrg 0c37c63edc change (mostly) int to socklen_t. GCC 4 doesn't like that int and
socklen_t are different signness.
2006-05-09 20:18:05 +00:00
blymn d791be4b46 New io statistics 2006-04-14 13:19:03 +00:00
perseant 0cdeebe9fa When checking hidden cleaning costs, don't erroneously add the first
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.
2006-04-14 00:58:32 +00:00
chuck d09fe2c467 modified man(1):
- 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.
2006-04-10 14:39:06 +00:00
perseant 1b08b7c6a1 Look for the inode pointers in the right place if lfs_bsize != lfs_fsize. 2006-04-05 21:42:49 +00:00
perseant 2c3f7b46ba Handle the case of inode blocks misidentified by the segment headers
correctly, a problem reported by Kurt Schreiner; as well as similar
error cases (realloc returning NULL or no cleanable segments found).
2006-04-05 20:29:40 +00:00
skrll c965f60a50 Remove empty lines. 2006-04-03 13:23:15 +00:00
christos bfe8a650d3 Coverity CID 2792: Fix memory leaks 2006-04-01 23:53:11 +00:00
christos 2b955dc8fb Coverity CID 2846: Don't use LIST_FOREACH if you are going to free the cursor 2006-04-01 23:50:50 +00:00
christos f1e970a046 Coverity CID 2847: Don't use LIST_FOREACH if you are going to free the
current pointer!
2006-04-01 23:48:56 +00:00
perseant 260a2c76af Document -i option, update date; at the request of wiz@. 2006-04-01 08:44:57 +00:00
perseant 9c75397609 A new version of the cleaner. In general, works about as well as the old
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.
2006-03-30 19:10:13 +00:00
wiz 2bb817a755 Remove more references to kerberosIV. 2006-03-23 20:14:16 +00:00
christos 0339fe6614 Coverity CID 2749: Fix another double free. Instead of removing that last
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.
2006-03-21 17:48:10 +00:00
christos 85e611dd01 Goodbye KerberosIV 2006-03-20 04:03:10 +00:00
christos 458b13dee7 Coverity CID 923: Avoid NULL deref. 2006-03-18 23:09:34 +00:00