From owner-freebsd-current Wed Aug 23 09:50:40 1995 Return-Path: current-owner Received: (from majordom@localhost) by freefall.FreeBSD.org (8.6.11/8.6.6) id JAA12640 for current-outgoing; Wed, 23 Aug 1995 09:50:40 -0700 Received: from irz301.inf.tu-dresden.de (irz301.inf.tu-dresden.de [141.76.1.11]) by freefall.FreeBSD.org (8.6.11/8.6.6) with SMTP id JAA12633 for ; Wed, 23 Aug 1995 09:50:31 -0700 Received: from sax.sax.de by irz301.inf.tu-dresden.de with SMTP (5.67b+/DEC-Ultrix/4.3) id AA26237; Wed, 23 Aug 1995 18:48:06 +0200 Received: by sax.sax.de (8.6.11/8.6.12-s1) with UUCP id SAA19302 for current@freebsd.org; Wed, 23 Aug 1995 18:48:06 +0200 Received: (from j@localhost) by uriah.heep.sax.de (8.6.11/8.6.9) id SAA17655 for current@freebsd.org; Wed, 23 Aug 1995 18:25:46 +0200 From: J Wunsch Message-Id: <199508231625.SAA17655@uriah.heep.sax.de> Subject: Re: Recent mount patches.. To: current@freebsd.org Date: Wed, 23 Aug 1995 18:25:45 +0200 (MET DST) Reply-To: current@freebsd.org In-Reply-To: <6525.809182915@time.cdrom.com> from "Jordan K. Hubbard" at Aug 23, 95 06:01:55 am Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) X-Phone: +49-351-2012 669 X-Mailer: ELM [version 2.4 PL23] Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Content-Length: 1728 Sender: current-owner@freebsd.org Precedence: bulk As Jordan K. Hubbard wrote: > > You'll need to rebuild all your mount_foo execs due to the change in > mount.h. Just FYI. Ick. This should have been discussed before. > I decided to take the patch because I myself am tired of the system > refusing to come up just because I don't have a CD in the drive, yet > it's silly to have to type the whole mount command spec in as the > only alternative. See my other reply. And, btw, /usr/local/bin/do-mount: #!/usr/bin/suidperl # $ENV{'PATH'} = "/sbin:/usr/sbin:/bin:/usr/bin"; $cmd = "mount"; while($_ = $ARGV[0], /^-/) { shift; $verb=1, next if /^-v/ || /^-verbose/; $cmd = "umount", next if /^-u/ || /^-umount/; last if /^--/; &usage; } &usage unless $#ARGV == 0; if($ARGV[0] eq "od") { $type = "ufs"; $src = "/dev/od0a"; $dst = "/od"; } elsif($ARGV[0] eq "cd") { $type = "cd9660"; $src = "/dev/cd0a"; $dst = "/cd"; } elsif ($ARGV[0] eq "dos") { $type = "msdosfs"; $src = "/dev/fd0"; $dst = "/dos"; } elsif ($ARGV[0] =~ "^fd[0-9][.0-9]*") { $type = "msdosfs"; $src = "/dev/$ARGV[0]"; $dst = "/dos"; } else { &usage; } print "gonna $cmd $src " . ($cmd eq "mount"? "to": "from") . " $dst, type $type\n" if $verb; if($cmd eq "mount") {exec "/sbin/mount", "-t", $type, $src, $dst;} else {exec "/sbin/umount", $dst;} sub usage { die "usage: do-mount [-v[erbose]] [-u[mount]] cd|dos|fd*\n"; } Make it setuid root and simply say ``do-mount cd'' or ``do-mount -u cd''. Don't need to be root. (Yeah, i know, it has security holes. The drives should be mounted noexec,nosuid.) -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ Never trust an operating system you don't have sources for. ;-)