From b6b73551dbbb3079f043920f21554b945fa4870e Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Sat, 13 Dec 2014 10:21:07 +0100 Subject: [PATCH] [IMP] Packaging: Debian, RedHat: No more superuser for odoo role only create db --- debian/postinst | 4 ++-- setup/redhat/postinstall.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/postinst b/debian/postinst index 2f8f18e813b..5126df0cf79 100644 --- a/debian/postinst +++ b/debian/postinst @@ -13,8 +13,8 @@ case "${1}" in if ! getent passwd | grep -q "^odoo:"; then adduser --system --home $ODOO_DATA_DIR --quiet --group $ODOO_USER fi - # Register "$ODOO_USER" as a postgres superuser - su - postgres -c "createuser -s $ODOO_USER" 2> /dev/null || true + # Register "$ODOO_USER" as a postgres user with "Create DB" role attribute + su - postgres -c "createuser -d -R -S $ODOO_USER" 2> /dev/null || true # Configuration file chown $ODOO_USER:$ODOO_GROUP $ODOO_CONFIGURATION_FILE chmod 0640 $ODOO_CONFIGURATION_FILE diff --git a/setup/redhat/postinstall.sh b/setup/redhat/postinstall.sh index 04ea928b13a..b9ef1f908e0 100644 --- a/setup/redhat/postinstall.sh +++ b/setup/redhat/postinstall.sh @@ -13,8 +13,8 @@ if ! getent passwd | grep -q "^odoo:"; then groupadd $ODOO_GROUP adduser --system --no-create-home $ODOO_USER -g $ODOO_GROUP fi -# Register "$ODOO_USER" as a postgres superuser -su - postgres -c "createuser -s $ODOO_USER" 2> /dev/null || true +# Register "$ODOO_USER" as a postgres user with "Create DB" role attribute +su - postgres -c "createuser -d -R -S $ODOO_USER" 2> /dev/null || true # Configuration file mkdir -p $ODOO_CONFIGURATION_DIR # can't copy debian config-file as addons_path is not the same