#!/bin/sh

set -e

# Let's fix the permissions for the /var/lib directory
chown -R www-data:www-data $BUGZILLA_DATADIR
chmod -R g+rw $BUGZILLA_DATADIR
chmod -R u+rw $BUGZILLA_DATADIR
chown -R www-data:www-data /etc/bugzilla3

# fix the permission for the contrib files
if [ -d /usr/share/bugzilla3/contrib ]; then
	find /usr/share/bugzilla3/contrib -name '*.pl' -exec chmod a+x {} \;
	find /usr/share/bugzilla3/contrib -name '*.sh' -exec chmod a+x {} \;
fi

exit 0
