Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
* running a script with sudo
@ 2001-08-28 17:12 Bryan Dunn
  2001-08-29 19:16 ` Michael Heiming
  0 siblings, 1 reply; 2+ messages in thread
From: Bryan Dunn @ 2001-08-28 17:12 UTC (permalink / raw)


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             |
|________________________________|


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-08-29 19:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-08-28 17:12 running a script with sudo Bryan Dunn
2001-08-29 19:16 ` Michael Heiming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox