Hi,
ok the first patch wasn't secure.
Here is a second version.
Regards Nico

-- 
Nico Golde - [EMAIL PROTECTED] | GPG: 1024D/73647CFF
http://www.ngolde.de | http://www.muttng.org | http://grml.org 
VIM has two modes - the one in which it beeps 
and the one in which it doesn't -- encrypted mail preferred
--- /tmp/screen-4.0.2/fileio.c  2003-09-08 16:25:28.000000000 +0200
+++ fileio.c    2005-05-13 10:32:23.000000000 +0200
@@ -2,6 +2,8 @@
  *      Juergen Weigert ([EMAIL PROTECTED])
  *      Michael Schroeder ([EMAIL PROTECTED])
  * Copyright (c) 1987 Oliver Laumann
+ * A part for the configuration file loading was written by
+ * Nico Golde <[EMAIL PROTECTED]>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -291,13 +293,23 @@
 do_source(rcfilename)
 char *rcfilename;
 {
+  char * home = getenv("HOME");
+
   if (rc_recursion > 10)
     {
       Msg(0, "%s: source: recursion limit reached", rc_name);
       return;
     }
   rc_recursion++;
-  FinishRc(rcfilename);
+  if(!home) 
+    FinishRc(rcfilename);
+  else{
+    if (strncmp(rcfilename,"~/",2)==0) {
+      char * tmp_file = alloca(_POSIX_PATH_MAX+1);
+      snprintf(tmp_file,_POSIX_PATH_MAX+1,"%s/%s",home,rcfilename+2);
+      FinishRc(tmp_file);
+    } 
+  } 
   rc_recursion--;
 }
 

Attachment: pgpJx21vgzOwB.pgp
Description: PGP signature

_______________________________________________
screen-users mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/screen-users

Reply via email to