dovecot/dovecot.patch

Mon, 20 Apr 2009 19:22:00 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 20 Apr 2009 19:22:00 +0200
changeset 178
0ba300bdf30a
parent 148
f6edc24e328f
child 187
0cbfb8a2de97
permissions
-rw-r--r--

Change unfortunate but partly useful overreaching security tradeoff.
The principle of allocating each running process an individual system
user and group can have security benefits, however maintining a plethora
of users, groups, processes, file modes, file permissions, and even
nonportable file ACLs on a host serving from a hundred processes has
some security disadvantages. This tradeoff is even worse for systems
like OpenPKG which benefit from administration transparency through the
use of minimal system intrusion and only three usage privilege levels.

michael@148 1 Index: configure.in
michael@148 2 --- configure.in.orig 2009-03-13 23:06:16 +0100
michael@148 3 +++ configure.in 2009-03-14 09:11:12 +0100
michael@148 4 @@ -1962,14 +1962,14 @@
michael@148 5
michael@148 6 if test $want_pgsql != no; then
michael@148 7 # based on code from PHP
michael@148 8 - for i in /usr /usr/local /usr/local/pgsql; do
michael@148 9 - for j in include include/pgsql include/postgres include/postgresql ""; do
michael@148 10 + for i in @l_prefix@; do
michael@148 11 + for j in include/postgresql; do
michael@148 12 if test -r "$i/$j/libpq-fe.h"; then
michael@148 13 PGSQL_INCLUDE=$i/$j
michael@148 14 fi
michael@148 15 done
michael@148 16 - for lib in lib lib64; do
michael@148 17 - for j in $lib $lib/pgsql $lib/postgres $lib/postgresql ""; do
michael@148 18 + for lib in lib; do
michael@148 19 + for j in $lib; do
michael@148 20 if test -f "$i/$j/libpq.so" || test -f "$i/$j/libpq.a"; then
michael@148 21 PGSQL_LIBDIR=$i/$j
michael@148 22 fi
michael@148 23 Index: configure
michael@148 24 --- configure.orig 2009-03-13 23:06:32 +0100
michael@148 25 +++ configure 2009-03-14 09:11:12 +0100
michael@148 26 @@ -27966,14 +27966,14 @@
michael@148 27
michael@148 28 if test $want_pgsql != no; then
michael@148 29 # based on code from PHP
michael@148 30 - for i in /usr /usr/local /usr/local/pgsql; do
michael@148 31 - for j in include include/pgsql include/postgres include/postgresql ""; do
michael@148 32 + for i in @l_prefix@; do
michael@148 33 + for j in include/postgresql; do
michael@148 34 if test -r "$i/$j/libpq-fe.h"; then
michael@148 35 PGSQL_INCLUDE=$i/$j
michael@148 36 fi
michael@148 37 done
michael@148 38 - for lib in lib lib64; do
michael@148 39 - for j in $lib $lib/pgsql $lib/postgres $lib/postgresql ""; do
michael@148 40 + for lib in lib; do
michael@148 41 + for j in $lib; do
michael@148 42 if test -f "$i/$j/libpq.so" || test -f "$i/$j/libpq.a"; then
michael@148 43 PGSQL_LIBDIR=$i/$j
michael@148 44 fi
michael@148 45 Index: doc/dovecot-sql-example.conf
michael@148 46 --- doc/dovecot-sql-example.conf.orig 2009-01-05 21:49:58 +0100
michael@148 47 +++ doc/dovecot-sql-example.conf 2009-03-14 09:11:12 +0100
michael@148 48 @@ -47,7 +47,8 @@
michael@148 49 # the default my.cnf location
michael@148 50 # option_group - Read options from the given group (default: client)
michael@148 51 #
michael@148 52 -# You can connect to UNIX sockets by using host: host=/var/run/mysql.sock
michael@148 53 +# You can connect to UNIX sockets by using host:
michael@148 54 +# host=@l_prefix@/var/mysql/mysql.sock
michael@148 55 # Note that currently you can't use spaces in parameters.
michael@148 56 #
michael@148 57 # MySQL supports multiple host parameters for load balancing / HA.
michael@148 58 @@ -58,7 +59,7 @@
michael@148 59 # Examples:
michael@148 60 # connect = host=192.168.1.1 dbname=users
michael@148 61 # connect = host=sql.example.com dbname=virtual user=virtual password=blarg
michael@148 62 -# connect = /etc/dovecot/authdb.sqlite
michael@148 63 +# connect = @l_prefix@/etc/dovecot/authdb.sqlite
michael@148 64 #
michael@148 65 #connect =
michael@148 66
michael@148 67 Index: dovecot-example.conf
michael@148 68 --- dovecot-example.conf.orig 2009-03-13 22:23:14 +0100
michael@148 69 +++ dovecot-example.conf 2009-03-14 09:12:40 +0100
michael@148 70 @@ -11,16 +11,14 @@
michael@148 71
michael@148 72 # Default values are shown for each setting, it's not required to uncomment
michael@148 73 # any of the lines. Exception to this are paths, they're just examples with
michael@148 74 -# the real defaults being based on configure options. The paths listed here
michael@148 75 -# are for configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
michael@148 76 -# --with-ssldir=/etc/ssl
michael@148 77 +# the real defaults being based on configure options.
michael@148 78
michael@148 79 # Base directory where to store runtime data.
michael@148 80 -#base_dir = /var/run/dovecot/
michael@148 81 +#base_dir = @l_prefix@/var/dovecot/run
michael@148 82
michael@148 83 # Protocols we want to be serving: imap imaps pop3 pop3s
michael@148 84 # If you only want to use dovecot-auth, you can set this to "none".
michael@148 85 -#protocols = imap imaps
michael@148 86 +#protocols = imap
michael@148 87
michael@148 88 # A space separated list of IP or host addresses where to listen in for
michael@148 89 # connections. "*" listens in all IPv4 interfaces. "[::]" listens in all IPv6
michael@148 90 @@ -38,7 +36,7 @@
michael@148 91 # listen = *:10100
michael@148 92 # ..
michael@148 93 # }
michael@148 94 -#listen = *
michael@148 95 +#listen = 127.0.0.1
michael@148 96
michael@148 97 # Disable LOGIN command and all other plaintext authentications unless
michael@148 98 # SSL/TLS is used (LOGINDISABLED capability). Note that if the remote IP
michael@148 99 @@ -82,17 +80,17 @@
michael@148 100 # IP or host address where to listen in for SSL connections. Remember to also
michael@148 101 # add imaps and/or pop3s to protocols setting. Defaults to same as "listen"
michael@148 102 # setting if not specified.
michael@148 103 -#ssl_listen =
michael@148 104 +#ssl_listen = 127.0.0.1
michael@148 105
michael@148 106 # Disable SSL/TLS support. <doc/wiki/SSL>
michael@148 107 -#ssl_disable = no
michael@148 108 +#ssl_disable = yes
michael@148 109
michael@148 110 # PEM encoded X.509 SSL/TLS certificate and private key. They're opened before
michael@148 111 # dropping root privileges, so keep the key file unreadable by anyone but
michael@148 112 # root. Included doc/mkcert.sh can be used to easily generate self-signed
michael@148 113 # certificate, just make sure to update the domains in dovecot-openssl.cnf
michael@148 114 -#ssl_cert_file = /etc/ssl/certs/dovecot.pem
michael@148 115 -#ssl_key_file = /etc/ssl/private/dovecot.pem
michael@148 116 +#ssl_cert_file = @l_prefix@/etc/dovecot/ssl/dovecot.crt
michael@148 117 +#ssl_key_file = @l_prefix@/etc/dovecot/ssl/dovecot.key
michael@148 118
michael@148 119 # If key file is password protected, give the password here. Alternatively
michael@148 120 # give it when starting dovecot with -p parameter. Since this file is often
michael@148 121 @@ -135,7 +133,7 @@
michael@148 122 # which login needs to be able to connect to. The sockets are created when
michael@148 123 # running as root, so you don't have to worry about permissions. Note that
michael@148 124 # everything in this directory is deleted when Dovecot is started.
michael@148 125 -#login_dir = /var/run/dovecot/login
michael@148 126 +#login_dir = @l_prefix@/var/dovecot/run/login
michael@148 127
michael@148 128 # chroot login process to the login_dir. Only reason not to do this is if you
michael@148 129 # wish to run the whole Dovecot without roots. <doc/wiki/Rootless.txt>
michael@148 130 @@ -145,7 +143,7 @@
michael@148 131 # and don't use it anywhere else. The user must also belong to a group where
michael@148 132 # only it has access, it's used to control access for authentication process.
michael@148 133 # Note that this user is NOT used to access mails. <doc/wiki/UserIds.txt>
michael@148 134 -#login_user = dovecot
michael@148 135 +#login_user = @l_musr@
michael@148 136
michael@148 137 # Set max. process size in megabytes. If you don't use
michael@148 138 # login_process_per_connection you might need to grow this.
michael@148 139 @@ -503,7 +501,7 @@
michael@148 140
michael@148 141 protocol imap {
michael@148 142 # Login executable location.
michael@148 143 - #login_executable = /usr/libexec/dovecot/imap-login
michael@148 144 + #login_executable = @l_prefix@/libexec/dovecot/imap-login
michael@148 145
michael@148 146 # IMAP executable location. Changing this allows you to execute other
michael@148 147 # binaries before the imap process is executed.
michael@148 148 @@ -515,7 +513,7 @@
michael@148 149 # /tmp/gdbhelper.* files:
michael@148 150 # mail_executable = /usr/libexec/dovecot/gdbhelper /usr/libexec/dovecot/imap
michael@148 151 #
michael@148 152 - #mail_executable = /usr/libexec/dovecot/imap
michael@148 153 + #mail_executable = @l_prefix@/libexec/dovecot/imap
michael@148 154
michael@148 155 # Maximum IMAP command line length in bytes. Some clients generate very long
michael@148 156 # command lines with huge mailboxes, so you may need to raise this if you get
michael@148 157 @@ -529,7 +527,7 @@
michael@148 158 # Support for dynamically loadable plugins. mail_plugins is a space separated
michael@148 159 # list of plugins to load.
michael@148 160 #mail_plugins =
michael@148 161 - #mail_plugin_dir = /usr/lib/dovecot/imap
michael@148 162 + #mail_plugin_dir = @l_prefix@/lib/dovecot/imap
michael@148 163
michael@148 164 # Send IMAP capabilities in greeting message. This makes it unnecessary for
michael@148 165 # clients to request it with CAPABILITY command, so it saves one round-trip.
michael@148 166 @@ -572,11 +570,11 @@
michael@148 167
michael@148 168 protocol pop3 {
michael@148 169 # Login executable location.
michael@148 170 - #login_executable = /usr/libexec/dovecot/pop3-login
michael@148 171 + #login_executable = @l_prefix@/libexec/dovecot/pop3-login
michael@148 172
michael@148 173 # POP3 executable location. See IMAP's mail_executable above for examples
michael@148 174 # how this could be changed.
michael@148 175 - #mail_executable = /usr/libexec/dovecot/pop3
michael@148 176 + #mail_executable = @l_prefix@/libexec/dovecot/pop3
michael@148 177
michael@148 178 # Don't try to set mails non-recent or seen with POP3 sessions. This is
michael@148 179 # mostly intended to reduce disk I/O. With maildir it doesn't move files
michael@148 180 @@ -636,7 +634,7 @@
michael@148 181 # Support for dynamically loadable plugins. mail_plugins is a space separated
michael@148 182 # list of plugins to load.
michael@148 183 #mail_plugins =
michael@148 184 - #mail_plugin_dir = /usr/lib/dovecot/pop3
michael@148 185 + #mail_plugin_dir = @l_prefix@/lib/dovecot/pop3
michael@148 186
michael@148 187 # Workarounds for various client bugs:
michael@148 188 # outlook-no-nuls:
michael@148 189 @@ -664,7 +662,7 @@
michael@148 190 # Support for dynamically loadable plugins. mail_plugins is a space separated
michael@148 191 # list of plugins to load.
michael@148 192 #mail_plugins =
michael@148 193 - #mail_plugin_dir = /usr/lib/dovecot/lda
michael@148 194 + #mail_plugin_dir = @l_prefix@/lib/dovecot/lda
michael@148 195
michael@148 196 # If user is over quota, return with temporary failure instead of
michael@148 197 # bouncing the mail.
michael@148 198 @@ -678,7 +676,7 @@
michael@148 199 #deliver_log_format = msgid=%m: %$
michael@148 200
michael@148 201 # Binary to use for sending mails.
michael@148 202 - #sendmail_path = /usr/lib/sendmail
michael@148 203 + #sendmail_path = @l_prefix@/sbin/sendmail
michael@148 204
michael@148 205 # Subject: header to use for rejection mails. You can use the same variables
michael@148 206 # as for rejection_reason below.
michael@148 207 @@ -689,7 +687,7 @@
michael@148 208 #rejection_reason = Your message to <%t> was automatically rejected:%n%r
michael@148 209
michael@148 210 # UNIX socket path to master authentication server to find users.
michael@148 211 - #auth_socket_path = /var/run/dovecot/auth-master
michael@148 212 + #auth_socket_path = @l_prefix@/var/dovecot/run/auth-master
michael@148 213 }
michael@148 214
michael@148 215 ##
michael@148 216 @@ -697,7 +695,7 @@
michael@148 217 ##
michael@148 218
michael@148 219 # Executable location
michael@148 220 -#auth_executable = /usr/libexec/dovecot/dovecot-auth
michael@148 221 +#auth_executable = @l_prefix@/libexec/dovecot/dovecot-auth
michael@148 222
michael@148 223 # Set max. process size in megabytes.
michael@148 224 #auth_process_size = 256
michael@148 225 @@ -787,7 +785,7 @@
michael@148 226 #auth_ntlm_use_winbind = no
michael@148 227
michael@148 228 # Path for Samba's ntlm_auth helper binary.
michael@148 229 -#auth_winbind_helper_path = /usr/bin/ntlm_auth
michael@148 230 +#auth_winbind_helper_path = @l_prefix@/bin/ntlm_auth
michael@148 231
michael@148 232 # Number of seconds to delay before replying to failed authentications.
michael@148 233 #auth_failure_delay = 2
michael@148 234 @@ -820,7 +818,7 @@
michael@148 235
michael@148 236 #passdb passwd-file {
michael@148 237 # File contains a list of usernames, one per line
michael@148 238 - #args = /etc/dovecot.deny
michael@148 239 + #args = @l_prefix@/etc/dovecot/dovecot.deny
michael@148 240 #deny = yes
michael@148 241 #}
michael@148 242
michael@148 243 @@ -903,13 +901,13 @@
michael@148 244 # SQL database <doc/wiki/AuthDatabase.SQL.txt>
michael@148 245 #passdb sql {
michael@148 246 # Path for SQL configuration file, see doc/dovecot-sql-example.conf
michael@148 247 - #args =
michael@148 248 + #args = @l_prefix@/etc/dovecot/dovecot-sql.conf
michael@148 249 #}
michael@148 250
michael@148 251 # LDAP database <doc/wiki/AuthDatabase.LDAP.txt>
michael@148 252 #passdb ldap {
michael@148 253 # Path for LDAP configuration file, see doc/dovecot-ldap-example.conf
michael@148 254 - #args =
michael@148 255 + #args = @l_prefix@/etc/dovecot/dovecot-ldap.conf
michael@148 256 #}
michael@148 257
michael@148 258 # vpopmail authentication <doc/wiki/AuthDatabase.VPopMail.txt>
michael@148 259 @@ -974,13 +972,13 @@
michael@148 260 # SQL database <doc/wiki/AuthDatabase.SQL.txt>
michael@148 261 #userdb sql {
michael@148 262 # Path for SQL configuration file, see doc/dovecot-sql-example.conf
michael@148 263 - #args =
michael@148 264 + #args = @l_prefix@/etc/dovecot/dovecot-sql.conf
michael@148 265 #}
michael@148 266
michael@148 267 # LDAP database <doc/wiki/AuthDatabase.LDAP.txt>
michael@148 268 #userdb ldap {
michael@148 269 # Path for LDAP configuration file, see doc/dovecot-ldap-example.conf
michael@148 270 - #args =
michael@148 271 + #args = @l_prefix@/etc/dovecot/dovecot-ldap.conf
michael@148 272 #}
michael@148 273
michael@148 274 # vpopmail <doc/wiki/AuthDatabase.VPopMail.txt>
michael@148 275 @@ -1017,7 +1015,7 @@
michael@148 276 # Master socket provides access to userdb information. It's typically
michael@148 277 # used to give Dovecot's local delivery agent access to userdb so it
michael@148 278 # can find mailbox locations.
michael@148 279 - #path = /var/run/dovecot/auth-master
michael@168 280 + #path = @l_prefix@/var/dovecot/run/auth-master
michael@148 281 #mode = 0600
michael@148 282 # Default user/group is the one who started dovecot-auth (root)
michael@148 283 #user =
michael@148 284 @@ -1027,7 +1025,7 @@
michael@148 285 # The client socket is generally safe to export to everyone. Typical use
michael@148 286 # is to export it to your SMTP server so it can do SMTP AUTH lookups
michael@148 287 # using it.
michael@148 288 - #path = /var/run/dovecot/auth-client
michael@168 289 + #path = @l_prefix@/var/dovecot/run/auth-client
michael@148 290 #mode = 0660
michael@148 291 #}
michael@148 292 #}
michael@148 293 @@ -1041,7 +1039,7 @@
michael@148 294 #auth external {
michael@148 295 # socket connect {
michael@148 296 # master {
michael@148 297 -# path = /var/run/dovecot/auth-master
michael@148 298 +# path = @l_prefix@/dovecot/run/auth-master
michael@148 299 # }
michael@148 300 # }
michael@148 301 #}
michael@148 302 @@ -1057,8 +1055,8 @@
michael@148 303 # referenced using URIs in format "proxy::<name>".
michael@148 304
michael@148 305 dict {
michael@148 306 - #quota = mysql:/etc/dovecot-dict-quota.conf
michael@148 307 - #expire = db:/var/lib/dovecot/expire.db
michael@148 308 + #quota = mysql:@l_prefix@/etc/dovecot/dovecot-dict-quota.conf
michael@148 309 + #expire = db:@l_prefix@/var/dovecot/lib/expire.db
michael@148 310 }
michael@148 311
michael@148 312 # Path to Berkeley DB's configuration file. See doc/dovecot-db-example.conf
michael@148 313 @@ -1109,7 +1107,7 @@
michael@148 314 # one file for each mailbox, eg. INBOX or sub.mailbox. cache_secs parameter
michael@148 315 # specifies how many seconds to wait between stat()ing dovecot-acl file
michael@148 316 # to see if it changed.
michael@148 317 - #acl = vfile:/etc/dovecot-acls:cache_secs=300
michael@148 318 + #acl = vfile:@l_prefix@/etc/dovecot/dovecot-acls:cache_secs=300
michael@148 319
michael@148 320 # Convert plugin. If set, specifies the source storage path which is
michael@148 321 # converted to destination storage (mail_location) when the user logs in.
michael@148 322 @@ -1128,14 +1126,14 @@
michael@148 323 # until the message can be saved within quota limits. The configuration file
michael@148 324 # is a text file where each line is in format: <priority> <mailbox name>
michael@148 325 # Mails are first deleted in lowest -> highest priority number order
michael@148 326 - #trash = /etc/dovecot-trash.conf
michael@148 327 + #trash = @l_prefix@/etc/dovecot/dovecot-trash.conf
michael@148 328
michael@148 329 # Expire plugin. Mails are expunged from mailboxes after being there the
michael@148 330 # configurable time. The first expiration date for each mailbox is stored in
michael@148 331 # a dictionary so it can be quickly determined which mailboxes contain
michael@148 332 # expired mails. The actual expunging is done in a nightly cronjob, which
michael@148 333 # you must set up:
michael@148 334 - # dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool
michael@148 335 + # dovecot --exec-mail ext @l_prefix@/libexec/dovecot/expire-tool
michael@148 336 #expire = Trash 7 Spam 30
michael@148 337 #expire_dict = proxy::expire
michael@148 338
michael@148 339 Index: src/deliver/deliver.c
michael@148 340 --- src/deliver/deliver.c.orig 2009-02-27 00:31:13 +0100
michael@148 341 +++ src/deliver/deliver.c 2009-03-14 09:11:12 +0100
michael@148 342 @@ -41,7 +41,7 @@
michael@148 343 #include <syslog.h>
michael@148 344
michael@148 345 #define DEFAULT_CONFIG_FILE SYSCONFDIR"/dovecot.conf"
michael@148 346 -#define DEFAULT_SENDMAIL_PATH "/usr/lib/sendmail"
michael@148 347 +#define DEFAULT_SENDMAIL_PATH "@l_prefix@/sbin/sendmail"
michael@148 348 #define DEFAULT_ENVELOPE_SENDER "MAILER-DAEMON"
michael@148 349
michael@148 350 /* After buffer grows larger than this, create a temporary file to /tmp
michael@148 351 Index: src/master/master-settings.c
michael@148 352 --- src/master/master-settings.c.orig 2009-03-13 20:11:53 +0100
michael@148 353 +++ src/master/master-settings.c 2009-03-14 09:11:12 +0100
michael@148 354 @@ -178,14 +178,14 @@
michael@148 355 MEMBER(syslog_facility) "mail",
michael@148 356
michael@148 357 /* general */
michael@148 358 - MEMBER(protocols) "imap imaps",
michael@148 359 - MEMBER(listen) "*",
michael@148 360 - MEMBER(ssl_listen) "",
michael@148 361 + MEMBER(protocols) "imap",
michael@148 362 + MEMBER(listen) "127.0.0.1",
michael@148 363 + MEMBER(ssl_listen) "127.0.0.1",
michael@148 364
michael@148 365 - MEMBER(ssl_disable) FALSE,
michael@148 366 + MEMBER(ssl_disable) TRUE,
michael@148 367 MEMBER(ssl_ca_file) "",
michael@148 368 - MEMBER(ssl_cert_file) SSLDIR"/certs/dovecot.pem",
michael@148 369 - MEMBER(ssl_key_file) SSLDIR"/private/dovecot.pem",
michael@148 370 + MEMBER(ssl_cert_file) "@l_prefix@/etc/dovecot/ssl/dovecot.crt",
michael@148 371 + MEMBER(ssl_key_file) "@l_prefix@/etc/dovecot/ssl/dovecot.key",
michael@148 372 MEMBER(ssl_key_password) "",
michael@148 373 MEMBER(ssl_parameters_regenerate) 168,
michael@148 374 MEMBER(ssl_cipher_list) "",
michael@148 375 @@ -200,7 +200,7 @@
michael@148 376 /* login */
michael@148 377 MEMBER(login_dir) "login",
michael@148 378 MEMBER(login_executable) NULL,
michael@148 379 - MEMBER(login_user) "dovecot",
michael@148 380 + MEMBER(login_user) "@l_musr@",
michael@148 381 MEMBER(login_greeting) "Dovecot ready.",
michael@148 382 MEMBER(login_log_format_elements) "user=<%u> method=%m rip=%r lip=%l %c",
michael@148 383 MEMBER(login_log_format) "%$: %s",
michael@148 384 @@ -317,7 +317,7 @@
michael@148 385 MEMBER(anonymous_username) "anonymous",
michael@148 386 MEMBER(krb5_keytab) "",
michael@148 387 MEMBER(gssapi_hostname) "",
michael@148 388 - MEMBER(winbind_helper_path) "/usr/bin/ntlm_auth",
michael@148 389 + MEMBER(winbind_helper_path) "@l_prefix@/bin/ntlm_auth",
michael@148 390 MEMBER(failure_delay) 2,
michael@148 391
michael@148 392 MEMBER(verbose) FALSE,

mercurial