Fix for 777 vulnerability in domains

A fix for 777 fs mode vulnerability when creating a domain.