Commit Graph

10943 Commits

Author SHA1 Message Date
kientzle
495689c98f Enable 'ar' support; hook it up to the build and
enable it with _read_support_format_all().
2007-04-07 05:54:23 +00:00
kientzle
6c2dd913ff Clarification: Point people to archive_read_data(), which
should be used instead of archive_read_data_into_buffer().
2007-04-07 05:53:11 +00:00
cperciva
08d3388bce When copying data from one archive to another, only set the error
message in the reader to the error message from the writer if the
error which occurred was in the writer.  This avoids error messages
of "Empty error message" when extracting truncated archives.
2007-04-07 03:37:59 +00:00
emaste
9dfa1c4936 Describe PT_GETLWPLIST's arguments. 2007-04-07 03:16:23 +00:00
kan
dd704902af __p_rcode_syms is declared as external in resolv.conf, so it cannot be
redeclared as static in res_debug.c.

Make __p_rcode_syms global and add it to Symbol map. The rest of
__p_??_syms are already global.

Choice of FBSD_1.0 version for these debug symbols seems strange and
should be revisited before symbol  versioning is enabled for libc.so.7.
2007-04-06 19:45:17 +00:00
pjd
98524ca017 Bump date. 2007-04-05 21:17:52 +00:00
pjd
4718e01f98 Implement SEEK_DATA and SEEK_HOLE extensions to lseek(2) as found in
OpenSolaris. For more information please refer to:

	http://blogs.sun.com/bonwick/entry/seek_hole_and_seek_data
2007-04-05 21:10:53 +00:00
pjd
7e73da14eb Add security.jail.mount_allowed sysctl, which allows to mount and
unmount jail-friendly file systems from within a jail.
Precisely it grants PRIV_VFS_MOUNT, PRIV_VFS_UNMOUNT and
PRIV_VFS_MOUNT_NONUSER privileges for a jailed super-user.
It is turned off by default.

A jail-friendly file system is a file system which driver registers
itself with VFCF_JAIL flag via VFS_SET(9) API.
The lsvfs(1) command can be used to see which file systems are
jail-friendly ones.

There currently no jail-friendly file systems, ZFS will be the first one.
In the future we may consider marking file systems like nullfs as
jail-friendly.

Reviewed by:	rwatson
2007-04-05 21:03:05 +00:00
cperciva
44021ff691 Move archive_read_data_into_buffer into archive_read.c, simplify its
implementation, and mark it as deprecated.  It will be removed entirely
in libarchive 3.0 (in FreeBSD 8.0?) but there's no reason for anyone to
use it instead of archive_read_data.

Approved by:	kientzle
2007-04-05 15:51:19 +00:00
davidxu
2dd85eafce If a thread who's name is being set is not the current thread, use macros
THR_THREAD_LOCK and THR_THREAD_UNLOCK instead, this should fix wrong
lock level problem.

Bug reported by: ed dot maste at gmail dot com
2007-04-05 07:20:31 +00:00
kientzle
f267b347f9 More corrections from Joerg Sonnenberger. 2007-04-05 05:22:13 +00:00
kientzle
bf75e04a4e Style fixes from Joerg Sonnenberger: use correct types,
spell lint(1) comments correctly.
2007-04-05 05:20:13 +00:00
kientzle
a9a30ff15d From Joerg Sonnenberger: Fix a number of style gaffes,
including type puns and avoidable casts.
2007-04-05 05:18:16 +00:00
kientzle
1026a1bd3a Wordsmithing. 2007-04-05 05:07:53 +00:00
delphij
3628fe430a Avoid using intermediate variables by just comparing between
two values, the latter does not tend to have sign extension
and/or overflow bugs, and makes the code more obvious.

While I'm there, make use of a macro which is derived from
bin/ps/ps.c: ps_compat() to improve the readability of the
code.

Suggested by:	bde
MFC after:	1 week
2007-04-05 02:07:33 +00:00
ceri
1b7b9ce89e cipher(3) is gone.
MFC after:	3 days
2007-04-04 14:04:55 +00:00
kan
36e8f3f4fb Cast away const qualifier to squash GCC warning. 2007-04-04 03:29:02 +00:00
kan
035e850007 First argument of MD5Final is an array of unsigned characters.
Declare 'digest' local variable accordingly.
2007-04-04 03:24:01 +00:00
kan
aea51276ca Use correct u_int and socklen_t types for parameters if function is
expecting them, not int.
2007-04-04 02:59:54 +00:00
kan
4c8c917a1b Add include directives for string.h and stdlib.h to get proper function
prototypess of memset, memcpy and malloc respectively.
2007-04-04 02:40:59 +00:00
kan
8b7b60e0bc Include string.h to get proper memcpy prototype. 2007-04-04 02:28:48 +00:00
jkim
930f0277fa Import amd64 assembly implementations of div(3) family from NetBSD.
Obtained from:	NetBSD
2007-04-04 01:19:54 +00:00
cperciva
65266e0a56 Parse SCHILY.dev and SCHILY.ino fields. These are ignored when extracting
files, but used during archive creation.  This change unbreaks
# tar -cf rcp.tar /bin/rcp
# tar -cf rcp-copy.tar @rcp.tar
# cmp rcp.tar rcp-copy.tar
2007-04-03 23:53:55 +00:00
kan
183d257e23 Add entry for dl_iterate_phdr. 2007-04-03 18:38:01 +00:00
kan
94fce13c41 Add stub for dl_iterate_phdr. 2007-04-03 18:35:20 +00:00
kientzle
b356476feb 'ar' format support for libarchive, contributed by Kai Wang. 2007-04-03 05:34:36 +00:00
cperciva
b975b5f5f0 Now that there is always a compression-layer skip function available,
skip over the end-of-entry padding instead of reading and discarding
it.

Considering that tar files normally have a block size of 10kB, this
isn't likely to avoid reading any data, but at least it makes the code
simpler and clearer.
2007-04-02 04:21:22 +00:00
kientzle
65a30c481b Fix type-punned pointer, minor style fixes.
Thanks to: Joerg Sonnenberger
2007-04-02 00:41:37 +00:00
kientzle
4bdd9ba49a Remove unused variable; use consistent types.
Thanks to: Joerg Sonnenberger
2007-04-02 00:34:36 +00:00
kientzle
f4a2d7c1fc Be consistent: file flags are unsigned bitmaps.
Thanks to: Joerg Sonnenberger
2007-04-02 00:32:03 +00:00
kientzle
8b4607e1d3 Don't compare a signed char to 0xFF.
Thanks to: Joerg Sonnenberger
2007-04-02 00:29:52 +00:00
kientzle
214dcbe28a Avoid a potential overflow when 'skip' is larger than a pointer.
Thanks to: Joerg Sonnenberger
2007-04-02 00:25:11 +00:00
kientzle
fce578bdb8 Style fix: Use the correct type for 'bytes_to_write'.
Thanks to: Joerg Sonnenberger
2007-04-02 00:21:46 +00:00
kientzle
c25369d5e8 Style: bare "unsigned" is deprecated, use "unsigned int" instead.
Thanks to: Joerg Sonnenberger
2007-04-02 00:15:45 +00:00
kientzle
53ce615be3 Remove some unused fields from archive_read internal structure.
(Left over from when read and write used to share this structure.)
2007-04-02 00:11:54 +00:00
cperciva
5ca8f701f1 Provide a dummy compression-layer skip function which just reads data and
discards it, for use when the compression layer code doesn't know how to
skip data (e.g., everything other than the "none" compressor).  This makes
format level code simpler because that code can now assume that the
compression layer always knows how to skip and will always skip exactly
the requested number of bytes.

Discussed with:	kientzle (3 months ago)
2007-03-31 22:59:43 +00:00
trhodes
d74e4b9429 Back out my previous commit to this area, there are differences between
our implementation and OpenBSD's.

Requested by:	des
2007-03-30 06:12:45 +00:00
jasone
26e0e354b0 Use size_t instead of unsigned for pagesize-related values, in order to
avoid downcasting issues.  In particular, this change fixes
posix_memalign(3) for alignments greater than 2^31 on LP64 systems.

Make sure that NDEBUG is always set to be compatible with MALLOC_DEBUG. [1]

Reported by:	[1] Lee Hyo geol <hyogeollee@gmail.com>
2007-03-29 21:07:17 +00:00
jasone
ca1ed8272e Remove the run promotion/demotion machinery. Replace it with red-black
trees that track all non-full runs for each bin.  Use the red-black
trees to be able to guarantee that each new allocation is placed in the
lowest address available in any non-full run.  This change completes the
transition to allocating from low addresses in order to reduce the
retention of sparsely used chunks.

If the run in current use by a bin becomes empty, deallocate the run
rather than retaining it for later use.  The previous behavior had the
tendency to spread empty runs across multiple chunks, thus preventing
the release of chunks that were completely unused.

Generalize base_chunk_alloc() (and rename it to base_pages_alloc()) to
handle allocation sizes larger than the chunk size, so that it is
possible to support chunk sizes that are smaller than an arena object.

Reduce the minimum chunk size from 64kB to 8kB.

Optimize tracking of addresses for deleted chunks.

Fix a statistics bug for huge allocations.
2007-03-28 19:55:07 +00:00
jasone
ed54eea1f9 Change macro in order to refer to FreeBSD 7.0 instead of 7.0BSD.
Reported by:	Michal Mertl <mime@traveller.cz>
2007-03-28 18:55:44 +00:00
jasone
07d14320a3 Update the IMPLEMENTATION NOTES section to reflect recent malloc
enhancements.
2007-03-28 04:34:19 +00:00
jasone
064edc9b9b Remove some stray roff formatting that caused incorrect rendering. 2007-03-28 04:33:34 +00:00
jasone
a011d43e23 Add a HISTORY section. 2007-03-28 04:32:51 +00:00
yar
e8ee34e142 In account management, verify whether the account has been locked
with `pw lock', so that it's impossible to log into a locked account
using an alternative authentication mechanism, such as an ssh key.
This change affects only accounts locked with pw(8), i.e., having a
`*LOCKED*' prefix in their password hash field, so people still can
use a different pattern to disable password authentication only.

Mention all account management criteria in the manpage.

Approved by:	maintainer (timeout)
PR:		bin/71147
MFC after:	1 month
2007-03-27 09:59:15 +00:00
jkoshy
9645b900be Describe the contents of the "ar_name" and "ar_rawname" fields of
Elf_Arhdr structures better.
2007-03-27 04:47:50 +00:00
jkoshy
e13fe525e7 Bug fixes to ar(1) archive handling:
- Correctly retrieve the initial (special) members of an archive after
   an archive descriptor is rewound using elf_rand(SARMAG).
 - Do not strip trailing white space from the 'raw' names retrieved
   using elf_getarhdr().

Reported by:	"Hyo geol, Lee" <hyogeollee at gmail dot com>
2007-03-27 04:40:57 +00:00
jkoshy
1fe075e853 Clarify memory management rules for pmc_cpuinfo().
Suggested by:	"Harald Servat" <redcrash at gmail dot com>
2007-03-26 17:33:41 +00:00
jkoshy
359932b592 Document the return type of elf_rand(3) correctly. 2007-03-26 16:31:42 +00:00
jasone
8561f36aa3 Fix some subtle bugs for posix_memalign() having to do with integer
rounding and overflow.  Carefully document what the various overflow
tests actually detect.

The bugs mostly canceled out, such that the worst possible failure
cases resulted in non-fatal over-allocations.
2007-03-24 20:44:06 +00:00
kientzle
c9ae05df5c Notice when mkdir() fails.
Don't change permissions on an existing dir unless _EXTRACT_PERM
is requested.

In particular, bsdtar -x should not edit mode of existing dirs
now; bsdtar -xp will.
2007-03-24 05:02:16 +00:00