diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2019-07-23 11:08:04 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2019-07-23 11:08:04 +0300 |
commit | 113e144dedbebb5bc659eadc7f329450bb374606 (patch) | |
tree | 76c17ffc426b3c328367183b6fa6d22880f48a1e | |
parent | 018df5d628f4e093f7e45c00b48ffc11b234d8cf (diff) | |
download | mailutils-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.c | 13 |
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) | |||
126 | return MU_ERR_FAILURE; | 126 | return MU_ERR_FAILURE; |
127 | } | 127 | } |
128 | 128 | ||
129 | if (lock) | ||
130 | { | ||
131 | status = mu_locker_get_flags (lock, &flags); | ||
132 | if (status) | ||
133 | { | ||
134 | mu_diag_funcall (MU_DIAG_ERROR, "mu_locker_get_flags", urlstr, | ||
135 | status); | ||
136 | return MU_ERR_FAILURE; | ||
137 | } | ||
138 | if (flags & MU_LOCKER_NULL) | ||
139 | lock = NULL; | ||
140 | } | ||
141 | |||
129 | if (!lock && manlock_mandatory_locking && manlock_lock_dir) | 142 | if (!lock && manlock_mandatory_locking && manlock_lock_dir) |
130 | { | 143 | { |
131 | char *fname = NULL; | 144 | char *fname = NULL; |