]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
pop3_lock_session=yes didn't use mail_privileged_group while dotlocking.
authorTimo Sirainen <tss@iki.fi>
Fri, 27 Feb 2009 22:39:48 +0000 (17:39 -0500)
committerTimo Sirainen <tss@iki.fi>
Fri, 27 Feb 2009 22:39:48 +0000 (17:39 -0500)
--HG--
branch : HEAD

src/lib-storage/index/mbox/mbox-storage.c

index b10d0039b887fa197a4f729b872ec2b0556a6390..c5b4f1ca3090b35c051d71fce8ad60568a85ebd6 100644 (file)
@@ -591,22 +591,6 @@ mbox_alloc_mailbox(struct mbox_storage *storage, struct mail_index *index,
 
        index_storage_mailbox_init(&mbox->ibox, name, flags,
                                   want_memory_indexes(storage, path));
-
-       if ((flags & MAILBOX_OPEN_KEEP_LOCKED) != 0) {
-               if (mbox_lock(mbox, F_WRLCK, &mbox->mbox_global_lock_id) <= 0) {
-                       struct mailbox *box = &mbox->ibox.box;
-
-                       mailbox_close(&box);
-                       return NULL;
-               }
-
-               if (mbox->mbox_dotlock != NULL) {
-                       mbox->keep_lock_to =
-                               timeout_add(MBOX_LOCK_TOUCH_MSECS,
-                                           mbox_lock_touch_timeout, mbox);
-               }
-       }
-
        return mbox;
 }
 
@@ -640,6 +624,20 @@ mbox_open(struct mbox_storage *storage, const char *name,
                if (strncmp(path, rootdir, strlen(rootdir)) != 0)
                        mbox->mbox_privileged_locking = TRUE;
        }
+       if ((flags & MAILBOX_OPEN_KEEP_LOCKED) != 0) {
+               if (mbox_lock(mbox, F_WRLCK, &mbox->mbox_global_lock_id) <= 0) {
+                       struct mailbox *box = &mbox->ibox.box;
+
+                       mailbox_close(&box);
+                       return NULL;
+               }
+
+               if (mbox->mbox_dotlock != NULL) {
+                       mbox->keep_lock_to =
+                               timeout_add(MBOX_LOCK_TOUCH_MSECS,
+                                           mbox_lock_touch_timeout, mbox);
+               }
+       }
        return &mbox->ibox.box;
 }