Your message dated Mon, 21 Apr 2014 10:57:40 +0000
with message-id <[email protected]>
and subject line Bug#743429: Removed package(s) from unstable
has caused the Debian Bug report #554566,
regarding xlhtml: should honor TMPDIR environment variable
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
554566: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=554566
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: xlhtml
Version: 0.5.1-6
Severity: wishlist

Current version of xlhtml (and ppthtml for that matter) fails to convert
large input files to html. This happens only if an amount of free space
in filesystem where /tmp belongs is insufficient. 
xlhtml spits and error message in such situation, which is far from being
userfriendly (:)) and is misleading:

xlhtml: cole: no such file or directory

Simply stracing xlhtml reveals the truth.

The reason for this is hardcoded filenames for temporary files in cole 
library, which is statically linked into xlhtml and ppthtml binaries.
Specifically, cole/internal.c and cole/oledecod.c invoke mkstemp() 
with filenames such as /tmp/xlHtmlXXXXXX.

While environment variable TMPDIR exists to handle such situations, mkstemp()
doesn't use it.

So, in order to solve this issue, I wrote this small patch (attached to this 
bug) to implement TMPDIR handling. While it is far from being perfect, 
it works for me.

It would be nice if this (or similar) change made its way into Debian package.


-- System Information:
Debian Release: 5.0.3
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages xlhtml depends on:
ii  libc6                         2.7-18     GNU C Library: Shared libraries

xlhtml recommends no packages.

xlhtml suggests no packages.

-- debconf-show failed
--- a/cole/internal.h	2009-11-05 11:41:01.000000000 +0000
+++ b/cole/internal.h	2009-11-05 11:41:22.000000000 +0000
@@ -36,7 +36,7 @@
 #if defined( __WIN32__ ) || defined( __BORLANDC__ )
 #define TMPNAM_LEN		L_tmpnam
 #else
-#define TMPNAM_LEN		18	/* /tmp/xlHtmlXXXXXX + NULL */
+#define TMPNAM_LEN		255 /* /tmp/xlHtmlXXXXXX + NULL */
 #endif
 
 /* This structure describe one stream. */
--- a/cole/internal.c	2009-11-05 11:13:28.000000000 +0000
+++ b/cole/internal.c	2009-11-05 11:29:46.000000000 +0000
@@ -64,12 +64,29 @@
 	}
 #else
 	int ret;
+	const char *tmpdir;
+
+	tmpdir = (char *)getenv("TMPDIR");
+
+	if (tmpdir == NULL)
+		*filename = malloc (TMPNAM_LEN);
+	else
+		*filename = malloc (TMPNAM_LEN+strlen(tmpdir)-4);
 
-	*filename = malloc (TMPNAM_LEN);
 	if (*filename == NULL)
 		return 1;
 
-	strcpy(*filename, "/tmp/xlHtmlXXXXXX");
+	if (tmpdir == NULL)
+		strcpy(*filename, "/tmp/xlHtmlXXXXXX");
+	else
+	{
+		char *buf = (char *)malloc(strlen(tmpdir) + 13);
+		strcpy(buf,tmpdir);
+		strcat(buf,"/xlHtmlXXXXXX");
+		strcpy(*filename, buf);
+		free(buf);
+	}
+
 	ret = mkstemp(*filename);
 	if (ret == -1)	{
 		free(*filename);
--- a/cole/oledecod.c	2009-11-05 11:13:18.000000000 +0000
+++ b/cole/oledecod.c	2009-11-05 11:43:41.000000000 +0000
@@ -484,11 +484,28 @@
 #else
 	{
 		int ret;
+		const char *tmpdir;
+
+		tmpdir = (char *)getenv("TMPDIR");
+
+		if (tmpdir == NULL)
+			*_sbfilename = (U8 *)malloc (TMPNAM_LEN);
+		else
+			*_sbfilename = (U8 *)malloc (TMPNAM_LEN+strlen(tmpdir)-4);
 
-		*_sbfilename = (U8 *)malloc (TMPNAM_LEN);
 		test_exitf (*_sbfilename != NULL, 10, ends ());
 
-		strcpy(*_sbfilename, "/tmp/xlHtmlXXXXXX");
+		if (tmpdir == NULL)
+			strcpy(*_sbfilename, "/tmp/xlHtmlXXXXXX");
+		else
+		{
+			char *buf = (char *)malloc(strlen(tmpdir) + 13);
+			strcpy(buf,tmpdir);
+			strcat(buf,"/xlHtmlXXXXXX");
+			strcpy(*_sbfilename, buf);
+			free(buf);
+		}
+
 		ret = mkstemp(*_sbfilename);
 		if (ret == -1)	{
 			free(*_sbfilename);
@@ -515,8 +532,21 @@
 		OLEfile = fopen (pps_list[i].filename, "wb");
 #else
 		int ret;
+		static char *tmpdir;
+
+		tmpdir = getenv("TMPDIR");
+
+		if (tmpdir == NULL)
+			strcpy(pps_list[i].filename, "/tmp/xlHtmlXXXXXX");
+		else
+		{
+	        char *buf = (char *)malloc(strlen(tmpdir) + 13);
+			strcpy(buf,tmpdir);
+			strcat(buf,"/xlHtmlXXXXXX");
+			strcpy(pps_list[i].filename, buf);
+			free(buf);
+		}
 
-		strcpy(pps_list[i].filename, "/tmp/xlHtmlXXXXXX");
 		ret = mkstemp(pps_list[i].filename);
 		test_exitf (ret == -1, 7, ends ());
 		OLEfile = fdopen(ret, "wb");

--- End Message ---
--- Begin Message ---
Version: 0.5.1-6+rm

Dear submitter,

as the package xlhtml has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see https://bugs.debian.org/743429

The version of this package that was in Debian prior to this removal
can still be found using http://snapshot.debian.org/.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
[email protected].

Debian distribution maintenance software
pp.
Ansgar Burchardt (the ftpmaster behind the curtain)

--- End Message ---

Reply via email to