[Dovecot] Segfault in ACL Plugin + user shared folders

Markus Werner markiwer at googlemail.com
Wed Apr 8 00:01:07 EEST 2009


Hi Timo,

I have another problem, this time with user shared folders:

User "markus" shared the folder "ForTest" to test:

SETACL "INBOX/ForTest" test akxeilrwts

dovecot-acl and shared-mailboxes.db have been successfully updated.

As user "test" the folder (and "#User" namespace) is not visible.
When I configure the shared namespace with "list = yes", the namespace
and folder became visible and accessible, but lines like this are logged:

Apr  7 22:08:58 asterix dovecot: IMAP(test): acl vfile: reading file /var/spool/dovecot/users/test/Maildir/.Shared/dovecot-acl
Apr  7 22:09:03 asterix dovecot: IMAP(test): Invalid namespace prefix %u/ vs %
Apr  7 22:09:03 asterix dovecot: IMAP(test): auth input: uid=2000
Apr  7 22:09:03 asterix dovecot: IMAP(test): auth input: gid=2000
Apr  7 22:09:03 asterix dovecot: IMAP(test): auth input: home=/var/spool/dovecot/users/markus
Apr  7 22:09:03 asterix dovecot: IMAP(test): maildir: data=/var/spool/dovecot/users/markus/Maildir:INDEX=~/Maildir/index/shared/markus
Apr  7 22:09:03 asterix dovecot: IMAP(test): maildir++: root=/var/spool/dovecot/users/markus/Maildir, index=/var/spool/dovecot/users/markus/Maildir, index=/var/spool/dovecot/users/test/Maildir/index/shared/markus, control=, inbox=/var/spool/dovecot/users/markus/Maildir
Apr  7 22:09:03 asterix dovecot: IMAP(test): acl: initializing backend with data: vfile
Apr  7 22:09:03 asterix dovecot: IMAP(test): acl: acl username = test
Apr  7 22:09:03 asterix dovecot: IMAP(test): acl: owner = 0
Apr  7 22:09:03 asterix dovecot: IMAP(test): acl vfile: Global ACL directory: (null)
Apr  7 22:09:03 asterix dovecot: IMAP(test): acl vfile: reading file /var/spool/dovecot/users/markus/Maildir/.ForTest/dovecot-acl
Apr  7 22:09:08 asterix dovecot: IMAP(test): Invalid namespace prefix %u/ vs markus


When I try to access the folder directly with "list = children" set, then
dovecot segfaults. Last lines in logfile:

Apr  7 22:28:04 asterix dovecot: IMAP(test): acl: initializing backend with data: vfile
Apr  7 22:28:04 asterix dovecot: IMAP(test): acl: acl username = test
Apr  7 22:28:04 asterix dovecot: IMAP(test): acl: owner = 0
Apr  7 22:28:04 asterix dovecot: IMAP(test): acl vfile: Global ACL directory: (null)
Apr  7 22:28:04 asterix dovecot: child 5441 (imap) killed with signal 11 (core dumped)


The backtrace looks like the one I got with your first quota fix, but
quota works now and this error is reproducible with or without the quota
plugin:


GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /lib/i686/cmov/libdl.so.2...done.
Loaded symbols for /lib/i686/cmov/libdl.so.2
Reading symbols from /lib/i686/cmov/libc.so.6...done.
Loaded symbols for /lib/i686/cmov/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /opt/dovecot/lib/dovecot/imap/lib01_acl_plugin.so...done.
Loaded symbols for /opt/dovecot/lib/dovecot/imap/lib01_acl_plugin.so
Reading symbols from /opt/dovecot/lib/dovecot/imap/lib02_imap_acl_plugin.so...done.
Loaded symbols for /opt/dovecot/lib/dovecot/imap/lib02_imap_acl_plugin.so
Reading symbols from /opt/dovecot/lib/dovecot/imap/lib10_quota_plugin.so...done.
Loaded symbols for /opt/dovecot/lib/dovecot/imap/lib10_quota_plugin.so
Reading symbols from /opt/dovecot/lib/dovecot/imap/lib11_imap_quota_plugin.so...done.
Loaded symbols for /opt/dovecot/lib/dovecot/imap/lib11_imap_quota_plugin.so
Reading symbols from /opt/dovecot/lib/dovecot/imap/lib20_fts_plugin.so...done.
Loaded symbols for /opt/dovecot/lib/dovecot/imap/lib20_fts_plugin.so
Reading symbols from /opt/dovecot/lib/dovecot/imap/lib21_fts_squat_plugin.so...done.
Loaded symbols for /opt/dovecot/lib/dovecot/imap/lib21_fts_squat_plugin.so
Reading symbols from /lib/i686/cmov/libnss_compat.so.2...done.
Loaded symbols for /lib/i686/cmov/libnss_compat.so.2
Reading symbols from /lib/i686/cmov/libnsl.so.1...done.
Loaded symbols for /lib/i686/cmov/libnsl.so.1
Reading symbols from /lib/i686/cmov/libnss_nis.so.2...done.
Loaded symbols for /lib/i686/cmov/libnss_nis.so.2
Reading symbols from /lib/i686/cmov/libnss_files.so.2...done.
Loaded symbols for /lib/i686/cmov/libnss_files.so.2
Core was generated by `imap'.
Program terminated with signal 11, Segmentation fault.
[New process 5441]
#0  0xb7ee43f1 in acl_mailbox_get_aclobj (box=0x8693488) at acl-mailbox.c:49
49              struct acl_mailbox *abox = ACL_CONTEXT(box);
(gdb) bt full
#0  0xb7ee43f1 in acl_mailbox_get_aclobj (box=0x8693488) at acl-mailbox.c:49
No locals.
#1  0xb7d77c89 in cmd_myrights (cmd=0x8658b90) at imap-acl-plugin.c:305
        storage = (struct mail_storage *) 0x8666af8
        box = (struct mailbox *) 0x8693488
        mailbox = 0x865dc98 "#User/markus/ForTest"
        real_mailbox = 0x865dc9e "markus/ForTest"
        rights = <value optimized out>
        str = <value optimized out>
#2  0x0806700c in client_command_input (cmd=0x8658b90) at client.c:603
        client = (struct client *) 0x8658900
        command = <value optimized out>
        __PRETTY_FUNCTION__ = "client_command_input"
#3  0x080670a9 in client_command_input (cmd=0x8658b90) at client.c:652
        client = (struct client *) 0x8658900
        command = <value optimized out>
        __PRETTY_FUNCTION__ = "client_command_input"
#4  0x080676ed in client_handle_input (client=0x8658900) at client.c:693
        _data_stack_cur_id = 3
        ret = <value optimized out>
        remove_io = <value optimized out>
        handled_commands = true
#5  0x08067ba3 in client_input (client=0x8658900) at client.c:748
        cmd = <value optimized out>
        output = (struct ostream *) 0x8658ab4
        bytes = <value optimized out>
        __PRETTY_FUNCTION__ = "client_input"
#6  0x080f73f0 in io_loop_handler_run (ioloop=0x8651af0) at ioloop-epoll.c:208
        ctx = (struct ioloop_handler_context *) 0x8651bf8
        event = (const struct epoll_event *) 0x8651c38
        list = (struct io_list *) 0x8658b38
        io = (struct io_file *) 0x8658b10
        tv = {tv_sec = 4, tv_usec = 999783}
        t_id = 2
        msecs = <value optimized out>
        ret = 1
        i = 0
        j = 0
        call = <value optimized out>
#7  0x080f6880 in io_loop_run (ioloop=0x8651af0) at ioloop.c:338
No locals.
#8  0x080704c5 in main (argc=Cannot access memory at address 0xc
) at main.c:320
No locals.




# 1.2.rc2: /opt/dovecot/etc/dovecot.conf
# OS: Linux 2.6.26-1-686 i686 Debian 5.0
base_dir: /var/run/dovecot
protocols: imap pop3
listen: 127.0.0.1,192.168.128.151
ssl_listen: 192.168.128.151
ssl_ca_file: /opt/dovecot/etc/certs/cacert.pem
ssl_cert_file: /opt/dovecot/etc/certs/asterixCert.pem
ssl_key_file: /opt/dovecot/etc/certs/asterixKey.pem
ssl_parameters_regenerate: 0
ssl_cipher_list: ALL:!LOW:!SSLv2
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable(default): /opt/dovecot/libexec/dovecot/imap-login
login_executable(imap): /opt/dovecot/libexec/dovecot/imap-login
login_executable(pop3): /opt/dovecot/libexec/dovecot/pop3-login
login_user: dovecotl
login_process_per_connection: no
login_processes_count: 1
login_max_processes_count: 3
max_mail_processes: 100
mail_max_userip_connections: 8
first_valid_uid: 2000
last_valid_uid: 2000
first_valid_gid: 2000
last_valid_gid: 2000
mail_access_groups: dovecot
mail_uid: 2000
mail_gid: 2000
mail_location: maildir:~/Maildir
mail_debug(default): yes
mail_debug(imap): yes
mail_debug(pop3): no
mail_executable(default): /opt/dovecot/libexec/dovecot/imap
mail_executable(imap): /opt/dovecot/libexec/dovecot/imap
mail_executable(pop3): /opt/dovecot/libexec/dovecot/pop3
mail_plugins(default): quota imap_quota acl imap_acl fts fts_squat
mail_plugins(imap): quota imap_quota acl imap_acl fts fts_squat
mail_plugins(pop3):
mail_plugin_dir(default): /opt/dovecot/lib/dovecot/imap
mail_plugin_dir(imap): /opt/dovecot/lib/dovecot/imap
mail_plugin_dir(pop3): /opt/dovecot/lib/dovecot/pop3
pop3_no_flag_updates(default): no
pop3_no_flag_updates(imap): no
pop3_no_flag_updates(pop3): yes
namespace:
  type: private
  separator: /
  prefix: INBOX/
  inbox: yes
  list: yes
  subscriptions: yes
namespace:
  type: public
  separator: /
  prefix: #Shared/
  location: maildir:/var/spool/dovecot/sharedfolders:INDEX=~/Maildir/index/public:CONTROL=~/Maildir/control/public
  list: yes
  subscriptions: yes
namespace:
  type: shared
  separator: /
  prefix: #User/%%u/
  location: maildir:%%h/Maildir:INDEX=~/Maildir/index/shared/%%u
  list: children
auth default:
  mechanisms: plain login
  user: dovecota
  worker_max_count: 3
  passdb:
    driver: passwd-file
    args: /opt/dovecot/etc/passwd
  userdb:
    driver: passwd-file
    args: /opt/dovecot/etc/passwd
  socket:
    type: listen
    client:
      path: /var/run/dovecot/auth-client
      mode: 432
      user: postfix
      group: postfix
    master:
      path: /var/run/dovecot/auth-master
      mode: 432
      user: dovecota
      group: dovecot
plugin:
  sieve: ~/.dovecot/.dovecot.sieve
  acl: vfile
  acl_shared_dict: file:/var/lib/dovecot/shared-mailboxes.db
  acl_anyone: allow
  quota: dict:user::file:%h/Maildir/dovecot-quota
  quota_rule: *:storage=10G:messages=500000
  fts: squat
  fts_squat: partial=4 full=10



More information about the dovecot mailing list