aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeech Rintoul <beech@FreeBSD.org>2008-09-17 19:05:29 +0000
committerBeech Rintoul <beech@FreeBSD.org>2008-09-17 19:05:29 +0000
commit72dae412ba3be3a074c52d4eeb8aa751c343a808 (patch)
treee78689f8870a7b75ba11a326774a6c5c792e0c64
parenteed6489990b4836fc0d05c76f409006bb5872ceb (diff)
downloadports-72dae412ba3be3a074c52d4eeb8aa751c343a808.tar.gz
ports-72dae412ba3be3a074c52d4eeb8aa751c343a808.zip
- Fix user permissions on startup.
If a user defines login_user to be something other than 'dovecot' then dovecot will throw a warning upon startup.  The new code extracts what login_user is defined as and sets the directory permissions accordingly. If login_user is undefined in the config then it behaves the same as before. Submitted by: Yarema <yds@coolrat.org> (maintainer) Approved by: portmgr (linimon)
Notes
Notes: svn path=/head/; revision=220422
-rw-r--r--mail/dovecot/Makefile3
-rw-r--r--mail/dovecot/files/dovecot.sh.in7
2 files changed, 7 insertions, 3 deletions
diff --git a/mail/dovecot/Makefile b/mail/dovecot/Makefile
index cdda905efea0..10aa9c023025 100644
--- a/mail/dovecot/Makefile
+++ b/mail/dovecot/Makefile
@@ -7,7 +7,8 @@
#
PORTNAME= dovecot
-DISTVERSION= 1.1.3
+PORTVERSION= 1.1.3
+PORTREVISION= 1
CATEGORIES= mail ipv6
MASTER_SITES= http://www.dovecot.org/releases/1.1/
diff --git a/mail/dovecot/files/dovecot.sh.in b/mail/dovecot/files/dovecot.sh.in
index 17263cb5c4d5..25fb7281c054 100644
--- a/mail/dovecot/files/dovecot.sh.in
+++ b/mail/dovecot/files/dovecot.sh.in
@@ -28,9 +28,12 @@ extra_commands="restart"
dovecot_prestart()
{ # Ensure runtime directories exist with correct permissions
- base=/var/run/dovecot
+ local base user gid
+ base=/var/run/${name}
+ user=$(awk -F '[[:space:]]*=[[:space:]]*' '/^[[:space:]]*login_user[[:space:]]*=/ { print $2 }' ${required_files})
+ gid=$(pw usershow -n "${user:-${name}}" 2>/dev/null | cut -d: -f4)
/usr/bin/install -o root -g wheel -m 0755 -d ${base}
- /usr/bin/install -o root -g dovecot -m 0750 -d ${base}/login
+ /usr/bin/install -o root -g ${gid} -m 0750 -d ${base}/login
}
load_rc_config ${name}