Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

by flexvault (Parson)
on Aug 21, 2012 at 13:52 UTC ( #988737=note: print w/ replies, xml ) Need Help??


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

sanbiswa,

    Due to the huge number of platforms I have to support...

At one time some *nix versions allowed you to 'chmod a+x-r-x YourScript.plx' and the script could execute, but someone couldn't copy it, modify it or delete it. I think the 'user:group' had to be 'bin:bin'. It may not work with your platforms, but you could try it.

Your problem is not a technical one, but a management problem!

Have you mentioned this to the manager(s) of the problem user(s).

Why do they want to allow this?

Good Luck! You need it...Ed

"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?
Re^2: How to ensure that a supported version of my script is being executed?
by taint (Chaplain) on Aug 21, 2012 at 17:58 UTC
    Greetings, I'm not sure what kind of an environment you are working in. But you should have little difficulty controlling who uses your script(s), and from where.
    For example, you could prevent exec(ing) based on an eval as to where the posted || query is comming from ( $local || $remote), or even from where the script has been exec(ed) within the system itself (get $pwd || $cwd). This is a farily trivial matter. You could perfom the eval(s) from within the script, or, if Apache for example, within the server itself. Example:
    Create a var(iable) : $ENV{SERVER_NAME};
    create a Condition : unless (defined($ENV{SERVER_NAME}) == mydomain.tld, die "goto h3ll";
    Problem solved. :)
    Best wishes.
    --Chris
    #!/usr/bin/perl -Tw
    use perl::always;
    my $perl_version = "5.12.4";
    print $perl_version;

      taint,

      Don't know it you meant your comment for me or for the OP's original question, but the OP did state that the 'person(s)' know(s) Perl, and can delete/modify code that tests for the correct script. A simple '#" in front of your code would defeat the test.

      It's still a management problem.

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

        Greetings, It was intended for the OP (I apparently missed the "they can re-write" his script part). :P
        In response to your post; Right you are -- chown opuid:opgid ./opscript-name; chmod 0744 ./opscript-name (op prefix meaning Original Poster). :)
        --Chris
        #!/usr/bin/perl -Tw
        use perl::always;
        my $perl_version = "5.12.4";
        print $perl_version;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://988737]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (11)
As of 2014-09-17 18:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (93 votes), past polls