From owner-freebsd-questions Sun Aug 15 0: 0:48 1999 Delivered-To: freebsd-questions@freebsd.org Received: from mobil.surnet.ru (mobil.surnet.ru [195.54.2.7]) by hub.freebsd.org (Postfix) with ESMTP id 54A0814ED1 for ; Sun, 15 Aug 1999 00:00:39 -0700 (PDT) (envelope-from ilia@cgilh.chel.su) Received: (from uucgilh@localhost) by mobil.surnet.ru (8.9.1a/8.9.1) with UUCP id MAA21549; Sun, 15 Aug 1999 12:55:19 +0600 (UDT) Received: (from uucp@localhost) by cgilh.chel.su (8.8.7/8.8.7) with UUCP id LAA03336; Sun, 15 Aug 1999 11:57:01 +0600 Received: from localhost (ilia@localhost) by localhost.cgu.chel.su (8.9.2/8.9.2) with ESMTP id LAA00623; Sun, 15 Aug 1999 11:54:12 +0600 (ESS) (envelope-from ilia@cgilh.chel.su) X-Authentication-Warning: localhost.cgu.chel.su: ilia owned process doing -bs Date: Sun, 15 Aug 1999 11:54:12 +0600 (ESS) From: Ilia Chipitsine X-Sender: ilia@localhost.cgu.chel.su To: "David S. Jackson" Cc: Ed Vander Bush , freebsd-questions@FreeBSD.ORG Subject: Re: Mount CDROM from User Account In-Reply-To: <19990815001859.G20961@juno.dsj.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=koi8-r Content-Transfer-Encoding: 8BIT Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG guys, playing with sudo make sure you allow _only_ mounting cdrom, but not just mount(8) :-( FreeBSD is supposed to be stable and robust, would it be so if you allow any user to mount any partition with sudo ?! I recall the recent thread when somebody strongly wanted to allow 'sudo passwd' :-))) sudo is _that_ tricky. option "user" in /etc/fstab makes much more sense... Regards, (Наилучшие пожелания) Ilia Chipitsine (Илья Шипицин) On Sun, 15 Aug 1999, David S. Jackson wrote: > So then Ed Vander Bush (ed@metafy.com) said . . . > > > I am trying to mount my cd from a user acount and I am getting the error > > "Operation Not Permitted". It works as root. This account is in the > > wheel group and mounting to a directory with proper permissions. What am I > > doing wrong? Thanks. > > Looks like the BSD implementation of 'mount' doesn't include 'user' > among its mount options. Is this true, gurus? > > [ hmmm...he thought...scratching his head as he read page 236 of _The > Complete FreeBSD_. "If you come from a System V environment, you'll > notice a significant difference in format--see the man page _fstab(5)_ > for the full story." ] > > Anyway, you could always join sudoers and mount/umount the CD that > way, right? > > I wrote this little script below for use first with Linux. And I just > now tried to adapt it to FBSD. Gurus, please let me know if what I'm > doing is in error or is ill-advised! > > --------------SNIP---------------(Warning: Linux centric) > #! /bin/sh > > # Syntax: cdm [-flum] > > # This utility allows you to unmount or mount the cdrom device > # to/from the ftp public location (/home/ftp/pub/cdrom) or the > # normal mount location (/cdrom). > > # HISTORY: created Aug 26, 1998. last modified Aug 27, 1998. > # adapted (hopefully) to FreeBSD by dsj@dsj.net Aug 14, 1999. > > device="/dev/wcd0c" > mountpt="/cdrom" > ftpmountpt="/home/ftp/pub/cdrom" > mntcmd="mount -t cd9660" > > case $1 in > > -f) > sudo "$mntcmd $device $ftpmountpt" > ;; > -l) > mount > ;; > -u) > check=$(mount | grep /cdrom) > check1=$(mount | grep /home/ftp/pub/cdrom) > check2=$(mount | grep /dev/scd0) > if [ -n "$check" ]; then > echo "umounting $check" > sudo "umount $device /cdrom" > elif [ -n "$check1" ]; then > echo "unmounting $check1" > sudo "umount $device /home/ftp/pub/cdrom" > elif [ -n "$check2" ]; then > echo "unmounting $check2" > where=$(echo $check2 | cut -f 3 -d " ") > sudo "umount $device $where" > else > echo "$device is not mounted" > fi > ;; > -m) > sudo "mount $args $device $mountpt" > ;; > *) > echo "usage: cdm -f (for ftp users: requires root access) \n or -l (to show mounted directories) \n or -u (to umount /dev/wcd0c: requires root access) \n or * (to show this help resource) \n or -m (to mount to normal mount position: /cdrom -- Requires root access)" > > esac > > -----------------SNIP------------------ > > Hope this helps more than it hinders. I haven't tested this yet; its > predecessor worked under Linux, but, well...that was Linux. Perhaps > using login classes would be more fruitful? > > -- > David S. Jackson http://www.dsj.net > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > To give your sheep or cow a large, spacious meadow is the > way to control him. --Shunryu Suzuki > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message