summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2019-07-23 11:08:04 +0300
committerSergey Poznyakoff <gray@gnu.org>2019-07-23 11:08:04 +0300
commit113e144dedbebb5bc659eadc7f329450bb374606 (patch)
tree76c17ffc426b3c328367183b6fa6d22880f48a1e
parent018df5d628f4e093f7e45c00b48ffc11b234d8cf (diff)
downloadmailutils-113e144dedbebb5bc659eadc7f329450bb374606.tar.gz
mailutils-113e144dedbebb5bc659eadc7f329450bb374606.tar.bz2
Fix mandatory locking
* lib/manlock.c (mailbox_open_and_lock): Force proper locker if a null locker is associated with the mailbox.
-rw-r--r--lib/manlock.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/manlock.c b/lib/manlock.c
index 4a3b2be67..392c58155 100644
--- a/lib/manlock.c
+++ b/lib/manlock.c
@@ -126,6 +126,19 @@ mailbox_open_and_lock (mu_mailbox_t mbox, int flags)
return MU_ERR_FAILURE;
}
+ if (lock)
+ {
+ status = mu_locker_get_flags (lock, &flags);
+ if (status)
+ {
+ mu_diag_funcall (MU_DIAG_ERROR, "mu_locker_get_flags", urlstr,
+ status);
+ return MU_ERR_FAILURE;
+ }
+ if (flags & MU_LOCKER_NULL)
+ lock = NULL;
+ }
+
if (!lock && manlock_mandatory_locking && manlock_lock_dir)
{
char *fname = NULL;

Return to:

Send suggestions and report system problems to the System administrator.