Fixing permissions a better way, thx crazy4chrissi, fixes #532

Signed-off-by: Florian Aders (EleRas) <eleras@froxlor.org>