mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-11 08:10:58 +00:00
- stat() should probably not say whether or not the target file is a symlink - presumably that's something only lstat() should do
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@163 21d32557-59b3-4da0-833f-c5933fad653e
This commit is contained in:
parent
893695d7f3
commit
48494b64c8
@ -771,7 +771,15 @@ class Net_SFTP extends Net_SSH2 {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->_identify_type($filename, NET_SFTP_STAT, NET_SFTP_LSTAT);
|
||||
$stat = $this->_stat($filename, NET_SFTP_STAT);
|
||||
|
||||
$pwd = $this->pwd;
|
||||
$stat['type'] = $this->chdir($filename) ?
|
||||
NET_SFTP_TYPE_DIRECTORY :
|
||||
NET_SFTP_TYPE_REGULAR;
|
||||
$this->pwd = $pwd;
|
||||
|
||||
return $stat;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -794,7 +802,20 @@ class Net_SFTP extends Net_SSH2 {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->_identify_type($filename, NET_SFTP_LSTAT, NET_SFTP_STAT);
|
||||
$lstat = $this->_stat($filename, NET_SFTP_LSTAT);
|
||||
$stat = $this->_stat($filename, NET_SFTP_STAT);
|
||||
|
||||
if ($lstat != $stat) {
|
||||
return array_merge($lstat, array('type' => NET_SFTP_TYPE_SYMLINK));
|
||||
}
|
||||
|
||||
$pwd = $this->pwd;
|
||||
$lstat['type'] = $this->chdir($filename) ?
|
||||
NET_SFTP_TYPE_DIRECTORY :
|
||||
NET_SFTP_TYPE_REGULAR;
|
||||
$this->pwd = $pwd;
|
||||
|
||||
return $lstat;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user