From owner-freebsd-questions@FreeBSD.ORG Sat Feb 28 12:04:42 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4700651C for ; Sat, 28 Feb 2015 12:04:42 +0000 (UTC) Received: from outbound-queue-1.mail.thdo.gradwell.net (outbound-queue-1.mail.thdo.gradwell.net [212.11.70.34]) by mx1.freebsd.org (Postfix) with ESMTP id CCFE8C9A for ; Sat, 28 Feb 2015 12:04:41 +0000 (UTC) Received: from outbound-edge-2.mail.thdo.gradwell.net (bonnie.gradwell.net [212.11.70.2]) by outbound-queue-1.mail.thdo.gradwell.net (Postfix) with ESMTP id 4BD2321E77 for ; Sat, 28 Feb 2015 12:04:39 +0000 (GMT) Received: from cpc7-jarr12-2-0-cust882.16-2.cable.virginm.net (HELO amd.asgard.uk) (92.238.71.115) (smtp-auth username dave%pop3.dgmm.net, mechanism plain) by outbound-edge-2.mail.thdo.gradwell.net (qpsmtpd/0.83) with ESMTPA; Sat, 28 Feb 2015 12:04:39 +0000 From: Dave To: freebsd-questions@freebsd.org Subject: Re: problems mounting camera to download pics .... Date: Sat, 28 Feb 2015 12:04:38 +0000 Message-ID: <1576806.ao4TrkcAeN@amd.asgard.uk> User-Agent: KMail/4.14.2 (FreeBSD/9.3-RELEASE-p10; KDE/4.14.2; amd64; ; ) In-Reply-To: References: <54EF5A28.8010605@hiwaay.net> <5161492.5f10mYJAFX@amd.asgard.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Gradwell-MongoId: 54f1aed7.2ecb-175d-2 X-Gradwell-Auth-Method: mailbox X-Gradwell-Auth-Credentials: dave@pop3.dgmm.net X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Feb 2015 12:04:42 -0000 On Friday 27 February 2015 22:56:18 Markus Hoenicka wrote: > Am 2015-02-27 22:33, schrieb Dave: > > On Thursday 26 February 2015 17:14:38 William A. Mahaffey III wrote: > >> On 02/26/15 15:54, Adam Vande More wrote: > >> > On Thu, Feb 26, 2015 at 11:38 AM, William A. Mahaffey III > >> > > >> > > >> > wrote: > >> >> .... I am trying to mount my digital camera to download some pics I > >> >> just > >> >> took. When I do this as root, it works AOK & I got the pics off. > >> >> However, > >> >> when I changed my fstab file to (supposedly) allow regular users to > >> >> mount > >> >> that directory, the mount command fails: > >> >> > >> >> > >> >> [wam@kabini1, ~, 11:33:11am] 530 % mount /media/flash/ > >> >> mount_msdosfs: /dev/da0s1: Operation not permitted > >> >> [wam@kabini1, ~, 11:35:58am] 530 % > >> >> > >> >> > >> >> relevant lines from my fstab file: > >> >> > >> >> > >> >> /dev/da0s1 /media/flash msdosfs > >> >> rw,sync,noauto,longnames,-Lru_RU.UTF-8,users 0 0 > >> >> # /dev/da0s1 /media/flash msdosfs > >> >> rw,sync,noauto,longnames,-Lru_RU.UTF-8 0 0 > >> >> > >> >> > >> >> FreeBSD 9.3-RELEASE-p9 > >> >> > >> >> Not a huge issue, since I can get 'er done as root, but I don't see > >> >> why > >> >> this shouldn't be feasible as a regular user .... TIA & have a nice, > >> >> snowy > >> >> (here) day ;-) .... > >> > > >> > sysctl vfs.usermount=1 > >> > >> Already tried, didn't work, however someone else suggested setuid on > >> /sbin/(u)mount & that worked .... Thanks :-) .... > > > > Rather than giving every user root level access to mount (possible > > security > > issue), the more correct way is to create devfs rules, see the FreeBSD > > Handbook: > > > > https://www.freebsd.org/doc/en/books/handbook/usb-disks.html > > I've done something along these lines to make my camera accessible from > FreeBSD, see this blog entry here: > > http://www.mhoenicka.de/system-cgi/blog/index.php?itemid=2234 > > hope this helps > Markus Oh, OK then. FWIW I have this User is member of group operator /etc/rc.conf contains: devfs_system_ruleset="devfsrules_common" /etc/devfs.rules contains: [devfsrules_common=7] add path 'ad[0-9]*' mode 666 add path 'ada[0-9]*' mode 666 add path 'da[0-9]*' mode 666 add path 'acd[0-9]*' mode 666 add path 'cd[0-9]*' mode 666 add path 'pass[0-9]*' mode 666 add path 'xpt[0-9]*' mode 666 add path 'ugen[0-9]*' mode 666 group operator add path 'usbctl' mode 666 add path 'usb/*' mode 666 add path 'lpt[0-9]*' mode 666 add path 'ulpt[0-9]*' mode 666 add path 'unlpt[0-9]*' mode 666 add path 'uscan[0-9]*' mode 666 add path 'usb/4.2.[0-9]' mode 666 group operator ...and I mount manually via a short script. camcontrol devlist | grep FUJIFILM > /dev/null 2>&1 if [ "$?" -eq "0" ]; then dev=`camcontrol devlist | grep FUJIFILM | grep -o 'da[0-9][0-9]*'` if [ `df | grep $dev | grep -o 'da[0-9][0-9]*'` ]; then echo Camera already mounted else mount -t msdosfs /dev/${dev}s1 /home/dave/camera echo Mounted Camera to ~/camera as /dev/${dev}s1 fi else echo Camera not plugged in fi That's probably a rubbish script, but it works for me. I should probably go back and re-visit devfs,rules and limit the access a bit and/or get around to sorting out devd to automount it.