Module Name:    xsrc
Committed By:   christos
Date:           Sun Apr 24 17:37:02 UTC 2016

Modified Files:
        xsrc/external/mit/xman/dist: search.c

Log Message:
CID 987986: Set umask before mkstemp


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 xsrc/external/mit/xman/dist/search.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xman/dist/search.c
diff -u xsrc/external/mit/xman/dist/search.c:1.1.1.3 xsrc/external/mit/xman/dist/search.c:1.2
--- xsrc/external/mit/xman/dist/search.c:1.1.1.3	Sun Jul 19 19:00:54 2015
+++ xsrc/external/mit/xman/dist/search.c	Sun Apr 24 13:37:02 2016
@@ -153,7 +153,7 @@ DoSearch(ManpageGlobals * man_globals, i
     char string_buf[BUFSIZ], cmp_str[BUFSIZ], error_buf[BUFSIZ];
     char *search_string = SearchString(man_globals);
     FILE *file;
-    int fd;
+    int fd, omask;
     int count;
     Boolean flag;
 
@@ -180,7 +180,9 @@ DoSearch(ManpageGlobals * man_globals, i
         char label[BUFSIZ];
 
         strcpy(tmp, MANTEMP);   /* get a temp file. */
+	omask = umask(077);
         fd = mkstemp(tmp);
+	umask(omask);
         if (fd < 0) {
             PopupWarning(man_globals, "Cant create temp file");
             return NULL;

Reply via email to