From owner-freebsd-newbies Sun Jan 30 20:47:33 2000 Delivered-To: freebsd-newbies@freebsd.org Received: from hydrant.intranova.net (hydrant.intranova.net [209.201.95.10]) by hub.freebsd.org (Postfix) with SMTP id A192414C81 for ; Sun, 30 Jan 2000 20:47:23 -0800 (PST) (envelope-from oogali@intranova.net) Received: (qmail 38287 invoked from network); 30 Jan 2000 18:49:19 -0000 Received: from localhost (user92836@127.0.0.1) by hydrant.intranova.net with SMTP; 30 Jan 2000 18:49:19 -0000 Date: Sun, 30 Jan 2000 13:49:19 -0500 (EST) From: Omachonu Ogali To: freebsd-newbies@freebsd.org Subject: Re: mount /cdrom to be used by users In-Reply-To: <3892521C.DF58D4C6@acuson.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-newbies@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Oops, there was a little syntax error. Try this one: /* * 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; } Compile: cc -o sucd sucd.c Install: install -g wheel -m 4755 -o root sucd /usr/local/sbin Run As: 'sucd mount' to mount /cdrom 'sucd unmount' to unmount /cdrom Omachonu Ogali Intranova Networking Group To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-newbies" in the body of the message