summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2019-07-23 08:08:04 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2019-07-23 08:08:04 (GMT)
commit113e144dedbebb5bc659eadc7f329450bb374606 (patch) (side-by-side diff)
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.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--lib/manlock.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/manlock.c b/lib/manlock.c
index 4a3b2be..392c581 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.