bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: texinfo (Re: Owl packages with dangerous "tmp" functions)


From: Eli Zaretskii
Subject: Re: texinfo (Re: Owl packages with dangerous "tmp" functions)
Date: Thu, 4 Jan 2001 11:54:29 +0200 (IST)

On Thu, 4 Jan 2001, Solar Designer wrote:

> I am now attaching the patch against texinfo-4.0.

Thanks.

  -  tempbase = mktemp (concat ("txiXXXXXX", "", ""));
[snip]
  +  tempdir = concat(tempdir, "txi.XXXXXX", "");
  +  retries = 0x1000;
  +  do
  +    {
  +      if (mktemp (tempdir) == NULL)
  +        fatal ("mktemp: %s: %s", tempdir, strerror (errno));
  +      if (mkdir (tempdir, 0700) == 0) break;
  +      if (errno != EEXIST || !--retries)
  +        fatal ("mkdir: %s: %s", tempdir, strerror (errno));
  +      if ((dot = strrchr (tempdir, '.')))
  +        strcpy (dot, ".XXXXXX");
  +    }
  +  while (1);

This will break on systems with 8+3 limitations on file names (yes, 
Texinfo supports those systems).  Why did you need the dot?

Also, isn't it better to use mkstemp, if that's available?

  +  atexit(flush_tempfiles_atexit);

Can we depend on atexit be available on all supported platforms?

> That other bug I mentioned is this:
> 
> -      sort_in_core (&tempfiles[i], MAX_IN_CORE_SORT, newtemp);
> +      sort_in_core (tempfiles[i], MAX_IN_CORE_SORT, newtemp);

??? Are you sure?  sort_in_core accepts a "char **" as its first argument, 
while tempfiles[i] is a "char *".



reply via email to

[Prev in Thread] Current Thread [Next in Thread]