[Dovecot] Dovecot v1.2 assert() in ACL
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hello,
using Dovecot v1.2 changeset: 9126:b745911012bb
ACL config: acl = vfile
# To let users LIST mailboxes shared by other users, Dovecot needs a # shared mailbox dictionary. For example: acl_shared_dict = file:/var/cache/dovecot/shared-mailboxes
telnet localhost imap 0 login .... 1 getacl Sent
- ACL "Sent" "testuser" lrwstipekxacd 1 OK Getacl completed. 2 setacl Sent timo +lrwtsd 2 OK Setacl complete. 3 setacl Sent timo -lrwtsd Aborted (core dumped)
cat /var/cache/dovecot/shared-mailboxes shared/shared-boxes/user/timo/testuser 1
===
The assert happens when the last right is to remove:
setacl I user +lwp setacl I user -l setacl I user -w setacl I user -p Abort
===
log: Panic: file ../../../src/lib/array.h: line 162 (array_idx_i): assertion failed: (idx * array->element_size < array->buffer->used) Raw backtrace: imap [0x80e9ed0] -> imap(i_syslog_fatal_handler+0x2d) [0x80e9f6d] -> imap [0x80e97da] -> /usr/local/dovecot-1.2.rc5unpatched/lib/dovecot/imap/lib01_acl_plugin.so [0xb7e4ede4] -> /usr/local/dovecot-1.2.rc5unpatched/lib/dovecot/imap/lib01_acl_plugin.so [0xb7e4ee40] -> /usr/local/dovecot-1.2.rc5unpatched/lib/dovecot/imap/lib01_acl_plugin.so [0xb7e50c3b] -> /usr/local/dovecot-1.2.rc5unpatched/lib/dovecot/imap/lib01_acl_plugin.so(acl_object_update+0x18) [0xb7e4de98] -> /usr/local/dovecot-1.2.rc5unpatched/lib/dovecot/imap/lib02_imap_acl_plugin.so [0xb7f951cf] -> imap [0x8063dbc] -> imap [0x8063e6b] -> imap(client_handle_input+0x3f) [0x8063fbf] -> imap(client_input+0x5f) [0x8064b2f] -> imap(io_loop_handler_run+0x110) [0x80f2a10] -> imap(io_loop_run+0x28) [0x80f1ad8] -> imap(main+0x764) [0x806cf34] -> /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xc8) [0xb7e6eea8] -> imap [0x805cb71]
(gdb) bt full #0 0xb7f99410 in ?? () No symbol table info available. #1 0xbfe106ac in ?? () No symbol table info available. #2 0x00000006 in ?? () No symbol table info available. #3 0x000054a6 in ?? () No symbol table info available. #4 0xb7e82811 in raise () from /lib/tls/i686/cmov/libc.so.6 No symbol table info available. #5 0xb7e83fb9 in abort () from /lib/tls/i686/cmov/libc.so.6 No symbol table info available. #6 0x080e9edd in default_fatal_finish (type=<value optimized out>, status=0) at failures.c:160 backtrace = 0x81205e0 "imap [0x80e9ed0] -> imap(i_syslog_fatal_handler+0x2d) [0x80e9f6d] -> imap [0x80e97da] -> /usr/local/dovecot-1.2.rc5unpatched/lib/dovecot/imap/lib01_acl_plugin.so [0xb7e4ede4] -> /usr/local/dovecot-1.2"... #7 0x080e9f6d in i_syslog_fatal_handler (type=LOG_TYPE_PANIC, status=0, fmt=0xb7e55714 "file %s: line %d (%s): assertion failed: (%s)", args=0xbfe10854 "\"Y?") at failures.c:315 No locals. #8 0x080e97da in i_panic ( format=0xb7e55714 "file %s: line %d (%s): assertion failed: (%s)") at failures.c:207 args = 0xbfe10854 "\"Y?" #9 0xb7e4ede4 in modify_right_list (pool=0x8154330, rightsp=0x8154450, modify_rights=0x8120338, modify_mode=ACL_MODIFY_MODE_REMOVE) at ../../../src/lib/array.h:162 old_rights = (const char * const *) 0x8154360 new_rights = (const char * const *) 0xbfe10894 null = 0x0 #10 0xb7e4ee40 in vfile_object_modify_right (aclobj=0x81542d0, idx=0, update=0xbfe10a2c) at acl-backend-vfile.c:940 c1 = 74 c2 = <value optimized out> #11 0xb7e50c3b in acl_backend_vfile_object_update (_aclobj=0x81542d0, update=0xbfe10a2c) at acl-backend-vfile.c:1099 str = <value optimized out> i = <value optimized out> ret = <value optimized out> output = <value optimized out> rights = <value optimized out> aclobj = (struct acl_object_vfile *) 0x0 dotlock = <value optimized out> path = <value optimized out> i = 0 fd = 7 changed = <value optimized out> __PRETTY_FUNCTION__ = "acl_backend_vfile_object_update" #12 0xb7e4de98 in acl_object_update (aclobj=0x81542d0, update=0xbfe10a2c) at acl-api.c:137 No locals. #13 0xb7f951cf in cmd_setacl (cmd=0x8130a10) at imap-acl-plugin.c:574 ns = (struct mail_namespace *) 0x8129988 storage = <value optimized out> box = (struct mailbox *) 0x8154f88 backend = (struct acl_backend *) 0x812e2f0 update = {rights = {id_type = ACL_ID_USER, identifier = 0x8135b18 "timo", rights = 0x8120338, neg_rights = 0x0, global = 0}, modify_mode = ACL_MODIFY_MODE_REMOVE, neg_modify_mode = ACL_MODIFY_MODE_REMOVE} mailbox = 0x8135b10 "Sent" identifier = 0x8135b18 "timo" rights = 0x8135b21 "lrwtsd" error = <value optimized out> negative = false #14 0x08063dbc in client_command_input (cmd=0x8130a10) at client.c:607 client = (struct client *) 0x812f748 command = <value optimized out> __PRETTY_FUNCTION__ = "client_command_input" #15 0x08063e6b in client_command_input (cmd=0x8130a10) at client.c:656 client = (struct client *) 0x812f748 command = (struct command *) 0x54a6 __PRETTY_FUNCTION__ = "client_command_input" #16 0x08063fbf in client_handle_input (client=0x812f748) at client.c:697 _data_stack_cur_id = 3 remove_io = <value optimized out> handled_commands = false __PRETTY_FUNCTION__ = "client_handle_input" #17 0x08064b2f in client_input (client=0x812f748) at client.c:748 cmd = <value optimized out> output = (struct ostream *) 0x813098c bytes = 27 __PRETTY_FUNCTION__ = "client_input" #18 0x080f2a10 in io_loop_handler_run (ioloop=0x8128ac8) at ioloop-epoll.c:208 ctx = <value optimized out> event = (const struct epoll_event *) 0x8128c10 list = (struct io_list *) 0x812f808 io = (struct io_file *) 0x812f7e0 tv = {tv_sec = 1789, tv_usec = 997764} t_id = 2 msecs = <value optimized out> ret = 1 i = 0 j = 0 call = <value optimized out> #19 0x080f1ad8 in io_loop_run (ioloop=0x8128ac8) at ioloop.c:338 No locals. #20 0x0806cf34 in main (argc=Cannot access memory at address 0x54a6 ) at main.c:323 buf = <value optimized out>
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iQEVAwUBSjZLO3WSIuGy1ktrAQIiQQf+OVIEEnHua9i/f282/LLGyo48jQMQjq6b VsxUuS6pwPc6HNq16EUNfWOEA6F1/dItNLW0LbvG4bOFwtGv5HnfrzUkkf0WwZun RrVvuXCD+5vF9pMJMbilhGm4h+js+Ymu9dnl43Y64l+7t7lDMPl/JYhGgTYPFF2g 7AgNfwaRG0G4G6zQrjQr9TdefCpq9esZadQwiYMMTWTZA1krfj4QW2ITTeoKaEIL gOR6wjMWVCw6XTYYoLG9dXXJ989U3yhXEu8aXkjAZjdf6Pb/nSrrTluLDgawK65+ IlIIVD5Nx/sqsVQAZ9dK9WGNdG4i6RK/1MZH80bomJ8Ot+KrhW76oQ== =d3r4 -----END PGP SIGNATURE-----
On Mon, 2009-06-15 at 15:23 +0200, Steffen Kaiser wrote:
2 setacl Sent timo +lrwtsd 2 OK Setacl complete. 3 setacl Sent timo -lrwtsd Aborted (core dumped)
Thanks, fixed: http://hg.dovecot.org/dovecot-1.2/rev/01fae3737994
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Mon, 15 Jun 2009, Timo Sirainen wrote:
On Mon, 2009-06-15 at 15:23 +0200, Steffen Kaiser wrote:
2 setacl Sent timo +lrwtsd 2 OK Setacl complete. 3 setacl Sent timo -lrwtsd Aborted (core dumped)
Thanks, fixed: http://hg.dovecot.org/dovecot-1.2/rev/01fae3737994
The assert is gone now, but "user" is left in the ACL without rights, see #4:
1 getacl INBOX
- ACL "INBOX" "user" lp "testusr" lrwstipekxacd 1 OK Getacl completed. 3 setacl inbox user -l 3 OK Setacl complete. 3 setacl inbox user -p 3 OK Setacl complete. 4 getacl INBOX
- ACL "INBOX" "user" "testusr" lrwstipekxacd 4 OK Getacl completed. 3 setacl inbox user 3 OK Setacl complete. 1 getacl INBOX
- ACL "INBOX" "testusr" lrwstipekxacd 1 OK Getacl completed.
Bye,
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iQEVAwUBSjdNfnWSIuGy1ktrAQKF0wf+POtH37iS3GNjV/oWnvlbBG1o4PGRHmtR 1zZ/zOjv76aGWMp93haF3r5ESPTPZvbwqDn/RIIVpPjjCKXl/8q2c9FjJxcbeg/M bNcrdOQu3N5ObgoEFYwpv1+gJOvIbPHDMz6atOUkZ1j8pyt1GNNCWRCEH3dO/K/a I8e4OlJBn+q1zNPxhOQoBm6t2uET0i3449RpMsLjbA1r+hrdr6WDYI3me7Zqa1qz waeIsK0lhyei7mEzQJT1DDmWrKG8LpIh9+K8BJD084Xz3NBzVgSrGYGq+Um1vLva aNwp/lN9LiO4y6/x2njsIgnHSP4YAKmLZNXNFEwL6ORW96TjALHybQ== =Obgu -----END PGP SIGNATURE-----
On Jun 16, 2009, at 3:45 AM, Steffen Kaiser wrote:
Thanks, fixed: http://hg.dovecot.org/dovecot-1.2/rev/01fae3737994
The assert is gone now, but "user" is left in the ACL without
rights, see #4:
Hmm. I thought that's what it should do?
4 getacl INBOX
- ACL "INBOX" "user" "testusr" lrwstipekxacd 4 OK Getacl completed.
But yeah, it clearly can't just return emptyness there. Wonder if it
could return "" or something. I'll look into this tomorrow, unless
someone already can tell me the right way to handle this.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Tue, 16 Jun 2009, Timo Sirainen wrote:
4 getacl INBOX
- ACL "INBOX" "user" "testusr" lrwstipekxacd 4 OK Getacl completed.
But yeah, it clearly can't just return emptyness there. Wonder if it could return "" or something. I'll look into this tomorrow, unless someone already can tell me the right way to handle this.
Digging a second time through RFC4314 I found this:
The first example in Sec 2.1.1
" S: * LISTRIGHTS archive/imap anyone "" lr s w i p k x t c d "
In conjunction with Sec 3.7
"Following the identifier is a string containing the (possibly empty) set of rights the identifier will always be granted in the mailbox."
So "" for an empty set is needed.
=====
Now I wonder, why there exists "an empty set of rights" at all?
Shouldn't "SETACL mailbox id" (no rights string) behave differently than "DELETEACL mailbox id" then as well? Currently it removes the ACL entry of id.
Reading the RFC I get the impression, that SETACL should have three arguments always.
Bye,
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iQEVAwUBSjdbXnWSIuGy1ktrAQI8QAf9GheGY8S1iUl6dyvFTRcDq7b1dROmC4DT ipNvezqUyG8p6sK3gljsO0DdauDmzMmZoPao31ZyvFGSNZkaN/c3tVpui4qYLYhx exVXEajNyONdsVDWyvEAooVWATEC7rTVRWqLCpF3g3kxQcAtz0VZlG/JSwBr3VbP 7y0tPIQBsJvPaLdLEQ8I30myEIlNZbSgP7v/bcngsq0xZF6HHXqJdf4jyBLrO26R JzWTYnN1i/dZGEPM8NIsmr+ZqTSfwkHTasO6QTzPo/CWv8ZlXkTNWNnwsatTmxFm E+NnZZ90S7pbm/2FXoXplzRiHdxrn/6l0uaQUY9mR0Kb/76hMXU4aA== =H8ZK -----END PGP SIGNATURE-----
On Jun 16, 2009, at 4:44 AM, Steffen Kaiser wrote:
Now I wonder, why there exists "an empty set of rights" at all?
To remove all rights from someone.
Shouldn't "SETACL mailbox id" (no rights string) behave differently
than "DELETEACL mailbox id" then as well? Currently it removes the
ACL entry of id.Reading the RFC I get the impression, that SETACL should have three
arguments always.
I think that's correct and it's probably an implementation kludge to
even allow two parameter SETACL.
On Tue, 2009-06-16 at 11:29 -0400, Timo Sirainen wrote:
Shouldn't "SETACL mailbox id" (no rights string) behave differently
than "DELETEACL mailbox id" then as well? Currently it removes the
ACL entry of id.Reading the RFC I get the impression, that SETACL should have three
arguments always.I think that's correct and it's probably an implementation kludge to
even allow two parameter SETACL.
Looks like there was a generic IMAP parser bug that caused SETACL to not give an error with two parameters. That's fixed now. Also empty rights handling is fixed too.
participants (2)
-
Steffen Kaiser
-
Timo Sirainen