1 --- pinfo-0.6.0/src/manual.c.mkstemp Wed Aug 2 14:14:21 2000
2 +++ pinfo-0.6.0/src/manual.c Wed Aug 2 14:25:11 2000
5 int ignored_items = 0, i = 0;
7 + char tempbuf[PATH_MAX] = "/tmp/pinfoXXXXXX";
12 unlink (tmpfilename1);
15 - tmpfilename1 = tempnam ("/tmp", NULL);
16 + fd = mkstemp(tempbuf);
17 + fchmod(fd, S_IRUSR | S_IWUSR);
19 + tmpfilename1 = strdup(tempbuf);
24 if (ignoredmacros) /* if the pointer is non-null */
25 if (*ignoredmacros && strlen (ignoredmacros)) /* if there are some macros */
26 { /* that should be ignored */
27 + char tempbuf[PATH_MAX] = "/tmp/pinfoXXXXXX";
30 snprintf (cmd, 255, "man -W %s %s", /* we need to know the path */
35 source = fopen (location, "r"); /* from cmd output */
36 - name = tempnam ("/tmp", NULL);
37 + fd = mkstemp(tempbuf);
38 + fchmod(fd, S_IRUSR | S_IWUSR);
39 + name = strdup(tempbuf);
40 raw_tempfilename = name;
41 - id = fopen (name, "w");
42 + id = fdopen (fd, "w");
44 while (!feof (source)) /* we read until eof */
47 manual_aftersearch = 0;
48 if (return_value != -1) /* -1 is quit key */
50 + char tempbuf[PATH_MAX] = "/tmp/pinfoXXXXXX";
54 unlink (tmpfilename2);
57 - tmpfilename2 = tempnam ("/tmp", NULL);
58 + fd = mkstemp(tempbuf);
59 + fchmod(fd, S_IRUSR | S_IWUSR);
61 + tmpfilename2 = strdup(tempbuf);
62 if (return_value != -2) /* key_back is not pressed;
63 and return_value is an
64 offset to manuallinks */
65 --- pinfo-0.6.0/src/filehandling_functions.c.mkstemp Wed Aug 2 14:14:26 2000
66 +++ pinfo-0.6.0/src/filehandling_functions.c Wed Aug 2 14:25:42 2000
69 if (number == 0) /* initialize tmp filename for file 1 */
71 + char tmpbuf[PATH_MAX] = "/tmp/pinfoXXXXXX";
75 unlink (tmpfilename1); /* erase old tmpfile */
78 - tmpfilename1 = tempnam ("/tmp", NULL);
79 + fd = mkstemp(tmpbuf);
80 + fchmod(fd, S_IRUSR | S_IWUSR);
82 + tmpfilename1 = strdup(tmpbuf);
83 tmpfilename = tmpfilename1; /* later we will refere only to tmp1 */
85 for (i = 0; i < infopathcount; i++) /* go through all paths */
88 if (number == 0) /* initialize tmp filename for file 1 */
90 + char tmpbuf[PATH_MAX] = "/tmp/pinfoXXXXXX";
94 unlink (tmpfilename1); /* erase old tmpfile */
97 - tmpfilename1 = tempnam ("/tmp", NULL);
98 + fd = mkstemp(tmpbuf);
99 + fchmod(fd, S_IRUSR | S_IWUSR);
101 + tmpfilename1 = strdup(tmpbuf);
102 tmpfilename = tmpfilename1; /* later we will refere only to tmp1 */
105 /* initialize tmp filename for file 2 */
107 + char tmpbuf[PATH_MAX] = "/tmp/pinfoXXXXXX";
111 unlink (tmpfilename2); /* erase old tmpfile */
114 - tmpfilename2 = tempnam ("/tmp", NULL);
115 + fd = mkstemp(tmpbuf);
116 + fchmod(fd, S_IRUSR | S_IWUSR);
118 + tmpfilename2 = strdup(tmpbuf);
119 tmpfilename = tmpfilename2; /* later we will refere only to tmp2 */
122 --- pinfo-0.6.0/src/common_includes.h.mkstemp Wed Aug 2 14:22:04 2000
123 +++ pinfo-0.6.0/src/common_includes.h Wed Aug 2 14:22:15 2000
129 #include <sys/types.h>
130 #include <sys/stat.h>