[Dovecot] writing a dovecot plugin / segfault

Stefan Jurisch s.jurisch at w3o-services.de
Mon Jan 5 15:20:39 EET 2009


Hi together,

I am new to this list and new to dovecot itself. I have to write a plugin that implements some ACL-voodoo to be used instead of the standard ACL stuff of dovecot (it shall allow just application-driven folder-sharing - no more, no less).

Though I started programming with C, my last experiences are some days old, but now I have written the function sekeletons and the registration function with the 'register-command"-calls etc.
The makefile-stuff I copied from the imap-quota-plugin and modified it, so all appearances of "lib11_imap_quota_plugin..." and similar are now found as "lib11_folderacl_plugin..." and so on.

In short words: I think I have done all nessessary mods to the source (I tried it some days ago with a slightly older version of dovecot, and until I did some unknown thing, it worked quite well...) to make the whole thing work.

One example function is (just testing at the moment):
/* MYRIGHTS <folder>: retreive the rights of the current folder */
static bool cmd_myrights(struct client_command_context *cmd)
{
	struct mail_storage *storage;
	struct mailbox *folder;
	const char *folder_name;
	string_t *response;

	/* read argument: <folder> */
	if (!client_read_string_args(cmd, 1, &folder_name))
	return FALSE;
									
	/* work done from here... */
	/* for the moment, do a dummy response */
	str_append(response, "* MYRIGHTS ");
	str_append(response, folder_name);
	str_append(response, " lrswipcda");

	client_send_line(cmd->client, str_c(response));
	client_send_tagline(cmd, "OK Completed.");
	
	return TRUE;
}
																
But when testing via "telnet localhost 143" and doing a "20 myrights INBOX" the imap thread just crashes and does not give any answer. in /var/log/messages I only find something like the following entry:
Jan  5 13:40:12 kungfu kernel: imap[8991]: segfault at 4 ip 080d5c67 sp bf82b040 error 4 in imap[8048000+b8000]

Maybe somebody can tell me, what this is?
If needed, I also post the complete code itself somewhere.

Thanks in advance.
Stefan



-- 

SIEGNETZ.IT GmbH
{ w3o-services }
Schneppenkauten 1a
D-57076 Siegen

Tel.: 0271 68193-0
Fax: 0271 68193-29

Geschäftsführer: Oliver Seitz

Handelsregister-Nummer: HRB4838
Registergericht:  Amtsgericht Siegen

--------------------------------

Das Wort “WINDOWS” stammt aus
einem alten Sioux-Dialekt und
bedeutet:
“Weißer Mann starrt durch
Glasscheibe auf Sanduhr.”

--------------------------------



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the dovecot mailing list