Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 373563 - app-text/mpage-2.5.4 uses outdated /usr/tmp path
Summary: app-text/mpage-2.5.4 uses outdated /usr/tmp path
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Printing (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: NeedPatch
Depends on:
Blocks:
 
Reported: 2011-06-30 10:07 UTC by marc paresseux
Modified: 2012-04-16 10:05 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description marc paresseux 2011-06-30 10:07:52 UTC
app-text/mpage-2.5.4 tries to use /usr/tmp, but /usr/tmp is an outdated location, that does not necessarily exist -- at least it does not exist on my system and the FHS-2.3 mentions it as legacy, which may be supported by a symlink to /var/tmp.

Reproducible: Always

Steps to Reproduce:
1. emerge app-text/mpage-2.5.4
2. dd if=/dev/urandom bs=1k count=1 | base64 | mpage -1 > /dev/null
Actual Results:  
dd if=/dev/urandom bs=1k count=1 | base64 | mpage -1 > /dev/null
1+0 records in
1+0 records out
1024 bytes (1.0 kB) copied, 0.000499162 s, 2.1 MB/s
mpage: cannot create temporary filempage: No such file or directory


I guess, this only happens, if mpage runs in a pipe.

Expected Results:  
A postscript version of the input text file shall be output without complaint {I supressed this in my pipe example}.

file.c contains three hard-coded locations "/usr/tmp/...".
One can replace them with "/tmp/...", respectively.

A patch doing this, is attached {of course the mpage.ebuild file has to be modified to contain a line, bringing this patch into action}.  Since FHS-2.3 proposes /var/tmp as link target for /usr/tmp, one may choose to have /var/tmp instead of /tmp.  But personally, I don't think, it makes sense, that temporary build results have to survive reboots.  From a higher perspective, that focuses on consistency of the gentoo build processes, /var/tmp may also be preferable[, if you do not question this location generally].


mpage-2.5.4-usrtmp.patch:
--- mpage-2.5.4/file.c.orig	2004-05-30 19:34:15.000000000 +0000
+++ mpage-2.5.4/file.c	2011-06-30 09:24:37.000000000 +0000
@@ -168,7 +168,7 @@
      * but the tmpfilename
      */
      
-    (void) strcpy(tmpfile, "/usr/tmp/mpage-stdin-XXXXXX");
+    (void) strcpy(tmpfile, "/tmp/mpage-stdin-XXXXXX");
     if ( (tmpfd = mkstemp(tmpfile)) == -1) {
         fprintf(stderr, "%s: cannot create temporary file", MPAGE);
         perror(MPAGE);
@@ -209,7 +209,7 @@
          * a temporary file; this temporary file will then
          * be used as input to the do_doc routine
          */
-        (void)strcpy(tmpfile, "/usr/tmp/mpageXXXXXX");
+        (void)strcpy(tmpfile, "/tmp/mpageXXXXXX");
         if ( (tmpfd = mkstemp(tmpfile)) == -1) {
             fprintf(stderr, "%s: cannot create temporary file", MPAGE);
             perror(MPAGE);
@@ -280,7 +280,7 @@
 	/*
 	 * store the input to the temporary file to guess encoding correctly
 	 */
-        (void)strcpy(tmpfile, "/usr/tmp/mpageXXXXXX");
+        (void)strcpy(tmpfile, "/tmp/mpageXXXXXX");
         if ( (tmpfd = mkstemp(tmpfile)) == -1) {
             fprintf(stderr, "%s: cannot create temporary file", MPAGE);
 	    tmpfile[0] = 0;
Comment 1 marc paresseux 2011-06-30 10:22:15 UTC
For reasons of cleanness, I'd rather avoid to "ln -s /var/tmp /usr/tmp".  

Old code shall be brought up-to-date to respect a current file system layout.

If you can follow my arguments, it may make sense to forward this bug report|fix to the mpage maintainers to merge it in at the very source.  If from their perspective, one needs more flexibility than my static patch to the static sources, it may be reasonable that they go over to an autoconf-based build and have this setting parametrisable.
Comment 2 SpanKY gentoo-dev 2011-07-01 01:54:36 UTC
it should be using $TMPDIR first, and then falling back to /tmp
Comment 3 Pacho Ramos gentoo-dev 2012-03-06 09:14:07 UTC
Can you provide an updated patch against 2.5.6?
Comment 4 Pacho Ramos gentoo-dev 2012-04-16 10:05:04 UTC
+*mpage-2.5.6-r1 (16 Apr 2012)
+
+  16 Apr 2012; Pacho Ramos <pacho@gentoo.org> +files/01_previous_changes.patch,
+  +files/10_bts354935_fix_fontdefs.patch,
+  +files/20_bts416573_manpage_fixes.patch,
+  +files/30_bts443280_libdir_manpage.patch, +mpage-2.5.6-r1.ebuild,
+  -mpage-2.5.5.ebuild, -mpage-2.5.6.ebuild:
+  Apply debian patches, drop old.
+