From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,1f0d79c5e542bace X-Google-Attributes: gid1164f8,public X-Google-Thread: fee84,1f0d79c5e542bace X-Google-Attributes: gidfee84,public From: lombardi emanuele Subject: Re: Allowing all users to mount CD ROM drive Date: 1998/06/01 Message-ID: <357272B4.41C6@mantegna.casaccia.enea.it>#1/1 X-Deja-AN: 358388949 Content-Transfer-Encoding: 7bit References: <356d7246.174897098@news.gov.on.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: ENEA Newsgroups: comp.sys.dec,comp.unix.osf.osf1 here follows a small C program wich allows normal users to mount CDs: Emanuele -- Emanuele Lombardi mail: AMB-GEM-CLIM ENEA Casaccia I-00060 S.M. di Galeria (RM) ITALY mailto:lele@mantegna.casaccia.enea.it tel +39 6 30483366 fax +39 6 30483591 /* monta.c Program to allow users to mount CDROM without the need to be root. Users can choose among a list of availabel devices (devs) the first of which is the default one See the section code referring the -h switch for the usage of monta. don't forget to chmod 4555 the executeble! by EMANUELE LOMBARDI lele@mantegna.casaccia.enea.it */ #include main(argc,argv,en) int argc; char *argv[]; char *en[]; { #define ARGS "o:ud:h" #define NDEVS 2 #define MAXNS 20 char *al[MAXNS] = NULL; char *devs[NDEVS],*dev; int umount,ns,i,c,okdev; extern int errno; setruid(0); devs[0]="/dev/rz5c"; /* default device*/ devs[1]="/dev/gd0c"; dev=devs[0]; al[0] = "/usr/sbin/mount"; al[1] = "-t"; al[2] = "cdfs"; al[3] = "-r" ; ns=4; umount=0; while (((c = getopt(argc, argv, ARGS)) != -1)) switch (c) { case 'd': okdev=0; for (i=0;i