Changeset 40


Ignore:
Timestamp:
Apr 21, 2005, 3:41:48 PM (19 years ago)
Author:
arnault
Message:

Improve the security of the path lookup for path_append and path_prepend - See CL 268

Location:
CMT/HEAD
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/ChangeLog

    r39 r40  
    66        * source/cmt_symbol.cxx (find_path_entry): Look for existing PATH
    77        entries by comparing the real path rather than the logical
    8         path. Use pwd everywhere.
     8        path. Use pwd everywhere (or CmtSystem::compress_path when the
     9        path is not exactly found)
     10       
    911
    10122005-04-14  Christian Arnault  <arnault@lal.in2p3.fr> 267
  • CMT/HEAD/source/cmt_symbol.cxx

    r39 r40  
    19411941
    19421942  cmt_string here = CmtSystem::pwd ();
    1943 
    1944   CmtSystem::cd (value);
    1945   cmt_string rvalue = CmtSystem::pwd ();
     1943  cmt_string rvalue = value;
     1944
     1945  if (CmtSystem::cd (value))
     1946    {
     1947      rvalue = CmtSystem::pwd ();
     1948    }
     1949  else
     1950    {
     1951      CmtSystem::compress_path (rvalue);
     1952    }
    19461953
    19471954  CmtSystem::cmt_string_vector items;
     
    19531960    {
    19541961      const cmt_string& item = items[i];
    1955       CmtSystem::cd (item);
    1956       cmt_string ritem = CmtSystem::pwd ();
     1962      cmt_string ritem = item;
     1963      if (CmtSystem::cd (item))
     1964        {
     1965          ritem = CmtSystem::pwd ();
     1966        }
     1967      else
     1968        {
     1969          CmtSystem::compress_path (ritem);
     1970        }
     1971
    19571972      if (ritem == rvalue)
    19581973        {
Note: See TracChangeset for help on using the changeset viewer.