From 19b47ea980a98d01112d4bda1d220c7057818ff1 Mon Sep 17 00:00:00 2001 From: Glenn Burkhardt Date: Thu, 26 Jun 2003 01:30:36 +0000 Subject: [PATCH] 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 --- uip/replsbr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); -- 1.7.10.4