Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Illegal Seek" problem in script.

Status
Not open for further replies.

nawlej

Programmer
Mar 26, 2004
380
US
Has anyone ever run into a problem when running a command inside of a script where an "Illegal Seek" error is generated? A little background:

-The command is using sudo. It asks for my sudo password before it runs, but returns as an illegal seek.

-When i run the command from the command line, it executes just fine.

-Subsequent attempts to run the script generate the same error, even after the user is considered "trusted" and doesnt have to enter a password any longer.

Any help would be greatly appreciated as always. Ive gone through 6 cans of Jolt trying to figure it out.
 
You're syaing it runs fine from the command line, but not from ... a browser session?

If this is the case it's probably because the web user doesn't have sufficient privs to run sudo, and that's not a bad idea from a security standpoint.

[whatever sudo is]

Could you write a script that runs as a daemon almost that can recieve calls from the script, and act on those

Just a thought

--Paul
 
Isn't there a priv flag as to whether a user can use sudo or not?

--Paul
 
Hi nawlej,

Can you identify which part of the script is generating the error?

Mike

"Deliver me from the bane of civilised life; teddy bear envy."

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

 
Ok, I got it fixed. Just for clarification.....This isnt a CGI script. I built out a function to run the command in the shell, and grabs the output in the form of an array. After which, if the command does not execute properly, I had it built to return the error it recieved into the array. If was checking it in the form of if(@output<0){}

It works beautifully, until I run commands when the command that runs does not return output by default, in which case, it would always return an error because it met the error checking condition. Upon querying the shell for the error, thats where the "Illegal Seek" message came from. I was trying to query a null output. To fix it, I just ran the non output commands with the system() function. The scripts runs like a dream now. Thanks for all of your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top