in reply to CGI valid header error

exec never returns to the calling process however you should be able to just use chmod without any sort of system call.