On 4/7/10, Brian Candler <b.candler / pobox.com> wrote:
> Well, obviously you don't give setuid permissions to a file and then
> allow anyone to edit it :-) It would have to be stored in a trusted
> location. Ditto the path to the ruby interpreter itself.
>
> The C program could validate that the script lives in a trusted location
> (that only an administrator could modify). Or calculate an SHA1. Or

I believe that using a sha1 in this way would create a TOCTOU race
condition; in other words, it's not secure. Don't do that.