From owner-freebsd-hackers Wed Jul 2 17:21:46 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id RAA03448 for hackers-outgoing; Wed, 2 Jul 1997 17:21:46 -0700 (PDT) Received: from whqvax.picker.com (whqvax.picker.com [144.54.1.1]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id RAA03440 for ; Wed, 2 Jul 1997 17:21:41 -0700 (PDT) Received: from ct.picker.com by whqvax.picker.com with SMTP; Wed, 2 Jul 1997 20:21:10 -0400 (EDT) Received: from elmer.ct.picker.com ([144.54.57.34]) by ct.picker.com (4.1/SMI-4.1) id AA06134; Wed, 2 Jul 97 20:21:09 EDT Received: by elmer.ct.picker.com (SMI-8.6/SMI-SVR4) id UAA04829; Wed, 2 Jul 1997 20:19:25 -0400 Message-Id: <19970702201925.23792@ct.picker.com> Date: Wed, 2 Jul 1997 20:19:25 -0400 From: Randall Hopper To: hackers@freebsd.org Subject: suid "mountzip" -- UFS works but MSDOS doesn't (?) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.76 Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I have a suid perl script that I use to mount file systems on my ZIP drive (attached). It works fine for for UFS, but the MSDOS mount denies permission. Any ideas why? > mountzip /dev/sd0s1 on /zip: Incorrect super block. msdos: /dev/sd0s4: Permission denied Mount failed __________________________________________________________________________ > cat /opt/bin/mountzip # cat /opt/bin/mountzip #!/usr/bin/suidperl -w $ENV{'PATH'} = '/bin:/usr/bin:/usr/sbin:/sbin'; $ENV{'SHELL'} = '/bin/sh' if defined $ENV{'SHELL'}; $ENV{'IFS'} = '' if defined $ENV{'IFS'}; ( !system( "mount /zip" ) && print "/zip mounted\n" ) || ( !system( "mount /doszip" ) && print "/doszip mounted\n" ) || die "Mount failed\n"; __________________________________________________________________________ > ls -l /opt/bin/mountzip -rws--x--- 1 root wheel 326 May 4 09:34 /opt/bin/mountzip* > ls -l /sbin/mount /sbin/mount_msdos -r-xr-xr-x 1 bin bin 69632 Mar 25 14:42 /sbin/mount* -r-xr-xr-x 1 bin bin 139264 Mar 25 14:43 /sbin/mount_msdos* > grep zip /etc/fstab /dev/sd0s1 /zip ufs rw,noauto 0 0 /dev/sd0s4 /doszip msdos ro,noauto 0 0 > ls -l /dev/sd0s[14] brw-r----- 1 root operator 4, 0x00020002 May 5 19:36 /dev/sd0s1 brw-r----- 1 root operator 4, 0x00050002 May 5 19:36 /dev/sd0s4 > ls -ld /zip /doszip drwxr-xr-x 2 root wheel 512 May 5 19:44 /doszip/ drwxr-xr-x 2 root wheel 512 May 5 19:44 /zip/ BTW, this is on 2.2.1. Randall Hopper