talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 7b92628aa3d14b7c15eb68ca731d94695d7f67df
parent d64c625f5a1e81a6abe287926818efebdbec7d15
Author: paul <paul@claws-mail.org>
Date:   Sun, 18 Jul 2021 09:53:21 +0100

set chmod 0600 on log files, history files, saved parts, etc.

Diffstat:
Msrc/common/log.c | 10++++++++--
Msrc/procmime.c | 7++++++-
2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/common/log.c b/src/common/log.c @@ -1,6 +1,6 @@ /* - * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 1999-2012 Hiroyuki Yamamoto and the Claws Mail team + * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client + * Copyright (C) 1999-2021 the Claws Mail team and Hiroyuki Yamamoto * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -128,6 +128,12 @@ void set_log_file(LogInstance instance, const gchar *filename) g_free(fullname); return; } + + if (change_file_mode_rw(log_fp[instance], fullname) < 0) { + FILE_OP_ERROR(fullname, "chmod"); + g_warning("can't change file mode: %s", fullname); + } + log_filename[instance] = g_strdup(fullname); log_size[instance] = 0; g_free(fullname); diff --git a/src/procmime.c b/src/procmime.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 1999-2020 the Claws Mail Team and Hiroyuki Yamamoto + * Copyright (C) 1999-2021 the Claws Mail Team and Hiroyuki Yamamoto * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -713,6 +713,11 @@ gint procmime_get_part(const gchar *outfile, MimeInfo *mimeinfo) return -(saved_errno); } + if (change_file_mode_rw(outfp, outfile) < 0) { + FILE_OP_ERROR(outfile, "chmod"); + g_warning("can't change file mode: %s", outfile); + } + result = procmime_get_part_to_stream(outfp, mimeinfo); if (claws_fclose(outfp) == EOF) {