Commit Graph

12472 Commits

Author SHA1 Message Date
Tim Kientzle
cc2a51aaf7 Merge from libarchive.googlecode.com r791, r879, r884, r948: Various
fixes to read_support_compression_program.  In particular, failure of
the external program is detected a lot earlier, which gives much more
reasonable error handling.
2009-04-12 05:47:23 +00:00
Tim Kientzle
056e26b45e Thanks to Christoph Mallon for pointing out the dead variable here.
Also, rework this a little to make the logic excruciatingly clear.
2009-04-12 05:38:35 +00:00
Tim Kientzle
e2421f7667 Merge from libarchive.googlecode.com: Mostly a bunch of
corrections to the Windows support to reconcile differences
between Visual Studio and Cygwin.  Includes parts of
revisions 757, 774, 787, 815, 817, 819, 820, 844, and 886.

Of particular note, r886 overhauled the UTF-8/Unicode conversions to
work correctly regardless of whether the local system uses 16-bit
or 32-bit wchar_t.  (I assume that systems with 16-bit wchar_t
use UTF-16 and those with 32-bit wchar_t use UCS-4.)  This revision
also added a preference for wcrtomb() (which is thread-safe) on
platforms that support it.
2009-04-12 05:33:34 +00:00
Tim Kientzle
e1089c1e0c Merge from libarchive.googlecode.com r756,r761:
Document the new archive_read_disk API.
2009-04-12 05:04:02 +00:00
Tim Kientzle
f8c35626c4 Merge from libarchive.googlecode.com:
r751: Change __archive_strncat() to use a void * source, which reduces
the amount of casting needed to use this with "char", "signed char"
and "unsigned char".
r752: Use additions instead of multiplications when growing buffer;
faster and less chance of overflow.
2009-04-12 04:59:11 +00:00
Tim Kientzle
0da7a22640 Merge r881 from libarchive.googlecode.com: The "empty" format
should not be recognized if there is a read error.
2009-04-12 04:45:40 +00:00
Ed Maste
14846f9b49 Include a space between "send" and "broadcast". 2009-04-09 20:57:35 +00:00
Edward Tomasz Napierala
5174a6a262 Add wide character variants of string manipulations routines to 'SEE ALSO'.
Approved by:	rwatson (mentor)
2009-04-07 13:42:53 +00:00
Marcel Moolenaar
a5a8dffc5b Add support for PowerPC kernel core files. This commit only adds
support for virtual core files (aka minidumps). physical core
files are not supported.

The implementation is cross-tool ready and can be used in a non-
powerpc hosted debugger to analyze PowerPC core files. It also
accepts core files that still have the dump header, as can be
the case within Juniper where TFTP-based kernel core files are
supported and savecore is not used to "extract" the core file
from some dump device.

Obtained from:	Juniper Networks, Inc.
2009-04-06 21:52:10 +00:00
David Schultz
6685ac34d9 Return -1 instead of 0 upon reaching EOF. This is somewhat ill-advised
because it means getdelim() returns -1 for both error and EOF, and
never returns 0. However, this is what the original GNU	implementation
does, and POSIX inherited the bug.

Reported by:	marcus@
2009-04-06 13:50:04 +00:00
Andrew Thompson
dc8f21bc49 MFp4 //depot/projects/usb@159934
Update libusb function descriptions.

Submitted by:	Chuck Robey
2009-04-05 18:30:24 +00:00
Tim Kientzle
4ef9925138 Temporary hack to unbreak user/group lookups;
use a larger buffer for getpwuid_r/getgrgid_r.
This needs to be dynamically sized.
2009-04-04 20:08:08 +00:00
Konstantin Belousov
c8da4f07d7 Allow the NULL, RTLD_SELF and RTLD_NEXT handles to work with dlfunc(3).
dlfunc() called dlsym() to do the work, and dlsym() determines the dso
that originating the call by the return address. Due to this, dlfunc()
operated as if the caller is always the libc.

To fix this, move the dlfunc() to rtld, where it can call the internal
implementation of dlsym, and still correctly fetch return address.
Provide usual weak stub for the symbol from libc for static binaries.
dlfunc is put to FBSD_1.0 symver namespace in the ld.so export to
override dlfunc@FBSD_1.0 weak symbol, exported by libc.

Reported, analyzed and tested by:	Tijl Coosemans <tijl ulyssis org>
PR: standards/133339
Reviewed by:	kan
2009-04-03 19:17:23 +00:00
Xin LI
9b4dadd3e0 Properly handle malloc() failures.
PR:		bin/83338
2009-04-02 22:17:02 +00:00
Xin LI
985a73f6d3 Remove a warning which is supposed to have been removed on 20030301. 2009-04-02 21:51:54 +00:00
Xin LI
06f535757c Bail out when memory allocation is failed, rather than referencing
a NULL pointer.

PR:		kern/94480
Submitted by:	Michiel Pelt <m.pelt xs4all nl>
2009-04-02 17:16:39 +00:00
John Baldwin
1c52c37eae Properly update the shm_open/shm_unlink symbol versioning metadata after
these functions were moved into the kernel:
- Move the version entries from gen/ to sys/.  Since the ABI of the actual
  routines did not change, I'm still exporting them as FBSD 1.0 on purpose.
- Add FBSD-private versions for the _ and __sys_ variants.
2009-04-02 15:53:29 +00:00
Konstantin Belousov
8b61c10e48 Unconditionally build wrappers for i386_get_ioperm(), i386_set_ioperm(),
i386_get_ldt() and i386_set_ldt().

In collaboration with:	pho
Reviewed by:	jhb
2009-04-01 19:23:46 +00:00
Konstantin Belousov
b2e4ce45d9 Document RTLD_NODELETE, -z nodelete and -z origin support. 2009-04-01 14:38:20 +00:00
John Baldwin
b0d8ed7ad3 Fix an off-by-one buffer overflow in ngets().
Submitted by:	Bruce Can
MFC after:	1 month
2009-03-31 14:30:46 +00:00
David Xu
35c608253d Turn on nodelete linker flag because libthr can not be unloaded safely,
it does hook on to libc.
2009-03-31 02:50:18 +00:00
Hajimu UMEMOTO
bc42149220 Query DNS only once per an address family.
Obtained from:	KAME
MFC after:	2 weeks
2009-03-29 17:55:11 +00:00
Xin LI
e8ee08bad8 Add some casts to silence compiler warning about signedness. 2009-03-28 07:44:08 +00:00
Xin LI
9fc74a871c Minor changes from Berkeley DB 1.86 and further improvements from OpenBSD.
This does not include the new hash routines since they will cause problems
when reading old hash files.

Since mpool(3) has been changed, provide a compatibility shim for older
binaries.

Obtained from:	OpenBSD
2009-03-28 07:31:02 +00:00
Xin LI
73590c342a Allow O_SYNC and O_NOFOLLOW flags in dbopen().
Obtained from:	OpenBSD
2009-03-28 07:26:00 +00:00
Xin LI
6c90d46ee5 Plug memory leaks and a potential NULL dereference.
Obtained from:	OpenBSD
2009-03-28 07:20:39 +00:00
Xin LI
edcdc752ec Simplify the logic when determining whether to zero out a db file to after
open().  The previous logic only initializes the database when O_CREAT is
set, but as long as we can open and write the database, and the database
is empty, we should initialize it anyway.

Obtained from:	OpenBSD
2009-03-28 07:09:51 +00:00
Xin LI
a47fc82519 - If (keysize+datasize)%(bsize=14)==0, insertion of a `big key' would cause
an invariant (actually, an ugly hack) to fail, and all Hell would break
   loose.

   When deleting a big key, the offset of an empty page should be bsize, not
   bsize-1; otherwise an insertion into the empty page will cause the new key to
   be elongated by 1 byte.

   Make the packing more dense in a couple of cases.

 - fix NULL dereference exposed on big bsize values;

Obtained from:	NetBSD via OpenBSD
2009-03-28 06:47:05 +00:00
Xin LI
4524c90576 Avoid NULL deference which causes DEBUG1 to crash, not to print useful
information.

Obtained from:	OpenBSD
2009-03-28 06:40:48 +00:00
Xin LI
89bc741f77 - Avoid overwriting the cursor page when the cursor page becomes the
LRU page.
 - Fix for sequential retrieval failure when using large key/data pairs.

Obtained from:	OpenBSD
2009-03-28 06:38:31 +00:00
Xin LI
213bceeead Fix a crash when iterating over a hash and removing its elements.
Obtained from:	OpenBSD
2009-03-28 06:30:43 +00:00
Xin LI
3130c353f8 Only squeeze a short key/value pair onto a page with other complete key/value
pairs, not onto a page containing the end of a big pair.

Obtained from:	NetBSD via OpenBSD
2009-03-28 06:25:33 +00:00
Xin LI
b115f257ba Diff reduce against OpenBSD, no functional change. 2009-03-28 06:23:10 +00:00
Xin LI
a53e89e3a1 Return meaningful errno in overflow case; print error message to stderr
in one more case.

Obtained from:	NetBSD via OpenBSD
2009-03-28 06:12:39 +00:00
Xin LI
d3b2afad1b Use pread(2) and pwrite(2) instead of lseek(2) + read(2) / write(2).
Obtained from:	NetBSD via OpenBSD
2009-03-28 06:05:53 +00:00
Xin LI
02d7f710b8 db/btree/bt_open.c: check return value of snprintf() and return value
if the result is truncated.

db/hash/hash_page.c: use the same way to create temporary file as
bt_open.c; check snprintf() return value.

Obtained from:	OpenBSD
2009-03-28 05:57:27 +00:00
Xin LI
f60486b3ce Several signed/unsigned warning fixes. 2009-03-28 05:45:29 +00:00
Xin LI
c9f30aaaf7 When allocating memory, zero out them if we don't intend to overwrite them
all; before freeing memory, zero out them before we release it as free
heap.  This will eliminate some potential information leak issue.

While there, remove the PURIFY option.  There is a slight difference between
the new behavior and the old -DPURIFY behavior, with the latter initializes
memory with 0xff's.  The difference between old and new approach does not
generate observable difference.

Obtained from:	OpenBSD (partly).
2009-03-28 04:00:46 +00:00
Diomidis Spinellis
15ced2cfb3 Document missing requests. 2009-03-27 11:03:02 +00:00
Hajimu UMEMOTO
4d75630780 Add support for SCTP to getaddrinfo(3).
Now, getaddrinfo(3) returns two SOCK_STREAMs, IPPROTO_TCP and
IPPROTO_SCTP.  It confuses some programs.  If getaddrinfo(3) returns
IPPROTO_SCTP when SOCK_STREAM is specified by hints.ai_socktype, at
least Apache doesn't work.  So, I made getaddrinfo(3) to return
IPPROTO_SCTP with SOCK_STREAM only when IPPROTO_SCTP is specified
explicitly by hints.ai_protocol.

PR:		bin/128167
Submitted by:	Bruce Cran <bruce__at__cran.org.uk> (partly)
MFC after:	2 week
2009-03-25 16:23:43 +00:00
Alexander Leidinger
c5f562d25a Improve the German translation.
Some parts (ERANGE, ETXTBSY) triggered by Christoph Mallon.

Discussed with:	brueffer, gabor (previous version)
2009-03-25 12:36:37 +00:00
Gabor Kovesdan
fa332705da - Add Belarusian catalog
PR:		conf/133004
Submitted by:	Tatsiana Elavaya <t.elavaya@gmail.com>
2009-03-24 23:31:41 +00:00
Fabien Thomas
c2a3620fc3 Allow compile from c++ for libpmc
Approved by:	jkoshy (mentor)
MFC after:	3 days
2009-03-24 22:35:05 +00:00
Hajimu UMEMOTO
d53978e3c0 getaddrinfo(3) should accept numeric when ai_socktype is not
specified in hint or hints is NULL.

PR:		bin/51827
Submitted by:	Mark Andrews <marka__at__isc.org>
MFC after:	1 week
2009-03-24 17:47:24 +00:00
Xin LI
6c0af71bdc Save errno before calling _close(), which may clear it.
Obtained from:	OpenBSD
2009-03-23 23:43:07 +00:00
Xin LI
7efabbb915 use more proper format string.
Obtained from:	NetBSD via OpenBSD
2009-03-23 23:22:09 +00:00
Konstantin Belousov
2e92f03abd 7.2 will be the first release where strndup() appears.
Submitted by:	Florian Smeets <flo kasimir com>
MFC after:	3 days
2009-03-22 15:29:12 +00:00
Rui Paulo
79df44667c Fix typo in comment. 2009-03-22 01:24:32 +00:00
Rui Paulo
919b495ca7 Install the new headers. 2009-03-22 01:06:39 +00:00
Rui Paulo
28510af555 Support files for new libpcap 1.0.0.
Includes a shlib bump.
2009-03-21 22:59:02 +00:00
Doug Barton
6b52fc0a79 Vendor import of BIND 9.4.3-P2 2009-03-21 21:37:05 +00:00
Maxim Konovalov
30905e0ffc o Spell. 2009-03-21 10:10:33 +00:00
Gabor Kovesdan
abc2df4ae4 - Add Ukranian catalog
Submitted by:	Alex Kozlov <spam@rm-rf.kiev.ua> (via private mail)
2009-03-20 23:55:01 +00:00
Konstantin Belousov
29986e1bac Forcibly unlock the malloc() locks in the child process after fork(),
by temporary pretending that the process is still multithreaded.
Current malloc lock primitives do nothing for singlethreaded process.

Reviewed by:	davidxu, deischen
2009-03-19 10:32:25 +00:00
Gabor Kovesdan
e5470fee62 - Fix typo
PR:		kern/132773
Reported by:	Alan R. S. Bueno <alan.bsd@gmail.com>
Submitted by:	Murilo Opsfelder <mopsfelder@gmail.com>
2009-03-18 14:33:10 +00:00
Xin LI
38d3e5fecf Add prototypes for libusb20_be_[gs]et_template. 2009-03-17 21:20:39 +00:00
Gabor Kovesdan
3d945c9d67 - Add Brazilian Portuguese catalog [1]
- Fixes for German catalog [2]

PR:		kern/132694 [1], conf/80504 [2]
Submitted by:	Murilo Opsfelder <mopsfelder@gmail.com> [1],
		brueffer [2]
2009-03-16 16:33:08 +00:00
Gabor Kovesdan
8a6a076cb4 - Create the buildworld object directories with mtree instead of various
mkdir calls
- Remove the ugly workaroung from libc NLS, which was to create some of
  these directories
2009-03-15 13:14:06 +00:00
David Schultz
fbaabc11ae Namespace: scalb() is withdrawn from POSIX. 2009-03-14 18:58:53 +00:00
David Schultz
24863729f9 Eliminate __real__ and __imag__ gccisms. 2009-03-14 18:24:15 +00:00
Gabor Kovesdan
49a33c0b43 - Fix object directory creation when running threaded buildworld 2009-03-13 22:41:30 +00:00
Gabor Kovesdan
fe73c506a4 - Reenable Native Language Support in libc. This feature was disabled due
to possible breakages in the catalog handling code.  Since then, that
  code has been replaced by the secure code from NetBSD but NLS in libc
  remained turned off.  Tests have shown that the feature is stable and
  working so we can now turn it on again.

- Add several new catalog files:
  - ca_ES.ISO8859-1
  - de_DE.ISO8859-1
  - el_GR.ISO8859-7  (by manolis@ and keramida@)
  - es_ES.ISO8859-1  (kern/123179, by carvay@)
  - fi_FI.ISO8859-1
  - fr_FR.ISO8859-1  (kern/78756, by thierry@)
  - hu_HU.ISO8859-2  (by gabor@)
  - it_IT.ISO8859-15
  - nl_NL.ISO8859-1  (corrections by rene@)
  - no_NO.ISO8859-1
  - mn_MN.UTF-8      (by ganbold@)
  - sk_SK.ISO8859-2
  - sv_SE.ISO8859-1
  (The catalogs without explicit source has been obtained from NetBSD.)

Approved by:	attilio
2009-03-13 10:40:38 +00:00
David E. O'Brien
449c70725e Don't need to set symbol, default value is OK. 2009-03-12 04:44:09 +00:00
Tim Kientzle
351ae75265 Hack: *Temporarily* disable reading extended attributes from disk, as
it seems to be badly broken on ZFS.
2009-03-11 05:11:57 +00:00
Xin LI
38f92d0c69 Reflect license change from NetBSD.
Obtained from:	NetBSD
2009-03-10 21:13:26 +00:00
Andrew Thompson
4eaae44dbf Update libusb.3 name and add mlinks for usb.3 and libusb20.3 2009-03-10 15:49:43 +00:00
Andrew Thompson
0b6e7271f0 Be compatible with LibUSB from sourceforge and close the handle after reset
Submitted by:	Hans Petter Selasky
2009-03-10 14:29:34 +00:00
Andrew Thompson
6df5593410 Commit missed file in r189587, update directory name for libusb.
Spotted by:	rdivacky
2009-03-09 17:38:14 +00:00
Andrew Thompson
df4b8c2a2d libusb20 is now installed as libusb, remove the version number from the
directory name.
2009-03-09 17:09:46 +00:00
Andrew Thompson
a091d2a525 Install libusb20.so.1 as libusb.so.1, there will be a followup commit to the
ports tree so that programs use libusb from the base by default. Thanks to
Stanislav Sedov for sorting out the ports build.

Bump __FreeBSD_version to 800069

Help and testing by:	stas
2009-03-09 17:05:31 +00:00
David Xu
5b71b82e70 Don't ignore other fcntl functions, directly call __sys_fcntl if
WITHOUT_SYSCALL_COMPAT is not defined.

Reviewed by:	deischen
2009-03-09 05:54:43 +00:00
David Xu
c30c187d60 Don't reference non-existent __fcntl_compat if WITHOUT_SYSCALL_COMPAT is defined.
Submitted by:	Pawel Worach "pawel dot worach at gmail dot com"
2009-03-09 02:34:02 +00:00
Tim Kientzle
3882931590 Set version to 2.6.901a to indicate this now matches
libarchive.googlecode.com r745.  (Except for the lzma/xz support,
which needs a little more attention before it can be merged.)
2009-03-08 04:32:38 +00:00
Tim Kientzle
9e4f5968dc Merge a bunch of changes through r722 from libarchive.googlecode.com:
mtree writer now supports a variety of checksum keys; it also provides
option hooks to set what keys get written.
2009-03-08 04:20:19 +00:00
Tim Kientzle
9d875e6973 Merge r718 from libarchive.googlecode.com: Some additional
tests of restoring files to disk with unusual characters, specifically
to exercise Windows issues.
2009-03-07 07:23:04 +00:00
Tim Kientzle
6d8acef62f Fix spelling. 2009-03-07 07:19:25 +00:00
Tim Kientzle
0d9e6eaf1a Merge r348 from libarchive.googlecode.com: Suppress testing invalid
conversions if there aren't any.  In particular, Cygwin's "C" locale
has no invalid inputs for wctomb().
2009-03-07 03:41:29 +00:00
Tim Kientzle
419eb469bc Merge r596,r690 from libarchive.googlecode.com: Minor style and compile
warning fixes for test_read_pax_truncated.c.
2009-03-07 03:34:34 +00:00
Tim Kientzle
71938b80a7 Merge r335,653,676 from libarchive.googlecode.com: Instead of
conditioning tests on HAVE_ZLIB, etc, just ask libarchive for the
service and handle the failure coming back from libarchive.  This
gives us better test coverage of common client usage where clients
simply try to use libarchive services and handle the errors coming
back instead of trying to second-guess which libarchive services are
compiled in.
2009-03-07 03:30:35 +00:00
Tim Kientzle
144552f37d Merge r280,281,496,595,675,712 from libarchive.googlecode.com: Various
test improvements, including some work on Windows compatibility and an
extra check to verify that no test leaves open file descriptors
around.
2009-03-07 03:16:16 +00:00
Tim Kientzle
fe8c58805a Merge r540 from libarchive.googlecode.com: Interix doesn't have inttypes.h
either.  <sigh>
2009-03-07 03:04:06 +00:00
Tim Kientzle
c2a577bb0d Merge r723 from libarchive.googlecode.com: Don't try to restore
owner or SUID bits on Windows; just ignore them.
2009-03-07 03:00:44 +00:00
Tim Kientzle
21bbe086cb Merge r511,r513,r607 from libarchive.googlecode.com: Mtree reader
tweaks:  Support nanosecond timestamps, handle attributes broken
across multiple lines.
2009-03-07 02:58:15 +00:00
Tim Kientzle
cd22d2cc9e Merge r585,r669 from libarchive.googlecode.com: If zlib is unavailable,
use external "gunzip" instead.  With this in place, we can unconditionally
enable gzip read support.
2009-03-07 02:51:18 +00:00
Tim Kientzle
de01c3b1eb Merge r550,584,587,609,647,674 from libarchive.googlecode.com:
Refactor the read_compression_program to add two new abilities:
 * Public API:  You can now include a signature string when you
   register a program; the program will run only on input that
   matches the signature string.
 * Internal API: You can use the init() function to instantiate
   an external program as part of a filter pipeline.  This
   can be used for graceful fallback (if zlib is unavailable, use
   external gzip instead) and to use external programs with
   bidders that are more sophisticated than a static signature check.
2009-03-07 02:47:04 +00:00
Tim Kientzle
4f7d8a29e1 Merge r591 from libarchive.googlecode.com: signed/unsigned fixes. 2009-03-07 02:29:43 +00:00
Tim Kientzle
cdad0e17a1 Merge r558,567,569,571,581,582,583,598 from libarchive.googlecode.com:
Support Joliet extensions.  This currently ignores Rockridge extensions
if both exist on the same disk unless the '!joliet' option is provided.
e.g.: tar -xvf example.iso --options '!joliet'
Thanks to: Andreas Henriksson
2009-03-07 02:24:32 +00:00
Tim Kientzle
5e9641ba0a Merge r658 from libarchive.googlecode.com: Only flush and close the
file if it was actually opened.  Test for this case.
2009-03-07 02:09:21 +00:00
Tim Kientzle
3381df89e8 Merge r714,r715 from libarchive.googlecode.com: Fix Debian bug #516577.
Don't crash if client does not provide a skip function.  Extend one
of the test cases to use archive_read_open2() with only a read callback.
2009-03-07 01:21:46 +00:00
Tim Kientzle
83829cd8ea Merge r608 from libarchive.googlecode.com: Clear a newly-allocated
bidder object.
2009-03-07 01:18:30 +00:00
Tim Kientzle
98768f0df8 Merge r564,r566 from libarchive.googlecode.com: Fix segfault when
specifying an option and the current format doesn't have an
options handler.
2009-03-07 01:17:13 +00:00
Tim Kientzle
071b9e6dc9 Merge the rest of r453 from libarchive.googlecode.com: Test using
libarchive APIs to read extended attributes from disk on FreeBSD.
2009-03-07 01:12:01 +00:00
Tim Kientzle
e54dbd0167 Minor whitespace adjustment to reduce diffs with libarchive.googlecode.com. 2009-03-07 01:08:16 +00:00
Tim Kientzle
eee9002fb2 Merge r552,r559 from libarchive.googlecode.com: Support high-resolution
timestamps on Tru64, AIX, and GNU Hurd.  Thanks to Björn Jacke.
2009-03-07 00:52:02 +00:00
Tim Kientzle
4797bb9435 Merge r283,r529 from libarchive.googlecode.com: Fix ext2_fs.h includes
for Linux.
2009-03-07 00:36:50 +00:00
Tim Kientzle
14289cd993 Merge r659 from libarchive.googlecode.com: Correctly report "none"
as the compression name when no other read filter bid.  Add some
assertions to various tests to verify that read filters are properly
setting the textual name as well as the compression code.
2009-03-07 00:25:33 +00:00
Maksim Yevmenkin
baeef61449 Add Bluetooth compatibility shims. Inspired by Linux BlueZ and NetBSD.
Discussed with:	Iain Hibbert plunky -at- rya-online -dot- net of NetBSD
MFC after:	1 month
2009-03-06 23:30:07 +00:00
Tim Kientzle
b7baebb91a Merge r668 from libarchive.googlecode.com: Style correction to the
'ar' reader:  Don't redefine 'isdigit' and don't create a macro that's
only used once.
2009-03-06 06:14:44 +00:00
Tim Kientzle
f7c755c1db Merge r541,r542 from libarchive.googlecode.com: Two sign mismatches
in the Zip reader.
2009-03-06 06:13:25 +00:00
Tim Kientzle
634fb9dd48 Merge r491,493,500,507,510,530,543 from libarchive.googlecode.com:
This implements the new generic options framework that provides a way
to override format- and compression-specific parameters.
2009-03-06 05:58:56 +00:00
Tim Kientzle
ce54c7c56a Merge r448 from libarchive.googlecode.com: Suppress testing write_disk
failures on Windows for now.  Someday this will be revisited.
2009-03-06 05:40:09 +00:00
Tim Kientzle
4bf1b0bdfa Merge r403,702,721 from libarchive.googlecode.com: Handle odd
pathnames on Windows by mapping '\\' to '/' and converting
illegal characters to '_'.
2009-03-06 05:38:53 +00:00
Tim Kientzle
af176e930c Merge r505 from libarchive.googlecode.com: Fix %ju support. Simplify
the code here a bit by making the int formatting functions static to
archive_string_sprintf.c, which is the only place this has ever been
used.
2009-03-06 05:14:55 +00:00
Tim Kientzle
c07eec6459 Merge r457 from libarchive.googlecode.com: Stop appending strerror()
information to error strings.  This caused a lot of unnecessary
duplication in error messages; in particular, there are a few cases
where error messages get copied from one archive object to another
and this would cause the strerror() info to get appended each time.
2009-03-06 05:13:12 +00:00
Tim Kientzle
a86d4001dd Merge r420,r494 from libarchive.googlecode.com: Prettify the test
harness a bit:  remove a dead comment, tweak the wording of the
summary report.
2009-03-06 05:07:03 +00:00
Tim Kientzle
6a7c3e70e3 Merge r435,r443 from libarchive.googlecode.com: Read config files from
include path; this makes it easier to support multiple build frameworks.
2009-03-06 05:04:15 +00:00
Tim Kientzle
ce077a6fd8 Merge r416 from libarchive.googlecode.com:
Restoring POSIX.1e Extended Attributes on FreeBSD, part 1

This implements the basic ability to restore extended attributes
on FreeBSD, including a test suite.
2009-03-06 04:55:51 +00:00
Tim Kientzle
17fcda1a0b Merge r407,r508 from libarchive.googlecode.com: Correctly handle
Zip entries that are zero length but stored with deflate.  This
is arguably a silly thing to do (deflating a zero-length file actually
makes it bigger) but apparently quite a few Zip writers do this.
This was broken in two places:  archive_write_disk disliked being asked
to write data to zero-length files (even if the write was zero-length)
and zip_read_file_header tripped over itself when non-regular files
had compressed bodies.
2009-03-06 04:50:39 +00:00
Tim Kientzle
43a8e5f098 Merge r399,401,402,405,415,430,440,452,453,458,506,533,536,538,544,590
from libarchive.googlecode.com:  Add a new "archive_read_disk" API
that provides the important service of reading metadata from the
disk.  In particular, this will make it possible to remove all
knowledge of extended attributes, ACLs, etc, from clients such
as bsdtar and bsdcpio.

Closely related, this API also provides pluggable uid->uname
and gid->gname lookup and caching services similar to
the uname->uid and gname->gid services provided by archive_write_disk.
Remember this is also required for correct ACL management.

Documentation is still pending...
2009-03-06 04:35:31 +00:00
Tim Kientzle
74aced1051 Merge r398 from libarchive.googlecode.com: Check that bidder
object was allocated before we try to use it.
2009-03-06 04:22:34 +00:00
Tim Kientzle
c6b235629a Merge r394,r396 from libarchive.googlecode.com: Plug some memory
leaks in the ACL test, correctly mark that FreeBSD has acl_get_perm_np().
2009-03-06 04:21:23 +00:00
Tim Kientzle
341f2011d8 Merge r390,r391,r392,r397 from libarchive.googlecode.com: Virtualize
"close" and "finish" across both read and write interfaces.
(Someday, "finish" should be renamed to "free" to better reflect
what it actually does...)
2009-03-05 21:18:10 +00:00
Tim Kientzle
90e7486664 Merge r389 from libarchive.googlecode.com: Fix a memory
leak in ISO9660 handler structure whenever a file entry
has a nonsensical CE offset.
2009-03-05 18:38:36 +00:00
Tim Kientzle
e80e6f7018 Merge r386,r395,r451 from libarchive.googlecode.com: On Windows, break
into the debugger on test setup failures (otherwise, the console window
just goes away and you can't see what went wrong).  On all platforms,
clean up a stray buffer before exiting.
2009-03-05 18:30:50 +00:00
Attilio Rao
8655c70597 libc_r_* library is no more required, so just axe it.
Approved by:	marcel, emaste
Sponsored by:	Sandvine Incorporated
2009-03-05 18:27:16 +00:00
Konstantin Belousov
9f960e98aa Hopefully, improve the grammar and wording in the changes to shmctl(2)
manpage and UPDATING entry 20090302.

UPDATING changes suggested by bf2006a yahoo com.
man page corrections by bde.
2009-03-05 12:04:42 +00:00
Tim Kientzle
ffd201719e Argh. r189389 was supposed to include r539 from libarchive.googlecode.com
but those compile fixes somehow got lost.  This should fix the build.
2009-03-05 06:26:08 +00:00
Tim Kientzle
241028d43a Merge r551,r561 from libarchive.googlecode.com: Update gzip read filter
to fully take advantage of the new peek/consume I/O support.
In particular, this now properly handles concatenated gzip streams.
2009-03-05 02:37:05 +00:00
Tim Kientzle
facbbae9f9 Merge r364, r378, r379, r393, and r539 from libarchive.googlecode.com:
This is the last phase of the "big decompression refactor" that
puts a lazy reblocking layer between each pair of read filters.
I've also changed the terminology for this area---the two kinds
of objects are now called "read filters" and "read filter bidders"---and
moved ownership of these objects to the archive_read core.

This greatly simplifies implementing new read filters, which
can now use peek/consume I/O semantics both for bidding (arbitrary
look-ahead!) and for reading streams (look-ahead simplifies handling
concatenated streams, for instance).

The first merge here is the overhaul proper; the remainder are small
fixes to correct errors in the initial implementation.
2009-03-05 02:19:42 +00:00
Tim Kientzle
a48ae5111e Correct r189383, which mis-merged a change from libarchive.googlecode.com. 2009-03-05 01:59:49 +00:00
Xin LI
7ccf00df0d Our realloc(3) and reallocf(3) can handle NULL, which turns it into a
malloc(3) call, so don't test if a pointer is NULL.

Obtained from:	OpenBSD (in spirit)
2009-03-05 00:57:01 +00:00
Tim Kientzle
30b7287aff Merge r356 and r358 from libarchive.googlecode.com: Remove a Windows
special case from archive_entry.c, add one to archive_check_magic.c.
2009-03-05 00:44:12 +00:00
Tim Kientzle
a60167b66c Merge r357 from libarchive.googlecode.com: bzip2 compression
support can always be enabled even if bzlib doesn't exist on
this platform; don't give up until we fail to open the file.
2009-03-05 00:42:50 +00:00
Tim Kientzle
24b4dd3387 Merge r362 from libarchive.googlecode.com: Minor fix to
custom argument parser.
2009-03-05 00:41:02 +00:00
Tim Kientzle
32baf20434 Merge r342 from libarchive.googlecode.com: Remove some
Windows special casing.
2009-03-05 00:36:13 +00:00
Tim Kientzle
faeada5e26 Merge r344 from libarchive.googlecode.com: __LA_INT64_T and __LA_SSIZE_T
are part of the public API and therefore need to be exposed.  This is
ugly; I'd like to find a better solution for this.
2009-03-05 00:35:21 +00:00
Tim Kientzle
ba2a6a7201 Merge r341,r345,r346,347 from libarchive.googlecode.com: Style
fixes to test harness and a few extra guards to detect tests
that can't succeed on certain platforms.
2009-03-05 00:31:48 +00:00
David Schultz
09efd0ec6a Add wcpcpy(3) and wcpncpy(3). 2009-03-04 06:01:27 +00:00
David Schultz
ad760e6fc9 Add dprintf() and vdprintf() from POSIX.1-2008. Like getline(),
dprintf() is a simple wrapper around another function, so we may as
well implement it. But also like getline(), we can't prototype it by
default right now because it would break too many ports.
2009-03-04 03:38:51 +00:00
David Schultz
ce5c3df1b2 Fix a file descriptor leak in fts_child().
Obtained from:	NetBSD
2009-03-04 03:30:21 +00:00
Bruce M Simpson
1acf7fcc63 Considerably improve the wording of this man page. 2009-03-04 01:59:14 +00:00
Bruce M Simpson
0c0fdcfe15 Update copyright. 2009-03-04 01:58:48 +00:00
Xin LI
eb3144b210 Explicitly specify bit width for on-disk data structure.
Obtained from:	OpenBSD
2009-03-04 01:17:05 +00:00
Xin LI
d170190aa8 Sync license changes.
Obtained from:	NetBSD
2009-03-04 01:01:26 +00:00
Xin LI
3df1d93483 Style changes (including additional casts to shut up warnings). This
commit does not affect MD5 of object file.
2009-03-04 00:58:04 +00:00
Tim Kientzle
9c886c4181 Merge r340 from libarchive.googlecode.com: If zlib/bzlib aren't available,
we can still detect gzip/bzip2 compressed streams, we just can't
decompress them.
2009-03-03 17:07:27 +00:00
Tim Kientzle
690f818afd Merge r294:337,r348:350 from libarchive.googlecode.com: A lot
of work to make libarchive work on Windows.
2009-03-03 17:02:51 +00:00
Tim Kientzle
ed466ea1cf Merge r294 from libarchive.googlecode.com: Skip testing for
locale-based failures on systems where the "C" locale is so permissive
that it cannot possibly fail.  In particular, this fixes a test
problem on Cygwin.
2009-03-03 07:01:57 +00:00
Tim Kientzle
bc14277c79 Merge r282 from libarchive.googlecode.com: Close multiple filters
by walking the filter list in archive_read_close().
2009-03-03 03:33:25 +00:00
Tim Kientzle
80bb6bf259 Merge r272 from libarchive.googlecode.com: Fix building on MSVC6. 2009-03-03 03:28:09 +00:00
Xin LI
4c66e4b64b Rename variable 'index' to 'idx' to avoid name collision with index(3),
this commit does not affect any object code.

Obtained from:	OpenBSD
Verified with:	md5(1)
2009-03-03 02:16:12 +00:00
Xin LI
0ac22237f1 Diff reduction against OpenBSD: ANSI'fy prototypes.
(This is part of a larger changeset which is intended to reduce diff only,
thus some prototypes were left intact since they will be changed in the
future).

Verified with:	md5(1)
2009-03-02 23:47:18 +00:00
Konstantin Belousov
65067cc8b0 Correct types of variables used to track amount of allocated SysV shared
memory from int to size_t. Implement a workaround for current ABI not
allowing to properly save size for and report more then 2Gb sized segment
of shared memory.

This makes it possible to use > 2 Gb shared memory segments on 64bit
architectures. Please note the new BUGS section in shmctl(2) and
UPDATING note for limitations of this temporal solution.

Reviewed by:	csjp
Tested by:	Nikolay Dzham <i levsha org ua>
MFC after:	2 weeks
2009-03-02 18:53:30 +00:00
David Schultz
601b205e47 Rewrite asprintf() as a wrapper around vasprintf(), thus reducing the
number of functions that have an incestuous relationship with the
arcane innards of stdio.
2009-03-02 04:11:42 +00:00
David Schultz
88f919d683 The argument corresponding to %zn is supposed to be an ssize_t *, not
a size_t *, although the distinction is moot in practice.
2009-03-02 04:07:58 +00:00
David Schultz
9e462ed058 Use C99-style initializers. No functional change.
Reviewed by:	md5(1)
2009-03-01 19:25:40 +00:00
Xin LI
a8da143ab8 Add a missing .El. 2009-03-01 05:47:14 +00:00
Xin LI
00d949789a "-isoC-99" should be spelled without 'c'. 2009-03-01 05:44:28 +00:00
Ed Schouten
6cf4a02c5e Add missing POSIX 1003.1-2008 open(2) flag; O_TTY_INIT.
On FreeBSD, this is the default behaviour. According to the spec, we may
give this flag a value of zero, but I'd rather not do this. If we define
it to a non-zero value, we can always change default behaviour without
changing the ABI. This is very unlikely to happen, though.
2009-02-28 10:10:30 +00:00
David Schultz
353ce11c8b Replace a dozen lines of code with a call to strnlen() / wcsnlen(). 2009-02-28 06:06:57 +00:00