Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / security / tripwire / patches / patch-ae
blob5678b8c3981aeece9add8c09120bfcdf6da211cf
1 $NetBSD: patch-ae,v 1.1 2003/12/05 05:40:32 ben Exp $
3 --- src/config.parse.c.orig     1994-07-20 18:03:26.000000000 -0700
4 +++ src/config.parse.c
5 @@ -55,7 +55,6 @@
6  #endif
7  
8  /* prototypes */
9 -char *mktemp();
10  static void configfile_descend();
12  #ifndef L_tmpnam
13 @@ -90,6 +89,7 @@ configfile_read(pp_list, pp_entry_list)
14      char       number[128];
15      int                entrynum = 0;
16      int                err;
17 +    int                fdout;
19      /* to make code semi-reentrant */
20      list_reset(&prune_list);
21 @@ -105,8 +105,9 @@ configfile_read(pp_list, pp_entry_list)
22      };
23      (void) strcpy(tmpfilename, TEMPFILE_TEMPLATE);
25 -    if ((char *) mktemp(tmpfilename) == NULL) {
26 -       perror("configfile_read: mktemp()");
27 +    fdout = mkstemp(tmpfilename);
28 +    if (fdout == -1) {
29 +       perror("configfile_read: mkstemp()");
30         exit(1);
31      }
33 @@ -149,7 +150,7 @@ configfile_read(pp_list, pp_entry_list)
35      err = umask(077);  /* to protect the tempfile */
37 -    if ((fpout = fopen(tmpfilename, "w+")) == NULL) {
38 +    if ((fpout = fdopen(fdout, "w+")) == NULL) {
39         sprintf(s, "tripwire: Couldn't open config file '%s'", configfile);
40         perror(s);
41         exit(1);