From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Oct 30 16:00:27 2010 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BB841065670 for ; Sat, 30 Oct 2010 16:00:27 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id F0B248FC19 for ; Sat, 30 Oct 2010 16:00:26 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o9UG0QX6011355 for ; Sat, 30 Oct 2010 16:00:26 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o9UG0QSa011338; Sat, 30 Oct 2010 16:00:26 GMT (envelope-from gnats) Resent-Date: Sat, 30 Oct 2010 16:00:26 GMT Resent-Message-Id: <201010301600.o9UG0QSa011338@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, daniele Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57A59106566B for ; Sat, 30 Oct 2010 15:54:53 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 2A91D8FC08 for ; Sat, 30 Oct 2010 15:54:53 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o9UFsqCi042351 for ; Sat, 30 Oct 2010 15:54:52 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o9UFsqgW042344; Sat, 30 Oct 2010 15:54:52 GMT (envelope-from nobody) Message-Id: <201010301554.o9UFsqgW042344@www.freebsd.org> Date: Sat, 30 Oct 2010 15:54:52 GMT From: daniele To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/151833: sysutils/kiconvtool: I don't know how to load the pair (UTF-8 -> _wctype) X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Oct 2010 16:00:27 -0000 >Number: 151833 >Category: ports >Synopsis: sysutils/kiconvtool: I don't know how to load the pair (UTF-8 -> _wctype) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Oct 30 16:00:26 UTC 2010 >Closed-Date: >Last-Modified: >Originator: daniele >Release: 8.1-RELEASE #0 >Organization: >Environment: FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:55:53 UTC 2010 root@:/usr/obj/usr/src/sys/GENERIC i386 >Description: As a standard user I could not succesfully execute 'mount_msdosfs -L en_US.UTF-8 /dev/da0s1 local/mnt' I installed kiconvtool and added the following lines to /etc/rc.conf kiconv_preload="YES" kiconv_local_charsets="UTF-8" kiconv_foreign_charsets="UTF-16BE UTF-8" Even with this I could not execute the preceding command as a standard user. Taking a look at the code I discovered that "mount_msdosfs -L en_US.UTF-8 /dev/da0s1 local/mnt" when starts up sets its locale to en_US.UTF-8 [1]. And this leads to loading also the pair (UTF-8,_wctype) [2]. So, apparently, if that pair is not loaded, standard users can not execute the preceding command. At this point the problem that arises is that at command line I do not know how to specify the charset _wctype (unless this is not possible) and feed kiconvtool. To solve the problem, I then modified kiconvtool (explained below) so that the pair (UTF-8, _wctype) is loaded automatically. d [1] /usr/src/sbin/mount_msdosfs/mount_msdosfs.c - Line 114 [2] /usr/src/lib/libkiconv/xlat16_iconv.c - Line 123 >How-To-Repeat: >Fix: The workaround to solve this __specific__ problem was to apply the following patch and rebuild kiconvtool. Please *note* that this patch is not intended for general usage but just to give an idea of a base to further improve the port in case it is not possible to specify _wctype at command line (or to remove the requirement). --- kiconvtool.c 2010-10-30 17:18:32.000000000 +0200 +++ kiconvtool.new 2010-10-30 17:18:32.000000000 +0200 @@ -35,6 +35,7 @@ #include #include #include +#include enum arg_type_t_ { ARGTYPE_LOCAL, @@ -185,6 +186,7 @@ return 1; } + setlocale(LC_CTYPE, "en_US.UTF-8"); enum arg_type_t_ arg_type = ARGTYPE_PAIR; for (i = 1; i < argc; i++) { if (argv[i][0] == '-') { >Release-Note: >Audit-Trail: >Unformatted: