only call exec() if allowed to
Merge pull request #10022 from owncloud/fix-exec-admin-master

only call exec() if allowed to