Commit 85032d0e 85032d0e724bcba34a61458c44034336e15b9cbe by Sergey Poznyakoff

Bugfixes.

* libmailutils/base/amd.c (amd_open): Return error if the mailbox
cannot be opened for the required access permissions.
(amd_message_stream_open): Fix condition for
determining r/w access.
* mh/mh_list.c (eval_extras): Break the loop if mu_header_aget_field_name
fails.
1 parent 5e5b68fd
......@@ -365,10 +365,15 @@ amd_open (mu_mailbox_t mailbox, int flags)
else
return errno;
}
if (!S_ISDIR (st.st_mode))
return EINVAL;
if (access (amd->name,
(flags & (MU_STREAM_WRITE|MU_STREAM_APPEND)) ?
W_OK : R_OK | X_OK))
return errno;
if (mailbox->locker == NULL)
mu_locker_create (&mailbox->locker, "/dev/null", 0);
......@@ -1674,7 +1679,7 @@ amd_message_stream_open (struct _amd_message *mhm)
}
/* The message should be at least readable */
if (amd->mailbox->flags & (MU_STREAM_RDWR|MU_STREAM_WRITE|MU_STREAM_APPEND))
if (amd->mailbox->flags & (MU_STREAM_WRITE|MU_STREAM_APPEND))
flags |= MU_STREAM_RDWR;
else
flags |= MU_STREAM_READ;
......
;; Default components file for GNU MH.
;; Lines beginning with ; are ignored. Rest of lines is copied verbatim.
To:
cc:
Subject:
......
;; Default forward components file for GNU MH.
;; Lines beginning with ; are ignored. Rest of lines is copied verbatim.
To:
cc:
Subject:
......
......@@ -755,7 +755,8 @@ eval_extras (struct eval_env *env)
mu_header_get_field_count (hdr, &num);
for (i = 1; i <= num; i++)
{
mu_header_aget_field_name (hdr, i, &str);
if (mu_header_aget_field_name (hdr, i, &str))
break;
if (want_header (env, str)
&& !header_is_printed (env, str))
{
......