Merge "Check dir path before updating permissions." into sc-v2-dev