From owner-freebsd-questions@FreeBSD.ORG Thu Oct 28 23:00:53 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 308A2106566C for ; Thu, 28 Oct 2010 23:00:53 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from asmtpout028.mac.com (asmtpout028.mac.com [17.148.16.103]) by mx1.freebsd.org (Postfix) with ESMTP id 188AA8FC08 for ; Thu, 28 Oct 2010 23:00:52 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from cswiger1.apple.com ([17.209.4.71]) by asmtp028.mac.com (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 64bit)) with ESMTPSA id <0LB0007WFVWIPX40@asmtp028.mac.com> for freebsd-questions@freebsd.org; Thu, 28 Oct 2010 16:00:19 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1004200000 definitions=main-1010280137 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.2.15,1.0.148,0.0.0000 definitions=2010-10-28_10:2010-10-28, 2010-10-28, 1970-01-01 signatures=0 From: Chuck Swiger In-reply-to: Date: Thu, 28 Oct 2010 16:00:18 -0700 Message-id: References: To: dan X-Mailer: Apple Mail (2.1081) Cc: freebsd-questions@freebsd.org 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: Thu, 28 Oct 2010 23:00:53 -0000 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, -- -Chuck