commit-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Mailutils branch, master, updated. mu-1-2-90-separate-argp-cfg


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. mu-1-2-90-separate-argp-cfg-256-gde3516a
Date: Sat, 28 Mar 2009 09:47:50 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mailutils".

http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=de3516ae5f7e9c792cb2aa93eba98d26ce1b240c

The branch, master has been updated
       via  de3516ae5f7e9c792cb2aa93eba98d26ce1b240c (commit)
      from  88260300b2288f9a2515bbf94339a949fea2c425 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit de3516ae5f7e9c792cb2aa93eba98d26ce1b240c
Author: Sergey Poznyakoff <address@hidden>
Date:   Sat Mar 28 11:46:32 2009 +0200

    Bugfixes.
    
    * imap4d/copy.c: Set target mailbox permissions.
    * imap4d/rename.c: Remove useless variable. Add some comments.

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

Summary of changes:
 imap4d/copy.c   |   10 ++++++----
 imap4d/rename.c |   22 ++++++++++++----------
 2 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/imap4d/copy.c b/imap4d/copy.c
index eebb3f3..98d1388 100644
--- a/imap4d/copy.c
+++ b/imap4d/copy.c
@@ -1,5 +1,6 @@
 /* GNU Mailutils -- a suite of utilities for electronic mail
-   Copyright (C) 1999, 2001, 2005, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2001, 2005, 2007, 2008,
+   2009 Free Software Foundation, Inc.
 
    GNU Mailutils is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -68,6 +69,7 @@ imap4d_copy0 (imap4d_tokbuf_t tok, int isuid, char **err_text)
   int n = 0;
   mu_mailbox_t cmbox = NULL;
   int arg = IMAP4_ARG_1 + !!isuid;
+  int ns;
   
   if (imap4d_tokbuf_argc (tok) != arg + 2)
     {
@@ -87,11 +89,11 @@ imap4d_copy0 (imap4d_tokbuf_t tok, int isuid, char 
**err_text)
       return RESP_OK;
     }
 
-  mailbox_name = namespace_getfullpath (name, delim, NULL);
+  mailbox_name = namespace_getfullpath (name, delim, &ns);
 
   if (!mailbox_name)
     {
-      *err_text = "NO Create failed.";
+      *err_text = "NO Copy failed.";
       return RESP_NO;
     }
 
@@ -101,7 +103,7 @@ imap4d_copy0 (imap4d_tokbuf_t tok, int isuid, char 
**err_text)
   if (status == 0)
     {
       /* It SHOULD NOT automatifcllly create the mailbox. */
-      status = mu_mailbox_open (cmbox, MU_STREAM_RDWR);
+      status = mu_mailbox_open (cmbox, MU_STREAM_RDWR | mailbox_mode[ns]);
       if (status == 0)
        {
          size_t i;
diff --git a/imap4d/rename.c b/imap4d/rename.c
index 279d1e6..d6cc9d4 100644
--- a/imap4d/rename.c
+++ b/imap4d/rename.c
@@ -1,5 +1,6 @@
 /* GNU Mailutils -- a suite of utilities for electronic mail
-   Copyright (C) 1999, 2001, 2005, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2001, 2005, 2007, 2008,
+   2009 Free Software Foundation, Inc.
 
    GNU Mailutils is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -44,7 +45,8 @@ imap4d_rename (struct imap4d_command *command, 
imap4d_tokbuf_t tok)
   const char *msg = "Completed";
   struct stat newst;
   const char *delim = "/";
-
+  int ns;
+  
   if (imap4d_tokbuf_argc (tok) != 4)
     return util_finish (command, RESP_BAD, "Invalid arguments");
   
@@ -55,7 +57,7 @@ imap4d_rename (struct imap4d_command *command, 
imap4d_tokbuf_t tok)
     return util_finish (command, RESP_NO, "Name Inbox is reservered");
 
   /* Allocates memory.  */
-  newname = namespace_getfullpath (newname, delim, NULL);
+  newname = namespace_getfullpath (newname, delim, &ns);
   if (!newname)
     return util_finish (command, RESP_NO, "Permission denied");
 
@@ -77,23 +79,20 @@ imap4d_rename (struct imap4d_command *command, 
imap4d_tokbuf_t tok)
     {
       mu_mailbox_t newmbox = NULL;
       mu_mailbox_t inbox = NULL;
-      char *name;
 
-      if (S_ISDIR(newst.st_mode))
+      if (S_ISDIR (newst.st_mode))
        {
          free (newname);
          return util_finish (command, RESP_NO, "Cannot be a directory");
        }
-      name = calloc (strlen ("mbox:") + strlen (newname) + 1, 1);
-      sprintf (name, "mbox:%s", newname);
       if (mu_mailbox_create (&newmbox, newname) != 0
-         || mu_mailbox_open (newmbox, MU_STREAM_CREAT | MU_STREAM_RDWR) != 0)
+         || mu_mailbox_open (newmbox,
+                             MU_STREAM_CREAT | MU_STREAM_RDWR
+                               | mailbox_mode[ns]) != 0)
        {
-         free (name);
          free (newname);
          return util_finish (command, RESP_NO, "Cannot create new mailbox");
        }
-      free (name);
       free (newname);
 
       if (mu_mailbox_create_default (&inbox, auth_data->name) == 0 &&
@@ -125,6 +124,9 @@ imap4d_rename (struct imap4d_command *command, 
imap4d_tokbuf_t tok)
   oldname = namespace_getfullpath (oldname, delim, NULL);
 
   /* It must exist.  */
+  /* FIXME: 1. What if odlname or newname is a remote mailbox?
+            2. If newname is local and is in another namespace, its
+              permissions must be fixed */
   if (!oldname || rename (oldname, newname) != 0)
     {
       rc = RESP_NO;


hooks/post-receive
--
GNU Mailutils




reply via email to

[Prev in Thread] Current Thread [Next in Thread]