Commit Graph

12605 Commits

Author SHA1 Message Date
Tim Kientzle
6388433b62 Exit with ARCHIVE_FATAL if the ISO image is truncated. 2009-04-26 18:43:49 +00:00
Tim Kientzle
c49388ad34 Remove an unused variable.
Thanks to:	Christoph Mallon
2009-04-26 18:24:14 +00:00
Edward Tomasz Napierala
5d8532a1b1 Fix typo. 2009-04-26 10:12:20 +00:00
Christian Brueffer
2a72feb42b Correct the information about when the respective functionality first
appeared in FreeBSD.

PR:		133785
Submitted by:	Ulrich Spoerlein <uqs@spoerlein.net>
MFC after:	3 days
2009-04-23 08:37:56 +00:00
Maksim Yevmenkin
78b96635e6 Implement low-level Bluetooth HCI API.
This should make it easier to make Linux BlueZ libhci port.

Reviewed by:	Iain Hibbert < plunky -at- rya-online -dot- net > of NetBSD
MFC after:	1 week
Inspired by:	Linux BlueZ
Inspired by:	NetBSD
2009-04-22 15:50:03 +00:00
Robert Watson
d1f2f1c3f3 Now that the kernel defines CACHE_LINE_SIZE in machine/param.h, use
that definition in the custom locking code for the run-time linker
rather than local definitions.

Pointed out by:	tinderbox
MFC after:	2 weeks
2009-04-19 23:02:50 +00:00
Robert Watson
c0020399a6 Merge OpenBSM 1.1 from OpenBSM vendor branch to head.
OpenBSM history for imported revision below for reference.

MFC after:      2 weeks
Sponsored by:   Apple, Inc.
Obtained from:  TrustedBSD Project

OpenBSM 1.1

- Change auditon(2) parameters and data structures to be 32/64-bit architecture
  independent.  Add more information to man page about auditon(2) parameters.
- Add wrapper functions for auditon(2) to use legacy commands when the new
  commands are not supported.
- Add default for 'expire-after' in audit_control to expire trail files when
  the audit directory is more than 10 megabytes ('10M').
- Interface to convert between local and BSM fcntl(2) command values has been
  added:  au_bsm_to_fcntl_cmd(3) and au_fcntl_cmd_to_bsm(3), along with
  definitions of constants in audit_fcntl.h.
- A bug, introduced in OpenBSM 1.1 alpha 4, in which AUT_RETURN32 tokens
  generated by audit_submit(3) were improperly encoded has been fixed.
- Fix example in audit_submit(3) man page.  Also, make it clear that we want
  the audit ID as the argument.
- A new audit event class 'aa', for post-login authentication and
  authorization events, has been added.
2009-04-19 16:17:13 +00:00
Tim Kientzle
f4f5e3f5b9 Rely on OpenSSL bits only if we're building a system with OpenSSL.
Also, adjust the MD5 calls to rely on libmd instead of libcrypto,
so we keep MD5 support even in the !OpenSSL case.
2009-04-18 06:06:47 +00:00
Tim Kientzle
84cdfa5374 Correct and update the manpage to include
more details about some of the formats and
to briefly describe the mtree writing capability.
2009-04-18 03:47:29 +00:00
Tim Kientzle
400970912f Disabling the crypto bits should quiet tinderbox while I
track down the library dependencies that are screwing up the /rescue build.
2009-04-17 07:28:49 +00:00
Tim Kientzle
59fd3980b7 Publicize a handful of new functions and bump the version number
to indicate that this is synchronized with the recent libarchive 2.7.0
release.
2009-04-17 01:07:37 +00:00
Tim Kientzle
24a4c12895 Merge lots of test suite updates from libarchive.googlecode.com. 2009-04-17 01:06:31 +00:00
Tim Kientzle
7523935ae4 FreeBSD has a lot of crypto functions used by the recent mtree writer updates. 2009-04-17 01:04:23 +00:00
Tim Kientzle
50cc11da04 Ensure that the option setters return OK (option used) even
for options that don't change the list of keywords.
2009-04-17 01:03:52 +00:00
Tim Kientzle
c190973e9d Fix a memory leak: Release the current list of /set keywords
even when we exit on an error.
2009-04-17 01:02:56 +00:00
Tim Kientzle
7ea8a85dbc Document the new read options interface and the new read_header2() call. 2009-04-17 01:02:12 +00:00
Tim Kientzle
a5e75fbb6c Dynamically size the buffer we pass to getgrgid_r() and getpwuid_r().
Keep the buffer in the cache object so we don't have to keep doing this.
2009-04-17 01:01:15 +00:00
Tim Kientzle
82ea3751d6 Don't match an empty file on a read error. 2009-04-17 01:00:11 +00:00
Tim Kientzle
b6a1f92f24 When pulling metadata from disk, lookup the user and group name at the same time. 2009-04-17 00:59:34 +00:00
Tim Kientzle
bfe2732de8 LZW bugfix: when we hit end-of-file, return an invalid code. 2009-04-17 00:58:44 +00:00
Tim Kientzle
bf89aeae5e Minor fix: some platforms require both inttypes.h and stdint.h. 2009-04-17 00:57:11 +00:00
Tim Kientzle
06f39cd345 Implement command-line fallbacks for gzip and bzip2 decompression as well.
Not an issue for FreeBSD, since the base system has the necessary libraries.
Since all decompressors are always available now, we can unconditionally
enable them in archive_read_support_compression_all().
2009-04-17 00:55:52 +00:00
Tim Kientzle
c9f05bc8a1 Merge new xz/lzma support from libarchive.googlecode.com.
Since FreeBSD doesn't have liblzma in the base system, the
read side will always fall back to the unxz/unlzma commands for now.
(Which will in turn fail if those commands are not currently
installed.)  The write side does not yet have a fallback, so
that will just fail.
2009-04-17 00:54:35 +00:00
Tim Kientzle
a9ba4adfa5 Don't use the open callback, which is deprecated (because it's
never necessary).  Also, simplify just a tad by delegating
to read_open_fd() when we know the file descriptor, instead
of duplicating that logic.
2009-04-17 00:50:00 +00:00
Tim Kientzle
1787611dd1 Accept empty options, add a new read_next_header2() which is more
efficient for some uses.
2009-04-17 00:47:16 +00:00
Tim Kientzle
9a81c0ba38 Properly clone and free the recently-added "sourcepath" field. 2009-04-17 00:45:47 +00:00
Tim Kientzle
5f8af33b11 Use thread-safe getgrnam_r() and getpwnam_r(); dynamically size
the buffer used by this.
2009-04-17 00:44:47 +00:00
Tim Kientzle
946733c26e Fix a minor memory leak. 2009-04-17 00:44:03 +00:00
Tim Kientzle
8952729381 Merge from libarchive.googlecode.com: Numerous fixes to the
write options handling, including documentation.
2009-04-17 00:42:45 +00:00
Tim Kientzle
625683944d Merge from libarchive.googlecode.com: If we're
given an empty filename, just invoke write_open_fd()
instead of re-implementing the code to use stdout.
2009-04-17 00:39:35 +00:00
Edward Tomasz Napierala
bab43bab0c There is no way for strmode(3) to append '+' if the file has ACL,
because there is no way to figure that out based on the file mode
itself.  Make the manual page match reality.
2009-04-14 11:39:56 +00:00
Tim Kientzle
73beb0d530 Re-enable backing up extended attributes, as the ZFS bug this
triggered seems to have been fixed by John Baldwin's commit
r189967.
2009-04-13 18:56:53 +00:00
Robert Watson
a14e812168 Sort man page cross references by section, no need for a comma after the
last cross reference.

MFC after:	3 days
2009-04-13 18:32:26 +00:00
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
David Schultz
9c5cb6d8ae Add restrict qualifiers.
I missed this file in my previous commit.
2009-02-28 06:05:37 +00:00
David Schultz
69099ba2ec - Add getdelim(), getline(), stpncpy(), strnlen(), wcsnlen(),
wcscasecmp(), and wcsncasecmp().
- Make some previously non-standard extensions visible
  if POSIX_VISIBLE >= 200809.
- Use restrict qualifiers in stpcpy().
- Declare off_t and size_t in stdio.h.
- Bump __FreeBSD_version in case the new symbols (particularly
  getline()) cause issues with ports.

Reviewed by:	standards@
2009-02-28 06:00:58 +00:00
David Schultz
e00a6d21eb Add restrict qualifiers to the parameters to strlcpy() and strlcat().
The annotation mainly just serves as a hint that they're not intended
for use with overlapping strings.
2009-02-28 05:15:02 +00:00
David Schultz
0881683b36 Make sure %zd treats negative arguments properly on 32-bit platforms.
Fix harmless but related bugs in %_$zd and %_$tu.

PR:		131880
MFC after:	1 week
2009-02-28 04:58:18 +00:00
Andrew Thompson
ee3e3ff5c2 Change USB over to make_dev() for all device nodes, previously it hooked into
the devfs clone handler to open the (invisible) devices on the fly.

The /dev entries are layed out as follows,

 /dev/usbctl      = master device
 /dev/usb/0.1.0.5 = usb device, (<bus>.<dev>.<iface>.<endpoint>)
 /dev/ugen0.1 -> usb/0.1.0.0 = ugen link to ctrl endpoint

This also removes the custom permissions model from USB.  Bump
__FreeBSD_version to 800066.

Submitted by:	rink (earlier version)
2009-02-27 17:27:16 +00:00
Andrew Thompson
e35ceb121b Fix HID_COMPAT7 handling around the USB_GET_REPORT_DESC ioctl.
Submitted by:	daichi
Pointy hat:	me
2009-02-27 15:30:42 +00:00
Ed Schouten
b3aaa0cc21 Rename all symbols in libmp(3) to mp_*, just like Solaris.
The function pow() in libmp(3) clashes with pow(3) in libm. We could
rename this single function, but we can just take the same approach as
the Solaris folks did, which is to prefix all function names with mp_.

libmp(3) isn't really popular nowadays. I suspect not a single
application in ports depends on it. There's still a chance, so I've
increased the SHLIB_MAJOR and __FreeBSD_version.

Reviewed by:	deischen, rdivacky
2009-02-26 21:43:15 +00:00
Ed Schouten
e0e0f30f42 Use ANSI function declarations in librpcsvc.
When compiling librpcsvc with LLVM, we get a compiler error, because
hexval() uses an ANSI prototype, but a K&R declaration. I could have
just changed hexval(), but I'd rather keep this consistent. It's not
that much code.

Submitted by:	Pawel Worach <pawel worach gmail com>
2009-02-26 20:32:11 +00:00
Roman Divacky
b9c4b6b4df Add a missing parameter to ruserpass(). According to C99 6.9.1p7
K&R function is not a prototype but this is a bad style. GCC accepts
this other compilers warn or reject this.

Approved by:	kib (mentor)
2009-02-26 17:46:54 +00:00
Ruslan Ermilov
241715e78f With only one threading library, simplify the logic of setting SHLIBDIR. 2009-02-24 16:23:34 +00:00
Andrew Thompson
f78fa6b67e MFp4 //depot/projects/usb@157974
Add support for setting and getting the USB template value through libusb20 and
usbconfig.

Submitted by:	Hans Petter Selasky
2009-02-24 03:43:05 +00:00
Andrew Thompson
bf41796c4e Build fixups for the new USB stack. 2009-02-23 18:36:54 +00:00
Ruslan Ermilov
d9ca85fca7 Fix build when WITH_SSP is set explicitly.
Submitted by:	Jeremie Le Hen
2009-02-21 15:04:31 +00:00
Warner Losh
21fc9f2bcc These warnings are only relevant on NetBSD it seems. They don't seem
to be relevant to FreeBSD at all.
2009-02-19 19:53:58 +00:00
Warner Losh
51cbd5d9d7 These symbols don't belong here. Remove them. Since mips hasn't had
a release, I think there's no impact here...

Reviewed by:	cognet@
2009-02-19 18:03:41 +00:00
Dag-Erling Smørgrav
1dde0f9745 Don't try to auto-detect dynamic linking; it fails on mips. The Makefile
part of the patch is an ugly (and hopefully temporary) hack.

Discussed with:	imp@
2009-02-17 16:35:19 +00:00
Andrew Thompson
e9df28284b MFp4 //depot/projects/usb@157783
libusb20: Make return value compatible with libusb0.12.x in case of a USB
transfer timeout.

Submitted by:	Hans Petter Selasky
2009-02-16 15:32:12 +00:00
Andrew Thompson
06d497c1af MFp4 //depot/projects/usb@157699
Add two new functions to the libusb20 API and required kernel ioctls.

- libusb20_dev_get_iface_desc
- libusb20_dev_get_info

New command to usbconfig, "show_ifdrv", which will print out the kernel driver
attached to the given USB device aswell.

See "man libusb20" for a detailed description.

Some minor style corrections long-line wrapping.

Submitted by:	Hans Petter Selasky
2009-02-14 23:20:00 +00:00
Jung-uk Kim
455cc6ec70 Honor WITHOUT_INSTALLLIB in some places. 2009-02-13 16:51:36 +00:00
Ed Schouten
a73306e14e Properly invalidate highest pts number when calling setttyent().
When calling setttyent() after calling endttyent(), pts_valid will never
be set to 1, because the readdir()-loop will likely never vind a pts
that has a higher number than before.

Simplify the code by removing pts_valid. We'll just set maxpts to -1
when we don't have a valid count yet.
2009-02-12 19:32:52 +00:00
Ed Schouten
046f351281 Make ttyslot(3) work with pts(4) devices.
It seems ttyslot() calls rindex(), to strip the device name to the last
slash, but this is obviously invalid. /dev/pts/0 should be stripped
until pts/0. Because /etc/ttys only supports TTY names in /dev/, just
strip this piece of the pathname.
2009-02-12 19:00:13 +00:00
Ed Schouten
26d4f5e969 Add two new routines: fdevname() and fdevname_r().
A more elegant way of obtaining a name of a character device by its file
descriptor on FreeBSD, is to use the FIODGNAME ioctl. Because a valid
file descriptor implies a file descriptor is visible in /dev, it will
always resolve a valid device name.

I'm adding a more friendly wrapper for this ioctl, called fdevname(). It
is a lot easier to use than devname() and also has better error
handling. When a device name cannot be resolved, it will just return
NULL instead of a generated device name that makes no sense.

Discussed with:	kib
2009-02-11 20:24:59 +00:00
Ulf Lilleengen
043767b123 - Sanitize disk parameters retrieved from GEOM, as they are not guaranteed to
have sane values. It caused sysinstall to crash when installing on certain SD
  cards.

Discussed with:		marcel
2009-02-09 21:34:06 +00:00
Hajimu UMEMOTO
aba831de03 Shutup warning for DNAME RR.
PR:		bin/127591
Submitted by:	"Eugene M. Kim" <20080111.freebsd.org__at__ab.ote.we.lv>
MFC after:	1 week
2009-02-08 16:58:05 +00:00
Giorgos Keramidas
0bc4c01d56 Fix language on atol(3) manpage. Add a COMPATIBILITY section
stating that in FreeBSD the atol() and atoll() functions affect
errno in the same way as strtol() and stroll().

PR:		docs/126487
Submitted by:	edwin
Reviewed by:	trhodes, gabor
MFC after:	1 week
2009-02-08 08:26:58 +00:00
Daniel Eischen
9eb1eb548a Fix leak of kqueue() file descriptors when linked with static
libc_r.

PR:		58687
Submitted by:	Jonathon Lennox <lennox at cs dot columbia dot edu>
2009-02-08 06:44:58 +00:00
Warner Losh
0ff7d9b4e9 Make sure the comparison is done with an unsigned char. 2009-02-07 19:34:44 +00:00
David Schultz
ea8e257984 C99 TC2 now wants FP_FAST_FMA* to be defined to 1, if the macros are
defined at all. See also: defect report #223.
2009-02-07 05:41:24 +00:00
Jamie Gritton
b89e82dd87 Standardize the various prison_foo_ip[46] functions and prison_if to
return zero on success and an error code otherwise.  The possible errors
are EADDRNOTAVAIL if an address being checked for doesn't match the
prison, and EAFNOSUPPORT if the prison doesn't have any addresses in
that address family.  For most callers of these functions, use the
returned error code instead of e.g. a hard-coded EADDRNOTAVAIL or
EINVAL.

Always include a jailed() check in these functions, where a non-jailed
cred always returns success (and makes no changes).  Remove the explicit
jailed() checks that preceded many of the function calls.

Approved by:	bz (mentor)
2009-02-05 14:06:09 +00:00
Warner Losh
ea58272861 Fix the functions to match prototypes. The K&R definitions differ
from the ANSI-C prototype due to the 'int promotion' rule.
2009-02-03 20:25:36 +00:00
Daniel Gerzo
bd604b4b06 - ANSIfy function definitions
- use nul when we are looking for a terminating character where appropriate

Approved by:	imp
2009-02-03 17:58:20 +00:00
Roman Divacky
b1e58dd43e Provide a type for the argument.
Approved by:	kib (mentor)
2009-02-02 21:51:52 +00:00
Alfred Perlstein
7e474656a6 src/usr.bin/usbhidaction/usbhidaction.c
src/usr.bin/usbhidctl/usbhid.c
src/sys/dev/usb2/include/usb2_hid.h
src/sys/dev/usb2/input/uhid2.c
src/lib/libusbhid/Makefile
src/lib/libusbhid/descr.c
src/lib/libusbhid/descr_compat.c
src/lib/libusbhid/usbhid.3
src/lib/libusbhid/usbhid.h
src/lib/libusbhid/usbvar.h

Patches to make libusbhid and HID userland utilities compatible with
the new USB stack. All HID ioctls should go through the libusbhid
library to ensure compatibility. I have found at least one piece of
software in /usr/ports which needs to get updated before USB HID
devices will work. This is the X joystick input driver.

Reported and tested by:

Daichi GOTO and Masanori OZAWA.

src/sys/dev/usb2/core/usb2_process.c

Correct USB process names.

Reported by:

Andre Guibert de Bruet

src/sys/dev/usb2/serial/uftdi2.c

Integrate changes from old USB stack.

Submitted by:	hps
2009-02-02 00:49:39 +00:00
Tim Kientzle
56b5addbbd Permit ` as a pad character in the filename table.
This seems to fix the devel/zziplib port, which distributes
its man pages in an ar archive.
2009-02-01 02:33:02 +00:00
Gabor Kovesdan
aa1c2a80b4 - Remove superfluous comment
PR:             docs/129400
Submitted by:   Gavin Atkinson <gavin@freebsd.org>
2009-01-30 15:28:35 +00:00
Tom Rhodes
48a01c432b Update the description of KERN_PROC.
PR:		100242
Reviewed by:	jhb
2009-01-28 15:21:38 +00:00
Tom Rhodes
f53807d218 Better wording for clearing EOF indicator.
Submitted by:	keramida and jhb
2009-01-28 14:38:41 +00:00
Tom Rhodes
f3f496333d Remove another comment about clearing EOF indicator.
Noticed by:	bde
2009-01-28 11:25:22 +00:00
David Schultz
aa83f5fff9 Update the manpage to reflect r145172. 2009-01-28 04:37:27 +00:00
Tom Rhodes
d568fa54db Remove comment about clearerr() being the only method of clearing
the EOF indicator, fseek() may also be used for this.

Bump document date.

PR:		76333
Submitted by:	Yoshihiko Sarumaru <mistral@imasy.or.jp>
2009-01-28 01:11:20 +00:00
Jeff Roberson
597979c4b7 - Add support for nehalem/corei7 cpus. This supports all of the core
counters defined in the reference manual.  It does not support the
   'uncore' events.

Reviewed by:	jkoshy
Sponsored by:	Nokia
2009-01-27 07:29:37 +00:00
Xin LI
481101b823 - Fix grammar. [1]
- Use the correct term 'long mode'. [2]
 - style(9) for return value. [3]

Submitted by:	Ben Kaduk <minimarmot gmail com> [1],
		obrien [2], scf [3]
2009-01-26 07:31:28 +00:00
Tim Kientzle
7376ba1329 Fix ARCHIVE_EXTRACT_SPARSE handling in libarchive.
Add a test to exercise this feature.
This should fix --sparse/-S support in tar.

Thanks to:      Daichi GOTO
MFC after:	1 week
2009-01-26 05:44:40 +00:00
Xin LI
4c6a60218c Rewrite of MI strlen(3) in a way that can better utilize modern hardware by
reducing branches and doing word-sized operation.

The idea is taken from J.T. Conklin's x86_64 optimized version of strlen(3)
for NetBSD, and reimplemented in C by me.

Discussed on:	-arch@
2009-01-25 23:08:47 +00:00
David Schultz
21ca178ece Add support for multibyte thousands_sep encodings, e.g., U+066C.
The integer thousands' separator code is rewritten in order to
avoid having to preallocate a buffer for the largest possible
digit string with the most possible instances of the longest
possible multibyte thousands' separator. The new version inserts
thousands' separators for integers using the same code as floating point.
2009-01-22 08:14:28 +00:00
Tim Kientzle
53272655f6 Merge-from-Googlecode r419
In archive_write_disk:  If archive_write_header() fails to create
the file, that's a failure and should return ARCHIVE_FAILED.
Metadata restore failures still return ARCHIVE_WARN, because
that's non-critical.  Fix test_write_disk_secure test to
verify the correct return code in one case; add test_write_disk_failures
to do another very simple test of restore failure.

This should fix cpio coredumping when it tries to restore to
a write-protected directory.

Thanks to: Giorgos Keramidas
MFC after: 30 days
2009-01-21 06:55:27 +00:00
David Schultz
f8f571931d - Add support for multibyte decimal_point encodings, e.g., U+066B.
A forthcoming gdtoa import is needed to make this fully work.
- Improve the way "nan(...)" is parsed.
2009-01-19 06:19:51 +00:00
David Schultz
5004a238c3 Add support for multibyte decimal_point encodings, e.g., U+066B. 2009-01-19 06:19:38 +00:00
David Schultz
a1805f7bb9 When f[w]printf() is called on an unbuffered file like stdout, it
sets up a fake buffered FILE and then effectively calls itself
recursively. Unfortunately, gcc doesn't know how to do tail call
elimination in this case, and actually makes things worse by
inlining __sbprintf(). This means that f[w]printf() to stderr was
allocating about 5k of stack on 64-bit platforms, much of which was
never used.

I've reorganized things to eliminate the waste. In addition to saving
some stack space, this improves performance in my tests by anywhere
from 5% to 17% (depending on the test) when -fstack-protector is
enabled. I found no statistically significant performance difference
when stack protection is turned off. (The tests redirected stderr to
/dev/null.)
2009-01-17 18:57:12 +00:00
David Schultz
6ec3512368 Simplify printf's inlined output buffering routines. On amd64, this
reduces the code size by about 10% and improves performance slightly.
2009-01-17 05:38:14 +00:00
Roman Divacky
f400c2b850 Change dstp to be const and remove bogus cast.
Submitted by:	christoph.mallon at gmx.de
Approved by:	kib (mentor)
2009-01-15 20:45:59 +00:00
Roman Divacky
f27b1c064c Introduce a local variable and use it instead of passed in parameter
to get rid of restrict qualifier discarding. This lets libc compile
cleanly in gnu99 mode.

Suggested by:	kib, christoph.mallon at gmx.de
Approved by:	kib (mentor)
2009-01-15 18:53:52 +00:00
David Schultz
0a4926406a Reduce code duplication by moving functions that are identical in both
vfprintf.c and vfwprintf.c (except for char/wchar_t differences) to a
common header file.
2009-01-15 04:49:43 +00:00
David Schultz
814d1bc906 Convert the insidious macros that handle printf()'s buffering into
slightly less evil inline functions, and move the buffering state into
a struct. This will make it possible for helper routines to produce
output for printf() directly, making it possible to untangle the code
somewhat.

In wprintf(), use the same buffering mechanism to reduce diffs to
printf(). This has the side-effect of causing wprintf() to catch write
errors that it previously ignored.
2009-01-15 04:29:02 +00:00
Robert Watson
c74c7b73a0 Merge OpenBSM alpha 5 from OpenBSM vendor branch to head, both
contrib/openbsm (svn merge) and src/sys/{bsm,security/audit} (manual
merge).  Hook up bsm_domain.c and bsm_socket_type.c to the libbsm
build along with man pages, add audit_bsm_domain.c and
audit_bsm_socket_type.c to the kernel environment.

OpenBSM history for imported revisions below for reference.

MFC after:      1 month
Sponsored by:   Apple Inc.
Obtained from:  TrustedBSD Project

OpenBSM 1.1 alpha 5

- Stub libauditd(3) man page added.
- All BSM error number constants with BSM_ERRNO_.
- Interfaces to convert between local and BSM socket types and protocol
  families have been added: au_bsm_to_domain(3), au_bsm_to_socket_type(3),
  au_domain_to_bsm(3), and au_socket_type_to_bsm(3), along with definitions
  of constants in audit_domain.h and audit_socket_type.h.  This improves
  interoperability by converting local constant spaces, which vary by OS, to
  and from Solaris constants (where available) or OpenBSM constants for
  protocol domains not present in Solaris (a fair number).  These routines
  should be used when generating and interpreting extended socket tokens.
- Fix build warnings with full gcc warnings enabled on most supported
  platforms.
- Don't compile error strings into bsm_errno.c when building it in the kernel
  environment.
- When started by launchd, use the label com.apple.auditd rather than
  org.trustedbsd.auditd.
2009-01-14 10:44:16 +00:00
Andrew Thompson
20d54a8a61 MFp4: //depot/projects/usb@156092
Make sure all claimed interfaces gets released at close.

Submitted by: Hans Petter Selasky
2009-01-13 19:06:02 +00:00
Konstantin Belousov
64d83d29b9 Document that ffsll(3) and flsll(3) functions first appeared in
FreeBSD 7.1

Submitted by:	Jan Henrik Sylvester <me janh de>
MFC after:	3 days
2009-01-13 13:19:42 +00:00
David Schultz
4630140ce2 Use __gnu89_inline so that these files will compile with newer versions
of gcc, where the meaning of 'inline' was changed to match C99.

Noticed by:	rdivacky
2009-01-13 05:13:20 +00:00
Tim Kientzle
3342e45402 "The first part is just to give more info, the latter part fixes
an error to read files past the 32bit byte offset, for instance
on DVDs."

Submitted by:	phk@
MFC after:	10 days
2009-01-13 04:56:41 +00:00
Daniel Gerzo
a28d1439d8 - add missing include
- fix struct memeber's name [1]

PR:		docs/130413 [1]
Submitted by:	Thomas Mueller <tmueller@sysgo.com> [1]
MFC after:	3 days
2009-01-12 13:12:02 +00:00
Xin LI
46714885b3 o Language improvements from OpenBSD;
o Use an ISC-style license as did by the author.

Obtained from:	OpenBSD
2009-01-12 06:10:48 +00:00
Xin LI
ba840c782f o ANSIfy.
o Use ISC style copyright as did by the author.

Obtained from:	OpenBSD
2009-01-12 06:09:34 +00:00
Ruslan Ermilov
efad698c19 Sort MLINKS. 2009-01-09 16:24:10 +00:00
Poul-Henning Kamp
2eecaf226b Remove reference to no longer existing document.
Spotted by:	Bjoern Voigt <bjoern@cs.tu-berlin.de>
2009-01-09 11:45:13 +00:00
Doug Barton
a60329dc0b Vendor import of BIND 9.4.3-P1 2009-01-09 09:04:10 +00:00
David Schultz
0cab1fd236 Set the error indicator on an attempt to write to a read-only stream.
PR:		127335
MFC after:	2 weeks
2009-01-08 06:38:06 +00:00
David Schultz
4984f138f8 Fix the types of INFINITY and NAN, which were broken in r131851. They
should both be floats, not doubles.

PR:		127795
Submitted by:	Christoph Mallon
MFC after:	2 weeks
2009-01-08 06:12:03 +00:00