]> code.citadel.org Git - citadel.git/commitdiff
Checking in a skeleton of RFC 2086 (IMAP ACL extension).
authorArt Cancro <ajc@citadel.org>
Tue, 9 Jan 2007 05:06:07 +0000 (05:06 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 9 Jan 2007 05:06:07 +0000 (05:06 +0000)
This will be necessary regardless of which 'connector' product we use.

citadel/Makefile.in
citadel/imap_acl.c [new file with mode: 0644]
citadel/imap_acl.h [new file with mode: 0644]
citadel/serv_imap.c

index 66148adaaf181c4aa6af94f6b4020bb38f9c771e..d6fe48f54b6664bddcd60fb2b8140321cda1bcd6 100644 (file)
@@ -35,7 +35,7 @@ SERV_MODULES=serv_chat.o \
        serv_vcard.o vcard.o \
        serv_mrtg.o \
        serv_imap.o imap_fetch.o imap_misc.o imap_search.o \
-               imap_store.o imap_tools.o \
+               imap_store.o imap_acl.o imap_tools.o \
        serv_fulltext.o ft_wordbreaker.o crc16.o \
        serv_network.o \
        serv_listsub.o \
@@ -102,7 +102,7 @@ SOURCES=aidepost.c auth.c base64.c chkpwd.c citadel.c citadel_ipc.c \
        serv_newuser.c serv_pas2.c serv_pop3.c serv_rwho.c serv_smtp.c \
        serv_spam.c serv_test.c serv_mrtg.c serv_spam.c serv_upgrade.c \
        serv_vandelay.c serv_vcard.c serv_managesieve.c server_main.c \
-       serv_sieve.c setup.c snprintf.c \
+       serv_sieve.c setup.c snprintf.c imap_acl.c \
        stress.c support.c sysdep.c tools.c user_ops.c userlist.c \
        whobbs.c vcard.c serv_notes.c serv_fulltext.c ft_wordbreaker.c \
        crc16.c journaling.c citadel_dirs.c
diff --git a/citadel/imap_acl.c b/citadel/imap_acl.c
new file mode 100644 (file)
index 0000000..188081d
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * $Id:  $
+ *
+ * Functions which implement RFC 2086 (IMAP ACL extension)
+ *
+ */
+
+
+#include "sysdep.h"
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <pwd.h>
+#include <errno.h>
+#include <sys/types.h>
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+#endif
+
+#include <sys/wait.h>
+#include <ctype.h>
+#include <string.h>
+#include <limits.h>
+#include "citadel.h"
+#include "server.h"
+#include "sysdep_decls.h"
+#include "citserver.h"
+#include "support.h"
+#include "config.h"
+#include "serv_extensions.h"
+#include "room_ops.h"
+#include "user_ops.h"
+#include "policy.h"
+#include "database.h"
+#include "msgbase.h"
+#include "tools.h"
+#include "internet_addressing.h"
+#include "serv_imap.h"
+#include "imap_tools.h"
+#include "imap_fetch.h"
+#include "imap_misc.h"
+#include "genstamp.h"
+
+
+
+/*
+ * Implements the SETACL command.
+ */
+void imap_setacl(int num_parms, char *parms[]) {
+
+       cprintf("%s BAD not yet implemented FIXME\r\n", parms[0]);
+       return;
+}
+
+
+/*
+ * Implements the DELETEACL command.
+ */
+void imap_deleteacl(int num_parms, char *parms[]) {
+
+       cprintf("%s BAD not yet implemented FIXME\r\n", parms[0]);
+       return;
+}
+
+
+/*
+ * Implements the GETACL command.
+ */
+void imap_getacl(int num_parms, char *parms[]) {
+
+       cprintf("%s BAD not yet implemented FIXME\r\n", parms[0]);
+       return;
+}
+
+
+/*
+ * Implements the LISTRIGHTS command.
+ */
+void imap_listrights(int num_parms, char *parms[]) {
+
+       cprintf("%s BAD not yet implemented FIXME\r\n", parms[0]);
+       return;
+}
+
+
+/*
+ * Implements the MYRIGHTS command.
+ */
+void imap_myrights(int num_parms, char *parms[]) {
+
+       cprintf("%s BAD not yet implemented FIXME\r\n", parms[0]);
+       return;
+}
+
+
diff --git a/citadel/imap_acl.h b/citadel/imap_acl.h
new file mode 100644 (file)
index 0000000..5d8a840
--- /dev/null
@@ -0,0 +1,11 @@
+/*
+ * $Id:  $
+ *
+ */
+
+void imap_setacl(int num_parms, char *parms[]);
+void imap_deleteacl(int num_parms, char *parms[]);
+void imap_getacl(int num_parms, char *parms[]);
+void imap_listrights(int num_parms, char *parms[]);
+void imap_myrights(int num_parms, char *parms[]);
+
index 9a52c1f0122bbd292fd6f0de69d0289442443b43..27f111fb092952e1a75ee711e5fc87ad2c47b9a3 100644 (file)
@@ -54,6 +54,7 @@
 #include "imap_fetch.h"
 #include "imap_search.h"
 #include "imap_store.h"
+#include "imap_acl.h"
 #include "imap_misc.h"
 
 #ifdef HAVE_OPENSSL
@@ -434,7 +435,7 @@ void imap_cleanup_function(void)
  * output this stuff in other places as well)
  */
 void imap_output_capability_string(void) {
-       cprintf("CAPABILITY IMAP4REV1 NAMESPACE ID AUTH=LOGIN");
+       cprintf("CAPABILITY IMAP4REV1 NAMESPACE ID ACL AUTH=LOGIN");
 #ifdef HAVE_OPENSSL
        if (!CC->redirect_ssl) cprintf(" STARTTLS");
 #endif
@@ -1606,6 +1607,26 @@ void imap_command_loop(void)
                imap_close(num_parms, parms);
        }
 
+       else if (!strcasecmp(parms[1], "SETACL")) {
+               imap_setacl(num_parms, parms);
+       }
+
+       else if (!strcasecmp(parms[1], "DELETEACL")) {
+               imap_deleteacl(num_parms, parms);
+       }
+
+       else if (!strcasecmp(parms[1], "GETACL")) {
+               imap_getacl(num_parms, parms);
+       }
+
+       else if (!strcasecmp(parms[1], "LISTRIGHTS")) {
+               imap_listrights(num_parms, parms);
+       }
+
+       else if (!strcasecmp(parms[1], "MYRIGHTS")) {
+               imap_myrights(num_parms, parms);
+       }
+
        /* End of commands.  If we get here, the command is either invalid
         * or unimplemented.
         */