Changes specific to mutt-ng:
+
+2004-01-23:
+ * Implemented umask option after Wolfgang Karall's idea
+
2004-01-22:
* Reverted the xface patch as it broke a lot of things
* Removed a few pscan(1) warnings
if (mutt_get_field (_("Save to file: "), buf, sizeof (buf), M_FILE) != 0)
return;
mutt_expand_path (buf, sizeof (buf));
- if ((rc = fopen (buf, "a")))
+ if ((rc = safe_fopen (buf, "a")))
{
if (mutt_check_alias_name (new->name, NULL))
mutt_quote_filename (buf, sizeof (buf), new->name);
if (flags == M_SAVE_APPEND)
return fopen (path, "a");
if (flags == M_SAVE_OVERWRITE)
- return fopen (path, "w"); /* __FOPEN_CHECKED__ */
+ return safe_fopen (path, "w"); /* __FOPEN_CHECKED__ */
return safe_fopen (path, "w");
}
if (flags == M_SAVE_APPEND)
s.fpout = fopen (path, "a");
else if (flags == M_SAVE_OVERWRITE)
- s.fpout = fopen (path, "w"); /* __FOPEN_CHECKED__ */
+ s.fpout = safe_fopen (path, "w"); /* __FOPEN_CHECKED__ */
else
s.fpout = safe_fopen (path, "w");
return (-1);
}
dprint (1, (debugfile, "Opening %s\n", filename));
- if (!(ofp = fopen (filename, "w")))
+ if (!(ofp = safe_fopen (filename, "w")))
{
fclose (ifp);
mutt_perror _("Unable to open new file for writing");
#!/bin/sh
# ./configure --enable-pgp --enable-smime --with-regex --enable-pop --enable-imap --enable-nntp --enable-imap-edit-threads --with-ssl --enable-hcache --with-libesmtp && make
+if [ `uname -s` = 'Darwin' ] ; then
+ export CFLAGS="-I/sw/include"
+ export LDFLAGS="-L/sw/lib"
+fi
./configure --enable-pgp --enable-smime --with-regex --enable-pop --enable-imap --enable-nntp --enable-imap-edit-threads --with-ssl --enable-hcache && make
if (!is_new (ctx->realpath))
if (ctx->magic == M_MBOX || ctx->magic == M_MMDF)
- if ((fh = fopen (ctx->path, "w")))
+ if ((fh = safe_fopen (ctx->path, "w")))
fclose (fh);
/* No error checking - the parent function will catch it */
--- /dev/null
+/*
+ * Copyright (C) 1997 Alain Penders <Alain@Finale-Dev.com>
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+int mutt_can_read_compressed (const char *);
+int mutt_can_append_compressed (const char *);
+int mutt_open_read_compressed (CONTEXT *);
+int mutt_open_append_compressed (CONTEXT *);
+int mutt_slow_close_compressed (CONTEXT *);
+int mutt_sync_compressed (CONTEXT *);
+int mutt_test_compress_command (const char *);
+int mutt_check_mailbox_compressed (CONTEXT *);
+void mutt_fast_close_compressed (CONTEXT *);
FILE *f;
int i;
- if ((f = fopen (path, "w")) == NULL) /* __FOPEN_CHECKED__ */
+ if ((f = safe_fopen (path, "w")) == NULL) /* __FOPEN_CHECKED__ */
{
addstr (strerror (errno));
addch ('\n');
WHERE short SendmailWait;
WHERE short SleepTime INITVAL (1);
WHERE short Timeout;
+WHERE short Umask INITVAL(0077);
WHERE short WrapMargin;
WHERE short WriteInc;
/* restore final destination and substitute the tempfile for input */
s->fpout = fp;
fp = s->fpin;
- s->fpin = fopen (tempfile, "r");
+ s->fpin = safe_fopen (tempfile, "r");
unlink (tempfile);
/* restore the prefix */
** machine without having to enter a password.
*/
#endif
+ { "umask", DT_NUM, R_NONE, UL &Umask, 0077 },
+ /*
+ ** .pp
+ ** This sets the umask that will be used by mutt-ng when creating all
+ ** kinds of files. If unset, the default value is 077.
+ */
{ "use_8bitmime", DT_BOOL, R_NONE, OPTUSE8BITMIME, 0 },
/*
** .pp
#include "lib.h"
+extern short Umask;
+
void mutt_nocurses_error (const char *fmt, ...)
{
va_list ap;
*/
FILE *safe_fopen (const char *path, const char *mode)
{
+ /* first set the current umask */
+ umask(Umask);
if (mode[0] == 'w')
{
int fd;
extern char *optarg;
extern int optind;
+short Umask; /* dirty hack because we need Umask in lib.c but don't want globals.h there */
+
#include "sha1.h"
#include "md5.h"
#include "lib.h"