Fixing up tmp_dir and event_kwargs
Make sure that tmp_dir is owned by sudo user
Fixing tmp logic
Merge pull request #8704 from techhat/tmpfixup

Fixing up tmp_dir and event_kwargs