Commit Graph

8540 Commits

Author SHA1 Message Date
Bruce Evans
a1acdbf008 Fixed some minor style bugs. 2004-05-13 15:59:38 +00:00
Tim J. Robbins
ea4ac135ff Allow encoding modules to override the default implementations of
mbsrtowcs() and wcsrtombs(). Provide a fast implementation for the
trivial "NONE" encoding.
2004-05-13 11:20:27 +00:00
Tim Kientzle
f9bc91709e Update raw byte count statistic correctly. 2004-05-13 06:38:30 +00:00
Tim Kientzle
4809584dd6 Add MLINK for newly-added archive_read_extract_set_progress_callback(3). 2004-05-13 06:04:21 +00:00
Tim Kientzle
199984b3b2 Add hook for a client-provided progress callback to be invoked
during lengthy extract operations.
2004-05-13 06:01:14 +00:00
Tim J. Robbins
f789f94dbb Fix braino in previous: check that the second byte in the character
buffer is non-null when the character is two bytes long, not when
the buffer is two bytes long.
2004-05-13 03:08:28 +00:00
Peter Edwards
07dee1a777 Fix some^Wseveral style bugs from last commit.
Remove "sys/types.h" as "sys/param.h" is already included

Use cast rather than back-pointer to convert from public to private
version of FTS data, and so avoid littering fts.h with any of the
details.

Pointed out By: bde, kientzle
2004-05-12 21:38:39 +00:00
Josef El-Rayes
ac006f74fd Fix typo.
Submitted by:	Michel Lavondes <fox@vader.aacc.cc.md.us>
PR:		docs/66576
2004-05-12 20:45:51 +00:00
Josef El-Rayes
c12fc53ca8 Fix typo.
Submitted by:	Michel Lavondès <fox@vader.aacc.cc.md.us>
PR:		docs/66538
2004-05-12 20:40:09 +00:00
Tim J. Robbins
6155c34adf Reduce overhead by calling internal versions of the multibyte conversion
functions directly wherever possible.
2004-05-12 14:26:54 +00:00
Tim J. Robbins
2051a8f2d5 Move prototypes of various encoding-related functions into a new header
file to avoid extern'ing them all over the place.
2004-05-12 14:09:04 +00:00
Ruslan Ermilov
cb30b9c545 Link radixsort(3) to sradixsort(3), make the latter appear in
the whatis(1) output.
2004-05-12 08:13:40 +00:00
Ruslan Ermilov
2841422af9 Put crypto-aware version of the library into the right distribution. 2004-05-12 06:31:36 +00:00
Christian S.J. Peron
1f95348010 Document the fact that in a jailed environment, sendto(2) could fail
returning EPERM if the source address specified in the IP header did
not match the address bound to the prison.

Approved by:	bmilekic (mentor)
2004-05-11 16:28:07 +00:00
Tim J. Robbins
88af941a73 In the absence of proper validation, at least check that null bytes
do not appear as anything but the first byte of a multibyte character.
2004-05-11 14:08:22 +00:00
Diomidis Spinellis
26eff9e85b Fix and clarify unparsable sentence.
MFC after:	2 weeks
2004-05-11 11:10:09 +00:00
Diomidis Spinellis
94cf9da03c Bring the description for login_getclassbyname in sync with the function's
arguments.  The function has as a second argument a struct passwd * pointer,
not a directory name.

MFC after:	2 weeks
2004-05-11 11:05:26 +00:00
Diomidis Spinellis
857b57eae1 Remove a trailing newline, to behave as documented in syslog(3):
"A trailing newline is added if none is present."

The code in syslogd, stderr, and console output always adds a newline
at the EOL.  However, the existing code never actually removed a
trailing newline, and apparently relied on syslogd to convert it
into a space character.  Thus, the existing newline was converted
to a trailing space at the EOL by syslogd, while stderr, and console
output resulted in an empty line.

MFC after:	2 weeks
2004-05-10 17:12:52 +00:00
Bruce Evans
d98d9ce623 Fixed style bugs in previous commit (bogus forward declaration and
inconsistent capitalization in comments).
2004-05-10 09:36:26 +00:00
Tim J. Robbins
45a11576f3 Use a binary search to find the range containing a character in
RuneRange arrays. This is much faster when there are hundreds of
ranges (as is the case in UTF-8 locales) and was inspired by a
similar change made by Apple in Darwin.
2004-05-09 13:04:49 +00:00
Christian Brueffer
b17e85fede o fix a sentence to match with the synopsis [1]
o fix grammar nit

PR:		66289 [1]
Submitted by:	Michel Lavondès <fox@vader.aacc.cc.md.us>
Obtained from:	OpenBSD [1]
MFC after:	3 days
2004-05-09 11:11:21 +00:00
Peter Edwards
99ca5b8804 The FTS_NOSTAT option is an optimisation that reduces the number
of stat(2) calls by keeping an eye of the number of links a directory
has. It assumes that each subdirectory will have a hard link to its
parent, to represent the ".." node, and stops calling stat(2) when
all links are accounted for in a given directory.

This assumption is really only valid for UNIX-like filesystems: A
concrete example is NTFS. The NTFS "i-node" does contain a link
count, but most/all directories have a link count between 0 and 2
inclusive. The end result is that find on an NTFS volume won't
actually traverse the entire hierarchy of the directories passed
to it. (Those with a link count of two are not traversed at all)

The fix checks the "UFSness" of the filesystem before enabling the
optimisation.

Reviewed By: Tim Kientzle (kientzle@)
2004-05-08 15:09:02 +00:00
Stefan Farfeleder
b60cb13f76 Add an implementation of copysignl(), a long double version of copysign().
Approved by:	das (mentor)
2004-05-07 18:56:31 +00:00
Stefan Farfeleder
325152e8fb Add an MLINK for fabsl().
Approved by:	das (mentor)
2004-05-07 17:55:07 +00:00
Stefan Farfeleder
89c5bc6db4 The prototypes for cabs() and cabsf() are in <complex.h>. Fix their arguments'
types and describe them briefly.

Reviewed by:	ru, bde
Approved by:	das (mentor)
2004-05-06 13:11:18 +00:00
Tim Kientzle
542fc1042b A minor refactoring to simplify portability: assign the filename
length to a separate variable so that it will be easier to adapt to
systems that don't have d_namlen in struct dirent.
2004-05-05 06:33:00 +00:00
Tim Kientzle
71125f3eb4 Consistify: #define gets 1 tab character afterwards
Pointed out by: Simon Nielsen
2004-05-03 01:40:34 +00:00
David E. O'Brien
253f85d3c9 Remove bogus FBSDID. 2004-05-02 20:13:29 +00:00
David E. O'Brien
af15264014 Fix damaged FBSDID. 2004-05-02 20:09:14 +00:00
David Schultz
30d3088041 Merge vfscanf.c, v1.37:
- s/#ifdef FLOATING_POINT/#ifndef NO_FLOATING_POINT/
2004-05-02 10:56:26 +00:00
David Schultz
ce2551ad29 Merge vfprintf.c, v1.65:
- s/#ifdef FLOATING_POINT/#ifndef NO_FLOATING_POINT/
- Remove HEXFLOAT
2004-05-02 10:56:17 +00:00
David Schultz
757edc654e Add option NO_FP_LIBC, which disables floating-point support in
*printf() and *scanf().  Currently, this reduces the size of libc.so
by 9K on i386.  But the real savings are for static binaries that use
*printf() or *scanf() but not strtod(); with an FP-disabled libc,
these binaries will not depend on the gdtoa routines, making each
binary about 22K smaller.
2004-05-02 10:55:07 +00:00
David Schultz
8de9e89719 - To make it easier to compile *printf() and *scanf() without
floating-point support, remove default definition of FLOATING_POINT
  from the source, and change the compile-time option to
  NO_FLOATING_POINT.
- Remove the HEXFLOAT option.  It saves an insignificant amount of
  space (<0.1% of the size of libc on i386) and complicates vfprintf()
  and checkfmt().
2004-05-02 10:55:06 +00:00
David Schultz
38d17374b2 When *printf() and *scanf() are compiled without floating-point
support, fmtcheck() should not accept format strings that contain
floating-point formats.
2004-05-02 10:55:05 +00:00
Tim Kientzle
037a17e70b Include appropriate flag header on Linux. 2004-05-02 00:38:38 +00:00
Tim Kientzle
183392ce20 Create missing directories when extracting hardlinks and symlinks. 2004-04-30 01:31:20 +00:00
Tim Kientzle
9e62b060b7 Implement ARCHIVE_EXTRACT_UNLINK for regular files. This supports the
-U flag to bsdtar.  Essentially, this option breaks existing hard
links.  According to SUSv2, tar is supposed to overwrite existing
files on extract by default which, in particular, preserves
existing hard links.  Note that this is yet another bug in gtar; it
appears to always break existing links.  (Maybe gtar's -U is broken?)

I'm unsure about how to handle this for other file types; the current
code always unlinks first unless the NO_OVERWRITE flag is specified.
I've commented this issue liberally and will come back to it later.
2004-04-29 05:19:42 +00:00
Tim Kientzle
887bcd3995 Add statistics: track offset in compressed and uncompressed archive,
provide an interface for the client to query this information.
2004-04-28 04:41:27 +00:00
Tim Kientzle
775471a93a Correct spelling of "shell archive" to match /usr/share/misc/magic. 2004-04-28 04:36:57 +00:00
Tim Kientzle
a07768e948 Add the libarchive-formats.5 manpage. This summarizes the various
archive formats supported by libarchive, with some information about
the relative strengths and weaknesses of each format and notes about
issues with libarchive's support for those formats.

This page should make it unnecessary to list all of the libarchive
formats in the manpage of each program that uses libarchive.
Such programs can simply refer to libarchive-formats(5).
2004-04-28 04:34:07 +00:00
Tim Kientzle
7bcc31e94f Add read support for four more common cpio variants:
* little-endian old-style binary cpio archives
 * big-endian old-style binary cpio archives
 * SVR4 portable archives without CRC
 * SVR4 portable archives with CRC

Note that I don't yet verify the CRC for the last one, and I'm
not quite certain I'm correctly parsing device numbers.
2004-04-28 03:44:08 +00:00
Ruslan Ermilov
b4b831ef39 - Added rad_demangle() for demangling user-passwords (needed for
MS-CHAPv1 MPPE-keys).
- Added rad_demangle_mppe_key() for demangling mppe-keys (needed
  for MPPE-keys).
- Added some typecasts for avoiding compiler warnings.
- Fix: better handle wrong usage of the lib (if the programmer
  has not called rad_create_request() but rad_put_*(), then a
  weird error message was returned).
- Added a new function for putting the Message-Authenticator.
- Verify the Message-Authenticator, if it was found inside a
  response packet and silently drop the packet, if the validation
  failed.
- Implicitly put the Message-Authenticator, if the EAP-Message
  attribute was added.
- Added some missing defines.

Submitted by:	Michael Bretterklieber
PR:		46555
2004-04-27 15:00:29 +00:00
Ruslan Ermilov
d1ec91e353 Markup nit. 2004-04-27 09:18:49 +00:00
Tim Kientzle
61fac2242c Update file flag handling.
The new fflags support in archive_entry supports Linux and FreeBSD
file flags and is a bit more gracious about unrecognized flag names
than strtofflags(3).  This involves some minor API breakage.

The default tar format ("restricted pax") now enables pax extensions
when archiving files that have flags.  In particular, copying dir
heirarchies with 'bsdtar cf - -C src . | bsdtar xpf - -C dest' now
preserves file flags.  (Note the "p" on extract!)

While I'm here, fill in some additional explanation in the
archive_entry.3 manpage, fill in some missing MLINKS, mark some
overlooked internal functions 'static', and make a few minor style
fixes.
2004-04-26 23:37:54 +00:00
Andrey A. Chernov
28aec5a68c Rewrite split_lines() to operate safely
PR:             62694
Submitted by:   moulin p <moulin.p@calyopea.com>
2004-04-25 19:56:50 +00:00
David Schultz
8f3f7c66d0 Make sure that symbols are declared in math.h iff the appropriate
namespaces are visible.  Previously, math.h failed to hide some C99-,
XSI-, and BSD-specific symbols in certain compilation environments.

The referenced PR has a nice listing of the appropriate conditions for
making symbols visible in math.h.  The only non-stylistic difference
between the patch in the PR and this commit is that I superfluously
test for __BSD_VISIBLE in a few places to be more explicit about which
symbols have historically been part of the FreeBSD environment.

PR:		65939
Submitted by:	Stefan Farfeleder <stefan@fafoe.narf.at>
2004-04-25 02:35:42 +00:00
David Schultz
334c760eea Remove a stale comment referring to values.h, which has never been
part of FreeBSD.

PR:		65939
2004-04-25 02:32:46 +00:00
Mike Makonnen
afa647196b Unconditionaly initialize any spin lock passed to pthread_spin_init(). While
makeing sure the spinlock isn't already in use might be a nice feature to
have in theory, it's hard to implement in practice since the passed in
pointer may not be NULL, but still be an invalid value (i.e. 1..2..3.. etc).
2004-04-24 09:38:41 +00:00
Tim Kientzle
a020f1405f Make clone more aggressive about copying strings to the new entry.
The original might have pointers to user-specified strings;
copying the string (instead of just the pointer) protects against
the client re-using their own buffers.

I'm trying hard to avoid dumping all of the 'set' string functions
in favor of slower, but more predictable 'copy' semantics.
2004-04-23 17:15:48 +00:00
Tim Kientzle
4db0943252 Set the 'dump' flag for shardump format.
Credit Juergen Lock.
Pointy hat to me for deleting this somewhere along the way.
2004-04-23 17:13:40 +00:00