Changeset 1737

Show
Ignore:
Timestamp:
11/27/06 19:21:17 (2 years ago)
Author:
nahuel
Message:

Corrige une faille critique permettant de creer un sous domaine pointant sur / du systÚme

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • alternc/trunk/bureau/class/functions.php

    r1728 r1737  
    196196  if (substr($path,0,1)=="/") 
    197197    $path="/".$path; 
    198   if (is_dir("/var/alternc/html/$usar/$user$path")) { 
    199     return 1; 
    200   } 
    201   if (is_file("/var/alternc/html/$usar/$user$path")) { 
    202     return 2; 
     198 
     199  $rpath = realpath("/var/alternc/html/$usar/$user$path"); 
     200  $userpath = realpath("/var/alternc/html/$usar/$user"); 
     201  if(strpos($rpath,$userpath) === 0){ 
     202    if (is_dir("/var/alternc/html/$usar/$user$path")) { 
     203        return 1; 
     204    } 
     205    if (is_file("/var/alternc/html/$usar/$user$path")) { 
     206      return 2; 
     207    } 
    203208  } 
    204209  return 0;