From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,8885962f21daf92d,start X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2001-08-28 10:12:51 PST Path: archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!cpk-news-hub1.bbnplanet.com!nycmny1-snh1.gtei.net!cambridge1-snf1.gtei.net!news.gtei.net!bos-service1.ext.raytheon.com!bos-service2.ext.raytheon.com.POSTED!not-for-mail Message-ID: <3B8BD0F8.187AC11D@sels.rsc.raytheon.com> From: Bryan Dunn X-Mailer: Mozilla 4.77 [en] (X11; U; OSF1 V4.0 alpha) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.unix.tru64 Subject: running a script with sudo Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 28 Aug 2001 13:12:24 -0400 NNTP-Posting-Host: 138.125.34.28 X-Complaints-To: news@ext.ray.com X-Trace: bos-service2.ext.raytheon.com 999018716 138.125.34.28 (Tue, 28 Aug 2001 13:11:56 EDT) NNTP-Posting-Date: Tue, 28 Aug 2001 13:11:56 EDT Organization: Raytheon Company Xref: archiver1.google.com comp.unix.tru64:4447 Hi all, I am having trouble running a script with sudo permissions. I put a line in the sudoers file which looks like this: Cmnd_alias MOUNTCD = /usr/mount_dec_cd.pl then later on: username machine = MOUNTCD The script runs fine as root, but it will not work as the user. First, it can't use the command scu sho edt, and then produces other errors. What am I doing wrong? Here is the script itself: chomp ($Choice); if (($Choice ne "n")||($Choice ne "N")) { system "mkdir $Target"; } } $Output = readpipe ("scu sho edt|grep -e CD-ROM -e Read-Only"); system "echo $Output"; my @Scsiid; my $index=2; while($Output =~ /(\s\d)/g) { $Scsiid[$index] = $1; $index--; } print "The Scsi ID is {$Scsiid[2] $Scsiid[1]}\n"; my $rznum = 0; $rznum += $Scsiid[2] * 8; $rznum += $Scsiid[1] * 1; my $RawName = "rz${rznum}c"; print "The raw device name is $RawName\n"; system "mount -t cdfs -o ro /dev/$RawName $Target"; -- ________________________________ |Bryan Dunn | |Systems Administrator | |Raytheon Corporation | |E-Mail: bdunn@marmail.ed.ray.com| |Phone: 508-490-2948 | |Pager: 508-727-1054 | |________________________________|