From: jacob Date: Mon, 23 Feb 2009 22:40:09 +0000 (+0000) Subject: Stop attempting to make session logs private on Unix. This was introduced in X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/b078de41dfbae96dfb831e6e06df047b669adc4c Stop attempting to make session logs private on Unix. This was introduced in r7084 at the same time as sensible permissions when writing private key files; however, it causes an assertion failure whenever an attempt is made to append to an existing log file on Unix, and it's not clear what "is_private" *should* do for append, so revert to log file security being the user's responsibility. (Fixes Ubuntu LP#212711.) git-svn-id: svn://svn.tartarus.org/sgt/putty@8461 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/logging.c b/logging.c index 17924c5a..f1e37295 100644 --- a/logging.c +++ b/logging.c @@ -85,7 +85,7 @@ static void logfopen_callback(void *handle, int mode) ctx->state = L_ERROR; /* disable logging */ } else { fmode = (mode == 1 ? "ab" : "wb"); - ctx->lgfp = f_open(ctx->currlogfilename, fmode, TRUE); + ctx->lgfp = f_open(ctx->currlogfilename, fmode, FALSE); if (ctx->lgfp) ctx->state = L_OPEN; else diff --git a/unix/uxmisc.c b/unix/uxmisc.c index 4c6a7670..dd04e6f5 100644 --- a/unix/uxmisc.c +++ b/unix/uxmisc.c @@ -141,7 +141,8 @@ FILE *f_open(struct Filename filename, char const *mode, int is_private) return fopen(filename.path, mode); } else { int fd; - assert(mode[0] == 'w'); /* is_private is meaningless for read */ + assert(mode[0] == 'w'); /* is_private is meaningless for read, + and tricky for append */ fd = open(filename.path, O_WRONLY | O_CREAT | O_TRUNC, 0700); if (fd < 0)