From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Jul 1 23:20:04 2007 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B8FD116A421 for ; Sun, 1 Jul 2007 23:20:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 9733D13C4B7 for ; Sun, 1 Jul 2007 23:20:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l61NK425008097 for ; Sun, 1 Jul 2007 23:20:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l61NK4Rl008096; Sun, 1 Jul 2007 23:20:04 GMT (envelope-from gnats) Resent-Date: Sun, 1 Jul 2007 23:20:04 GMT Resent-Message-Id: <200707012320.l61NK4Rl008096@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, Rechistov Grigory Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BE49A16A469 for ; Sun, 1 Jul 2007 23:14:43 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [69.147.83.33]) by mx1.freebsd.org (Postfix) with ESMTP id ADD3113C483 for ; Sun, 1 Jul 2007 23:14:43 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l61NEhDR051890 for ; Sun, 1 Jul 2007 23:14:43 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id l61NEhwx051889; Sun, 1 Jul 2007 23:14:43 GMT (envelope-from nobody) Message-Id: <200707012314.l61NEhwx051889@www.freebsd.org> Date: Sun, 1 Jul 2007 23:14:43 GMT From: Rechistov Grigory To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: ports/114199: Patch to make konqueror's mediamanager respect HAL's "volume.policy.mount_option" for msdosfs 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: Sun, 01 Jul 2007 23:20:04 -0000 >Number: 114199 >Category: ports >Synopsis: Patch to make konqueror's mediamanager respect HAL's "volume.policy.mount_option" for msdosfs >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Jul 01 23:20:04 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Rechistov Grigory >Release: 6.2-STABLE >Organization: >Environment: FreeBSD ip82-180.private.rt.mipt.ru 6.2-STABLE FreeBSD 6.2-STABLE #0: Thu Jun 7 01:06:01 UTC 2007 root@ip82-180.private.rt.mipt.ru:/usr/obj/usr/src/sys/DELL_v8 i386 >Description: There's a bug in current implementation of konqueror mediamanager (KDE 3.5.6_1) - for example, flash drives with msdosfs (vfat) are mounted without locale setting, resulting in not showing certain filenames (e.g. written with russian letters). The same problem has been existed for other types of filesystems (ntfs, cd9660, udf) but was recently solved: the current locale is passed to /sbin/mount with "-C" flag. But this method doesn't work for msdosfs because its locale is set with -L and -D flags (there are different approaches to character conversion in kernel modules I suppose). There is a way to set a policy in HAL to pass the options. One need to create a file with smth like this: $ cat /usr/local/etc/hal/fdi/policy/20-flash.fdi true true The bug is - mediamanager does not respect this policy. lissyara created a patch to solve this problem - see his article at http://www.lissyara.su/?id=1355 (russian) I applied this patch and it works, so I wonder whether it can be merged in ports tree. btw, there is a rumour that "mount_option" stuff is deprecated in HAL and will be replaced with smth, but I don't see any replacement keys in specs. Software I use: hal-0.5.8.20070403_2 (with FIXED_MOUNTPOINTS knob) kdebase-3.5.6_3 >How-To-Repeat: Insert FAT32 Flash drive with files that have international letters in names and mount it in konqueror with media:/ koislave. You'll notice that such files has dissapeared. >Fix: Put the patch in /usr/ports/x11/kdebase3/files/ , recompile and reinstall kdebase3. Create a policy file /usr/local/etc/hal/fdi/policy/20-flash.fdi, set your locale instead of ru_RU.KOI8-R an CP866. Restart hald as root: /usr/local/etc/rc.d/hald restart Restart KDE. Patch attached with submission follows: diff -Naur kioslave/media/mediamanager/halbackend.cpp kioslave/media/mediamanager/halbackend.cpp --- kioslave/media/mediamanager/halbackend.cpp Tue Apr 24 12:46:02 2007 +++ kioslave/media/mediamanager/halbackend.cpp Tue Apr 24 13:01:21 2007 @@ -803,6 +803,33 @@ s_HALBackend->DeviceCondition(udi, condition_name); } +QStringList HALBackend::getHALmountoptions(QString udi) +{ + const char* _ppt_string; + LibHalVolume* volume; + LibHalDrive* drive; + + QString _ppt_QString; + + volume = libhal_volume_from_udi( m_halContext, udi.latin1() ); + if( volume ) + drive = libhal_drive_from_udi( m_halContext, libhal_volume_get_storage_device_udi( volume ) ); + else + drive = libhal_drive_from_udi( m_halContext, udi.latin1() ); + + if( !drive ) + return QString::null; + + if( volume ) + _ppt_string = libhal_volume_policy_get_mount_options ( drive, volume, NULL ); + else + _ppt_string = libhal_drive_policy_get_mount_options ( drive, NULL ); + + _ppt_QString = QString(_ppt_string ? _ppt_string : ""); + + return QStringList::split(",",_ppt_QString); +} + QStringList HALBackend::mountoptions(const QString &name) { const Medium* medium = m_mediaList.findById(name); @@ -1246,10 +1273,25 @@ } #endif + QStringList hal_mount_options = getHALmountoptions(medium->id()); + for (QValueListIterator it=hal_mount_options.begin();it!=hal_mount_options.end();it++) + { + soptions << *it; + kdDebug()<<"HALOption: "<<*it<id().latin1(), mount_point.utf8(), options, noptions, dbus_connection); diff -Naur kioslave/media/mediamanager/halbackend.h kioslave/media/mediamanager/halbackend.h --- kioslave/media/mediamanager/halbackend.h Tue Apr 24 12:46:02 2007 +++ kioslave/media/mediamanager/halbackend.h Tue Apr 24 13:03:13 2007 @@ -200,6 +200,8 @@ const char* message ); + QStringList getHALmountoptions(QString udi); + /* HAL and DBus structures */ private: /** >Release-Note: >Audit-Trail: >Unformatted: