[Exherbo-dev] Do we really need addpredict?

David Leverton levertond at googlemail.com
Fri Aug 21 22:12:36 BST 2009

On Friday 21 August 2009 21:47:29 Ali Polatel wrote:
> cat >syd.hook <<EOF # Such hooks will usually end up in $FILES
> echo "Pid: $1"
> echo "System call name: $2"
> echo "Path that caused the access violation: $3"
> if [[ "$2" == open && "$3" == "/etc/passwd" ]]; then
>         exit 1 # Hook returning non-zero prevents the access violation
>                # from being raised. The access is _still_ denied though.
> fi
> chmod +x syd.hook
> sydboxcmd addhook "$(pwd)"/syd.hook # I'll probably add an addhook
>                                     # command, that's aliased to this.
> [run the stuff that raises the useless access violation here]
> sydboxcmd rmhook "$(pwd)"/syd.hook  # And an rmhook command as well.

Having to write a whole new file for this seems a bit excessive (especially 
for exlibs, which don't have a ${FILES} of their own.  Maybe there could be 
some sort of helper function that generates a simple hook in ${TEMP} and then 
adds it?

More information about the Exherbo-dev mailing list