Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Aug 1999 11:54:12 +0600 (ESS)
From:      Ilia Chipitsine <ilia@cgilh.chel.su>
To:        "David S. Jackson" <dsj@dsj.net>
Cc:        Ed Vander Bush <ed@metafy.com>, freebsd-questions@FreeBSD.ORG
Subject:   Re: Mount CDROM from User Account
Message-ID:  <Pine.BSF.4.05.9908151151220.568-100000@localhost.cgu.chel.su>
In-Reply-To: <19990815001859.G20961@juno.dsj.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9908151151220.568-100000>