From owner-freebsd-questions Mon Aug 14 6:19:14 2000 Delivered-To: freebsd-questions@freebsd.org Received: from draenor.org (draenor.org [196.36.119.129]) by hub.freebsd.org (Postfix) with ESMTP id C76C937B5B7 for ; Mon, 14 Aug 2000 06:19:03 -0700 (PDT) (envelope-from marcs@draenor.org) Received: from marcs by draenor.org with local (Exim 3.16 #1) id 13OK4k-000Gl8-00; Mon, 14 Aug 2000 15:14:46 +0200 Date: Mon, 14 Aug 2000 15:14:45 +0200 From: Marc Silver To: jan@ic.unicamp.br Cc: FreeBSD Questions Subject: Re: allow users to mount CD Message-ID: <20000814151445.C770@draenor.org> References: <20000813180747.C429@abstract.dhis.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="tqI+Z3u+9OQ7kwn0" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20000813180747.C429@abstract.dhis.net>; from janpf@iname.com on Sun, Aug 13, 2000 at 06:07:47PM -0300 X-Operating-System: FreeBSD 4.1-STABLE Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --tqI+Z3u+9OQ7kwn0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. I would warn against this. ONLY root should ever mount/unmount file systems, so unless you _really_ trust these users, I wouldn't allow this. Hope this helps. Cheers, Marc On Sun, Aug 13, 2000 at 06:07:47PM -0300, Jan Pfeifer wrote: > hi, > > How do I let users mount a CD, or any other mount point ? > > thanks, > > jan > > ps.: I tried the mount and fstab manpages to no avail > ps2.: I wanted to avoid to make a suid script to do this ... --tqI+Z3u+9OQ7kwn0 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; } --tqI+Z3u+9OQ7kwn0-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message