[21481] in Athena Bugs

home help back first fref pref prev next nref lref last post

sun4 9.1.22: pine

daemon@ATHENA.MIT.EDU (Nickolai Zeldovich)
Fri Feb 14 14:39:02 2003

Date: Fri, 14 Feb 2003 14:38:58 -0500 (EST)
From: Nickolai Zeldovich <kolya@MIT.EDU>
To: <bugs@MIT.EDU>
Message-ID: <Pine.GSO.4.33L.0302141429220.22618-100000@contents-vnder-pressvre.mit.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

Pine periodically saves messages that I'm composing into files of the form
~/#picoNNNNN#.  If my home directory is world-readable, this behavior is
kind-of unfortunate.  On my own non-Athena machines, I patched pico some
time ago as shown below, which allows "setenv PICO_TMP_PREFIX .priv/" to
specify that pine should use ~/.priv/#picoNNNNN#.  Probably this isn't
quite the way it should be fixed on Athena, though.

-- kolya

--- pico/osdep/unix	2001/04/17 07:56:29	1.1
+++ pico/osdep/unix	2001/04/17 08:05:18	1.2
@@ -3355,6 +3355,12 @@
 {
     unsigned pid;
     char    *chp;
+    char    *prefix;
+    char     template[256];
+
+    prefix = getenv("PICO_TMP_PREFIX");
+    snprintf(template, sizeof(template), "%s%s",
+	     prefix ? prefix : "", "#picoXXXXX#");

     if(!file[0]){
 	long gmode_save = gmode;
@@ -3362,7 +3368,7 @@
 	if(gmode&MDCURDIR)
 	  gmode &= ~MDCURDIR;  /* so fixpath will use home dir */

-	strcpy(file, "#picoXXXXX#");
+	strcpy(file, template);
 	fixpath(file, NLINE);
 	gmode = gmode_save;
     }
@@ -3374,7 +3380,7 @@
 	    file[l]   = '\0';
 	}

-	strcpy(file + l, "#picoXXXXX#");
+	strcpy(file + l, template);
     }

     pid = (unsigned)getpid();


home help back first fref pref prev next nref lref last post