[Users] Saving draft doesn't set msg mode as specified in draft folder properties

Mat mnieuw at zap.a2000.nl
Mon Jul 29 17:26:26 UTC 2024


On Mon, 29 Jul 2024 17:20:41 +0200
Mat <mnieuw at zap.a2000.nl> wrote:

> Hi,
> If I compose a new msg, and do Message-Save, it ends up in the draft
> folder, but always with mode rw for the user (0600). But the draft
> folder's preferences are set to 0660.
> 
> It looks like this is happening in mh.c, function mh_add_msgs, which
> calls copy_file in common/file-utils.c . And that always sets the file
> mode to 0600.
> 
> Why isn´t the filemode not passed on the copy file, or the msg
> correctly set after the copy_file returns?
> 
> MatN

It also happens if I save a message for later sending, that is, into
the queue folder: the message has mode 0600.
I put in some extra log_message entries in the code to get info into the
claws log file, because the debug_print statements don't always result
in a terminal msg. This gives f.i. for draft:
====
[2024-07-29 19:06:15] * message: Draft path, name: draft, draft
[2024-07-29 19:06:15] * message: Temp file name
/home/mat/.claws-mail/tmp/draft.0x15a3c00
[2024-07-29 19:06:15] * message: Folder chmod 641
[2024-07-29 19:06:15] * message: Temp file mode set to 661
=====

The second 6 is hard coded, if a folder's chmod is read only, the code
changes the tmp msg files mode to rw. Note that all Mail folders
are another partition, mounted rw for mail users, although I can't see
how that should affect it.

Is there another place in the code that afterwards should set the
proper filemode?

MatN


More information about the Users mailing list