Rob, The problem is in the permissions of the user id that is running the script, not the owner of the script. In this case, your webserver is the person running the script. So more than likely, you should use 'clearpq.cgi' to kick off a different script 'clearpl.pl' as ROOT. The script should contain the following...
use strict; I would suggest the following... - clearpg.cgi writes a 'properties file' that contains the 'printer' - clearpg.pl accepts NO ARGUMENTS, and reads the 'printer' name from the 'properties file'. - clearpg.pl should have a hash of accepted 'printer's. This hash could look like my $PrinterHash => { 'printer' => { 'name' => 'printer name', 'location' => 'full path to printer', 'clearcode' => 'full path to what ever' } } This is just an idea. Kristofer 2) --- Rob <[EMAIL PROTECTED]> wrote: > Hello, I've been trying to write a cgi script that will clear and > restart > the printers on our server. We have 3 printers that just give me > fits > running through a Linux server. I have no problem getting everything > back > up and running on the command line but when I go on vacation the > office > staff wont leave me alone and I have to log into the server from > where > ever I'm at and clear them. The steps that I've been trying to take > are > to move the print jobs to another directory on the server, then > restart > lpd. I'm using the file copy module but when it gets to this line it > fails with the following error message in the log: > > Insecure dependency in rename while running setuid at > /usr/lib/perl5/5.00503/File/Copy.pm line 156. > > The line in the script that causes this is: > move("/var/spool/lpd/$printer/[cd]f*", "$printer"); > > The permissions on the script are: > -rwsr-xr-x 1 root root 1312 Jun 26 08:21 clearpq.cgi > > I know it's probably not good to run a cgi script with suid root but > I > think that would be better then giving the Secretarys root access to > the > server and having them delete files. The server is not connected to > the > Internet but is an internal machine. > > Any help on solving this problem would sure make my upcoming vacation > much > nicer ;^) > > -- > Rob > > Do not meddle in the affairs of wizards, > for they are subtle and quick to anger. > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > ===== -----BEGIN GEEK CODE BLOCK----- Version: 3.12 GIT d s+:++ a C++ UL++ US+ P+++ L++ W+++ w PS PE t++ b+ G e r+++ z++++ ------END GEEK CODE BLOCK------ __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]