From owner-freebsd-questions@FreeBSD.ORG Fri Oct 29 11:15:25 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83E6C106566C for ; Fri, 29 Oct 2010 11:15:24 +0000 (UTC) (envelope-from glimp@live.com) Received: from blu0-omc4-s32.blu0.hotmail.com (blu0-omc4-s32.blu0.hotmail.com [65.55.111.171]) by mx1.freebsd.org (Postfix) with ESMTP id 410FE8FC14 for ; Fri, 29 Oct 2010 11:15:24 +0000 (UTC) Received: from BLU0-SMTP153 ([65.55.111.135]) by blu0-omc4-s32.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 29 Oct 2010 04:15:23 -0700 X-Originating-IP: [151.49.230.114] X-Originating-Email: [glimp@live.com] Message-ID: Received: from genki.collidiamo.net ([151.49.230.114]) by BLU0-SMTP153.phx.gbl over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Fri, 29 Oct 2010 04:15:22 -0700 Date: Fri, 29 Oct 2010 13:13:45 +0200 From: dan User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.11) Gecko/20101025 Thunderbird/3.1.5 MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 29 Oct 2010 11:15:22.0928 (UTC) FILETIME=[9450DB00:01CB775A] Subject: Re: mount_msdosfs -L ... [odd behaviour ?] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Oct 2010 11:15:25 -0000 On 10/29/10 01:00, Chuck Swiger wrote: > Hi, Dan-- > > On Oct 28, 2010, at 3:45 PM, dan wrote: >> 'mount_msdosfs -L en_US.UTF-8 /dev/da0 local/mnt/' >> >> executed by a non root-user prints out the following >> >> "mount_msdosfs: msdosfs_iconv: Operation not permitted" >> >> and then stops with error 71 on console. >> >> Later, the same command, executed by the same user, completes correctly if some time before the root user has succesfully issued it and unmounted the device. >> >> Any clues ? Things I am probably missing ? Does Anyone else notice this (odd) behaviour (if it is odd) ? > > It's probably coming from /usr/src/sbin/mount_msdosfs/mount_msdosfs.c: > > if (set_charset(&iov,&iovlen, cs_local, cs_dos) == -1) > err(EX_OSERR, "msdosfs_iconv"); > > ...since set_charset() tries to load the msdosfs_iconv& libiconv kernel modules: > > if (modfind("msdosfs_iconv")< 0) > if (kldload("msdosfs_iconv")< 0 || modfind("msdosfs_iconv")< 0) { > warnx("cannot find or load \"msdosfs_iconv\" kernel module"); > return (-1); > } > > kldload() fails with EPERM if you are not root: > > [EPERM] You do not have access to read the file or link it > with the kernel. You should be the root user to be > able to use the kld system calls. > > Once root has loaded these modules, you can invoke mount_msdosfs as a normal user because they are already available. You can put "kldload msdosfs_iconv" into /etc/rc.local, or maybe tweak /boot/loader.conf to load these at boot if you prefer. > > Regards, Hello :-) Thank you for your research and prompt response. The module was available. I tried both: kldload in command line and adding it in loader.conf. Note. In case the module has not been been loaded,as a user, here, one gets 2 messages "mount_msdosfs: cannot find or load msdosfs_iconv kernel module" AND "mount_msdosfs: msdosfs_iconv: Operation not permitted" I wonder what Operation is not permitted as a user and what rights the user needs. d