From: Glenn Burkhardt Date: Thu, 26 Jun 2003 01:30:36 +0000 (+0000) Subject: fix for bug #578 repl leaks umask; there are several other X-Git-Tag: RELEASE_1_2~103 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=19b47ea980a98d01112d4bda1d220c7057818ff1;p=mmh fix for bug #578 repl leaks umask; there are several other places in the code where the umask value is not restored, so there might be other similar bugs --- diff --git a/uip/replsbr.c b/uip/replsbr.c index 1ea411c..a7616d3 100644 --- a/uip/replsbr.c +++ b/uip/replsbr.c @@ -76,14 +76,16 @@ replout (FILE *inb, char *msg, char *drft, struct msgs *mp, int outputlinelen, register char **nxtbuf; register char **ap; register struct comp **savecomp; - int char_read = 0, format_len; + int char_read = 0, format_len, mask; char name[NAMESZ], *scanl, *cp; FILE *out; - umask(~m_gmprot()); + mask = umask(~m_gmprot()); if ((out = fopen (drft, "w")) == NULL) adios (drft, "unable to create"); + umask(mask); + /* get new format string */ cp = new_fs (form, NULL, NULL); format_len = strlen (cp);