From owner-freebsd-questions Thu Mar 23 22: 1:22 2000 Delivered-To: freebsd-questions@freebsd.org Received: from mercury.is.co.za (mercury.is.co.za [196.4.160.222]) by hub.freebsd.org (Postfix) with ESMTP id BE33C37C5D9 for ; Thu, 23 Mar 2000 22:01:14 -0800 (PST) (envelope-from marcs@draenor.org) Received: from admin.is.co.za (admin.is.co.za [196.23.0.9]) by mercury.is.co.za (8.9.3/8.9.3) with ESMTP id IAA04561; Fri, 24 Mar 2000 08:01:08 +0200 Received: from gizmo.is.co.za (gizmo.is.co.za [196.23.0.47]) by admin.is.co.za (8.8.6/8.7.3/ISsubsidiary#1) with ESMTP id IAA11037; Fri, 24 Mar 2000 08:01:07 +0200 (GMT) Received: by gizmo.is.co.za (Postfix, from userid 1332) id 73798152; Fri, 24 Mar 2000 08:02:03 +0200 (SAST) Date: Fri, 24 Mar 2000 08:02:03 +0200 From: Marc Silver To: matteotti Cc: freebsd-questions@freebsd.org Subject: Re: mounting floppies and cd's Message-ID: <20000324080203.F59219@draenor.org> References: <38D9F4A1.997811ED@bluewin.ch> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="qlTNgmc+xy1dBmNv" X-Mailer: Mutt 1.0.1i In-Reply-To: <38D9F4A1.997811ED@bluewin.ch>; from carloma@bluewin.ch on Thu, Mar 23, 2000 at 11:40:33AM +0100 X-Operating-System: FreeBSD 4.0-RELEASE Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --qlTNgmc+xy1dBmNv Content-Type: text/plain; charset=us-ascii Hey there, As far as I know there isn't something like this in FreeBSD. However, please find attached a short c program written by Omachonu Ogali that allows normal users to mount the cdrom (you can obviously modify it to mount the floppy as well). To install it, simply do the following: (as root) cc -o sucd sucd.c chmod 4555 sucd mv sucd /usr/local/bin What you're doing there is setting the binary as setuid which allows people to execute it as root, and allows them to mount/unmount the CD. Hope this helps. Cheers, Marc On Thu, Mar 23, 2000 at 11:40:33AM +0100, matteotti wrote: > Friends, > > I am trying to set up /etc/fstab such that it be possible to mount > floppies and cdroms as normal user (not root). > > I tried the same option flags as I have under Linux. i.e. > /dev/fd0 /floppy msdos user,noauto,rw (some more) 0 0 > ^^^^^ > > When I try to mount a floppy as normal user there is the followin error > message > > mount -o: user option not supported :-( > (the same for cdrom) > > Has anybody solved the 'problem' or an idea to solve it ? > > Thanks in advance: > Carlo. > > OS: FreeBSD3.2 > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > --qlTNgmc+xy1dBmNv Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="sucd.c" /* * suCD 0.1 * -------- * Allows regular (non-root) users to mount the cdrom * - Omachonu Ogali */ #include #include #include #include int main(int argc, char **argv) { printf("suCD 0.1\n"); printf("oogali@tribune.intranova.net\n\n"); if (getuid() != 0) { if (seteuid(0) != 0) { perror("seteuid()"); return -1; } } if (argc < 2) { system("/sbin/mount /cdrom"); } else { if (strcmp(argv[1], "mount") == 0) { system("/sbin/mount /cdrom"); } else if (strcmp(argv[1], "unmount") == 0) { system("/sbin/umount /cdrom"); } else { printf("%s [action]\n"); printf("[action] may be either 'mount' or 'unmount'.\n"); return -1; } } return 0; } --qlTNgmc+xy1dBmNv-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message