Back to index

courier  0.68.2
Functions
acl.h File Reference
#include "config.h"
#include "maildir/maildiraclt.h"
#include "maildir/maildirinfo.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int acl_read (maildir_aclt_list *l, const char *folder, char **owner)
int acl_read2 (maildir_aclt_list *l, struct maildir_info *minfo, char **owner)
void acl_computeRights (maildir_aclt_list *l, char *rights, const char *owner)
void acl_computeRightsOnFolder (const char *folder, char *rights)

Function Documentation

void acl_computeRights ( maildir_aclt_list l,
char *  rights,
const char *  owner 
)

Definition at line 209 of file acl.c.

{
       char *p, *q;

       maildir_aclt a;

       if (maildir_acl_computerights(&a, l, login_returnaddr(), owner) < 0)
       {
              *rights=0;
              return;
       }

       for (p=q=rights; *p; p++)
       {
              if (strchr(maildir_aclt_ascstr(&a), *p))
                     *q++ = *p;
       }
       *q=0;
       maildir_aclt_destroy(&a);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void acl_computeRightsOnFolder ( const char *  folder,
char *  rights 
)

Definition at line 193 of file acl.c.

{
       maildir_aclt_list l;
       char *owner;

       if (acl_read(&l, folder, &owner) < 0)
       {
              *rights=0;
              return;
       }
       acl_computeRights(&l, rights, owner);
       if (owner)
              free(owner);
       maildir_aclt_list_destroy(&l);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int acl_read ( maildir_aclt_list l,
const char *  folder,
char **  owner 
)

Definition at line 132 of file acl.c.

{
       struct maildir_info minfo;
       int rc;

       if (maildir_info_imap_find(&minfo, folder,
                               login_returnaddr())<0)
       {
              return -1;
       }

       rc=acl_read2(l, &minfo, owner);
       maildir_info_destroy(&minfo);
       return rc;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int acl_read2 ( maildir_aclt_list l,
struct maildir_info minfo,
char **  owner 
)

Definition at line 149 of file acl.c.

{
       int rc;
       char *p;

       if (minfo->mailbox_type == MAILBOXTYPE_OLDSHARED)
       {
              /* Legacy shared., punt. */

              maildir_aclt_list_init(l);
              if (maildir_aclt_list_add(l, "anyone",
                                     ACL_LOOKUP ACL_READ
                                     ACL_SEEN ACL_WRITE
                                     ACL_INSERT
                                     ACL_DELETEMSGS ACL_EXPUNGE, NULL) < 0
                  || (*owner=strdup("vendor=courier.internal")) == NULL)
              {
                     maildir_aclt_list_destroy(l);
                     return -1;
              }
              return 0;
       }

       if (minfo->homedir == NULL || minfo->maildir == NULL)
              return -1;

       p=maildir_name2dir(".", minfo->maildir);

       if (!p)
              return -1;

       rc=maildir_acl_read(l, minfo->homedir,
                         strncmp(p, "./", 2) == 0 ? p+2:p);
       free(p);
       if (owner && rc == 0)
       {
              *owner=minfo->owner;
              minfo->owner=NULL;
       }
       return rc;
}

Here is the call graph for this function:

Here is the caller graph for this function: