History log of /freebsd-10.0-release/lib/libc/iconv/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
267829 24-Jun-2014 delphij

Fix iconv(3) NULL pointer dereference and out-of-bounds array
access. [SA-14:15]

Fix multiple vulnerabilities in file(1) and libmagic(3).
[SA-14:16]

Worked around bug with PCID implementation. [EN-14:07]

Security: CVE-2014-3951
Security: FreeBSD-SA-14:15.iconv
Security: CVE-2013-7345, CVE-2014-1943, CVE-2014-2270
Security: FreeBSD-SA-14:16.file
Approved by: so

259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

258750 29-Nov-2013 gjb

MFC r258537, r258587:

r258537 (hrs):
Add ICONV_{GET,SET}_ILSEQ_INVALID iconvctl. GNU iconv returns
EILSEQ when there is an invalid character in the output codeset
while it is valid in the input. However, POSIX requires iconv()
to perform an implementation-defined conversion on the character.
So, Citrus iconv converts such a character to a special character
which means it is invalid in the output codeset.

This is not a problem in most cases but some software like libxml2
depends on GNU's behavior to determine if a character is output
as-is or another form such as a character entity (&#NNN;).

r258587 (peter):
Move the iconv wrapper source from libc_nonshared to libc/iconv so
that it is all in the one place again. Rename libc/iconv/iconv.c
to bsd_iconv.c. Compile the wrappers into libc.a so that
WITHOUT_DYNAMICROOT works again.

Approved by: re (kib)
Sponsored by: The FreeBSD Foundation


258398 20-Nov-2013 peter

MFC r258283 - move iconv* symbols out of libc.so.7 namespace with
compatibility symbols to aid transition for existing 10.x installs.

Approved by: re (kib)


258230 16-Nov-2013 gjb

MFC r257583, r258012, r258013:

r257583 (peter):
Remove the WITH_LIBICONV_COMPAT hack that seems to do more harm
than good. This caused libc to spoof the ports libiconv namespace
and provide a colliding libiconv.so.3 to fool rtld. This should
have been removed some time ago.

r258012:
Remove WITH_LIBICONV_COMPAT file to chase after r257583.

r258013:
Regenerate src.conf.5 after removal of WITH_LIBICONV_COMPAT.

Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

Sponsored by: The FreeBSD Foundation


258011 11-Nov-2013 dim

MFC r257859:

Fix typo in include guard, found by clang 3.4.

Approved by: re (hrs)


257039 24-Oct-2013 delphij

MFC r256833:

Drop cm_lock before calling mapper_close, which in turn could call
_citrus_mapper_close again and result in a deadlock otherwise.

This is similar to NetBSD PR/24023 (fixed in their r1.5 of this file).

PR: bin/182994
Submitted by: Fabian Keil <fk fabiankeil de>
Approved by: re (hrs)


256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


255297 06-Sep-2013 theraven

Fix the namespace pollution caused by iconv.h including stdbool.h
This broke any C89 ports that defined bool themselves, including things
like gcc, gtk, and so on.


254285 13-Aug-2013 peter

Expose _citrus_bcs_trunc_rws_len for libintl's use.

Submitted by: Jan Beich <jbeich@tormail.org>


254273 13-Aug-2013 peter

The iconv in libc did two things - implement the standard APIs, the GNU
extensions and also tried to be link time compatible with ports libiconv.
This splits that functionality and enables the parts that shouldn't
interfere with the port by default.

WITH_ICONV (now on by default) - adds iconv.h, iconv_open(3) etc.
WITH_LIBICONV_COMPAT (off by default) adds the libiconv_open etc API, linker
symbols and even a stub libiconv.so.3 that are good enough to be able
to 'pkg delete -f libiconv' on a running system and reasonably expect it
to work.

I have tortured many machines over the last few days to try and reduce
the possibilities of foot-shooting as much as I can. I've successfully
recompiled to enable and disable the libiconv_compat modes, ports that use
libiconv alongside system iconv etc. If you don't enable the
WITH_LIBICONV_COMPAT switch, they don't share symbol space.

This is an extension of behavior on other system. iconv(3) is a standard
libc interface and libiconv port expects to be able to run alongside it on
systems that have it.

Bumped osreldate.


254080 08-Aug-2013 peter

Our libc iconv (unlike gnu iconv and the citrus code in NetBSD) has a
bypass mode when src == dst. Unfortunately, there are tools in ports
that pass byte streams through iconv to determine if the encodings
are valid. eg: gettext-0.18.3+.

Disable the optimization and behave like the other implementations.


252584 03-Jul-2013 peter

Make it clear that there are three separate internal locks.


252583 03-Jul-2013 peter

As a followup to r252547, propate const down the call stack.


252547 03-Jul-2013 peter

Replace the #define for "iconv" so it is for the function name instead of
a macro with parameters. Remove a __DECONST hack and add consts instead
for gnu libiconv API compatability. This makes it work with things like
devel/boost-libs that expects to use "iconv" as though it were a pointer.


252464 01-Jul-2013 peter

If strdup failed, don't try and free the wrong thing.


252458 01-Jul-2013 peter

__weak_alias() doesn't exist on FreeBSD. Use __weak_reference();

Expose iconv functions as weak symbols as well as their internal
remapped #define names. This is necessary for autoconf compatability -
on Linux it appears that #include <iconv.h> isn't a link time
prerequisite for their version that's built into glibc.

Initialize the pthread rwlock. Note that upstream has three
separate locks. The file-local static lock appears intentional.

I'm using this as a ports-compatible compile-time substitute for
converters/libiconv on one of my personal machines.


250981 25-May-2013 ed

Make some tiny improvements to iconv_open().

- Remove an unneeded variable.
- Fix whitespace bugs.
- Fix typoes in comment.
- Improve string handling a bit. Don't handroll strstr() and don't
terminate a strdup()'ed string. Instead, simply strndup() the part we
need.


250980 25-May-2013 ed

Only call free() on something we allocated.

If we were already provided a struct _citrus_iconv (e.g. through
iconv_open_into()), we should not call free() in case io_init_context()
fails. Instead, call it on the pointer of the allocated object, which
will be NULL in case of iconv_open_into().


250938 23-May-2013 ed

Let iconv build on -HEAD properly.

- Add NO_WMISSING_VARIABLE_DECLARATIONS where we use Yacc/Lex.
- Add variable declarations where possible.
- Add missing static keyword.


244350 17-Dec-2012 jilles

libc/iconv: Fix race condition with setting FD_CLOEXEC.

A fork/exec could happen between open and fcntl, leaking a file descriptor.
Using O_CLOEXEC fixes this and as a side effect simplifies the code.

NetBSD already had this (I checked this after making the change myself).

Reviewed by: gabor


233625 28-Mar-2012 joel

Fix Fo arguments.

Reviewed by: gabor


233577 27-Mar-2012 joel

mdoc: add missing El macro.


233522 26-Mar-2012 joel

mdoc: correct .Bd/.Bl arguments.

Reviewed by: brueffer


233509 26-Mar-2012 joel

Fix date.


228843 23-Dec-2011 cperciva

Fix a problem whereby a corrupt DNS record can cause named to crash. [11:06]

Add an API for alerting internal libc routines to the presence of
"unsafe" paths post-chroot, and use it in ftpd. [11:07]

Fix a buffer overflow in telnetd. [11:08]

Make pam_ssh ignore unpassphrased keys unless the "nullok" option is
specified. [11:09]

Add sanity checking of service names in pam_start. [11:10]

Approved by: so (cperciva)
Approved by: re (bz)
Security: FreeBSD-SA-11:06.bind
Security: FreeBSD-SA-11:07.chroot
Security: FreeBSD-SA-11:08.telnetd
Security: FreeBSD-SA-11:09.pam_ssh
Security: FreeBSD-SA-11:10.pam


225678 19-Sep-2011 gabor

- Fix a trivial bug in iconv. When there is no space to perform the
conversion, conversion must fail and errno must be set to E2BIG.

PR: standards/160673
Submitted by: Henning Petersen <henning.petersen@t-online.de>
Reviewed by: pluknet
Approved by: re (kib), delphij (mentor)


223296 19-Jun-2011 kan

Put a quick bandaid on internal citrus locking.

The code is not quite right still, but it programs from deadlocking
on themselves if one enables new citrus code by mistake.


222600 02-Jun-2011 uqs

mdoc: reorder sections consistently


222354 27-May-2011 gabor

- Move some internal functions to the private namespace

Submitted by: kan
Approved by: delphij (mentor)


219019 25-Feb-2011 gabor

Add the BSD-licensed Citrus iconv to the base system with default off
setting. It can be built by setting the WITH_ICONV knob. While this
knob is unset, the library part, the binaries, the header file and
the metadata files will not be built or installed so it makes no impact
on the system if left turned off.

This work is based on the iconv implementation in NetBSD but a great
number of improvements and feature additions have been included:

- Some utilities have been added. There is a conversion table generator,
which can compare conversion tables to reference data generated by
GNU libiconv. This helps ensuring conversion compatibility.
- UTF-16 surrogate support and some endianness issues have been fixed.
- The rather chaotic Makefiles to build metadata have been refactored
and cleaned up, now it is easy to read and it is also easier to add
support for new encodings.
- A bunch of new encodings and encoding aliases have been added.
- Support for 1->2, 1->3 and 1->4 mappings, which is needed for
transliterating with flying accents as GNU does, like "u.
- Lots of warnings have been fixed, the major part of the code is
now WARNS=6 clean.
- New section 1 and section 5 manual pages have been added.
- Some GNU-specific calls have been implemented:
iconvlist(), iconvctl(), iconv_canonicalize(), iconv_open_into()
- Support for GNU's //IGNORE suffix has been added.
- The "-" argument for stdin is now recognized in iconv(1) as per POSIX.
- The Big5 conversion module has been fixed.
- The iconv.h header files is supposed to be compatible with the
GNU version, i.e. sources should build with base iconv.h and
GNU libiconv. It also includes a macro magic to deal with the
char ** and const char ** incompatibility.
- GNU compatibility: "" or "char" means the current local
encoding in use
- Various cleanups and style(9) fixes.

Approved by: delphij (mentor)
Obtained from: The NetBSD Project
Sponsored by: Google Summer of Code 2009