commit a4710c470e53b94c4fbd6a409456b95b18110b52
parent 7519c00939efe1e0a11eafa974e52463ac1c6042
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:
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
@@ -715,6 +715,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) {