Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: How to ensure that a supported version of my script is being executed?

by flexvault (Monsignor)
on Aug 21, 2012 at 20:51 UTC ( #988861=note: print w/replies, xml ) Need Help??

in reply to How to ensure that a supported version of my script is being executed?


Since I was brought back into this and since for the moment I'll assume that management wouldn't help you, because they think it's cute to corrupt an Oracle database. Here's a non fool proof idea.

First, you have to nullify all existing copies of your code, good and bad, and then the good code must be read-only to all users (including you). If you need to update the script, then you have to delete it, and then copy a new version, and then make it read-only. You also have to change the way you call Oracle so that your old scripts don't work any more. (hint: change password, change Table name, etc.)

Now write your 'C' program to verify the exact Perl script by not allowing it to be a symbolic link and that MD5 or SHA1 is correct. What I suggest is to read the Perl script into memory and add 50+ characters of non-printable data to it and then verify the MD5/SHA1 of that. If it fails then abort. Obviously the 'C' program must know the valid MD5/SHA1 value, but you can split the MD5/SHA1 into parts and resemble in memory, plus make the 'C' executable at least 100K in size. Now have the C executable write the script to an unique location with a unique name and then have the C program execute your script from there.

It will help, but if someone is determined...

If the 'C' program works, then you can update you Perl scripts and distribute them to happy users. We can hope!

This may help you if your problem user(s) doesn't want to spend a few days figuring out what you have done, but if s/he's good and persistent...

Plan B..Z is find a better job with better management :-)

Good Luck!

"Well done is better than well said." - Benjamin Franklin

  • Comment on Re: How to ensure that a supported version of my script is being executed?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://988861]
[perldigious]: Just kidding. Thanks 1nickt, I'll go ahead and do it the right way. An extra set of brackets and a little extra indentation isn't too much to ask.
[karlgoethebier]: perldigious: perhaps a block if you are paranoid ;-)
[choroba]: but undef %hash and %hash = () both work, too, but the first one keeps the memory allocated, while the latter makes it available for other parts of the program.
[choroba]: iirc
[perldigious]: karlgoethebier: Well it is a pretty old and complicated (for me) bit of code I wrote (poorly by my current standards), so I'm expecting everything to break when I add the scoping and find out what else is undesireably scope changed. :-)
[perldigious]: Ah, thanks choroba, that sort of thing was precisely what I was wondering when I asked.
[perldigious]: I didn't want to tie up memory unecessarily basically, I wanted to "delete" it specifically to free it up, and wasn't sure I was even accomplishing that.

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2017-07-21 19:51 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (335 votes). Check out past polls.