X-Git-Url: http://git.home-dn.net/?p=manu%2Fsuphp.git;a=blobdiff_plain;f=src%2FAPI_Linux.cpp;h=97c1e902902b49acdd16e209ae344ecdc4d0d0dc;hp=a504603ae8ee1c008d8d8e4443253623df0763ca;hb=15131cc4552b38de0638fa84164e509b05bb6c11;hpb=aec8b88e8222617959b869d62d7801642138cf7a diff --git a/src/API_Linux.cpp b/src/API_Linux.cpp index a504603..97c1e90 100644 --- a/src/API_Linux.cpp +++ b/src/API_Linux.cpp @@ -225,10 +225,10 @@ std::string suPHP::API_Linux::GroupInfo_getGroupname(const GroupInfo& ginfo) bool suPHP::API_Linux::File_exists(const File& file) const { struct stat dummy; - if (::lstat(file.getPath().c_str(), &dummy) == 0) - return true; + if (::stat(file.getPath().c_str(), &dummy) == 0) + return true; else - return false; + return false; } std::string suPHP::API_Linux::File_getRealPath(const File& file) const @@ -304,7 +304,7 @@ std::string suPHP::API_Linux::File_getRealPath(const File& file) const bool suPHP::API_Linux::File_hasPermissionBit(const File& file, FileMode perm) const throw (SystemException) { struct stat temp; - if (lstat(file.getPath().c_str(), &temp) == -1) { + if (stat(file.getPath().c_str(), &temp) == -1) { throw SystemException(std::string("Could not stat \"") + file.getPath() + "\": " + ::strerror(errno), __FILE__, __LINE__); @@ -362,7 +362,7 @@ bool suPHP::API_Linux::File_hasPermissionBit(const File& file, FileMode perm) UserInfo suPHP::API_Linux::File_getUser(const File& file) const throw (SystemException) { struct stat temp; - if (lstat(file.getPath().c_str(), &temp) == -1) { + if (stat(file.getPath().c_str(), &temp) == -1) { throw SystemException(std::string("Could not stat \"") + file.getPath() + "\": " + ::strerror(errno), __FILE__, __LINE__); @@ -373,7 +373,7 @@ UserInfo suPHP::API_Linux::File_getUser(const File& file) const GroupInfo suPHP::API_Linux::File_getGroup(const File& file) const throw (SystemException) { struct stat temp; - if (lstat(file.getPath().c_str(), &temp) == -1) { + if (stat(file.getPath().c_str(), &temp) == -1) { throw SystemException(std::string("Could not stat \"") + file.getPath() + "\": " + ::strerror(errno), __FILE__, __LINE__); @@ -382,11 +382,6 @@ GroupInfo suPHP::API_Linux::File_getGroup(const File& file) const } -bool suPHP::API_Linux::File_isSymlink(const File& file) const throw (SystemException) { - return this->isSymlink(file.getPath()); -} - - void suPHP::API_Linux::execute(std::string program, const CommandLine& cline, const Environment& env) const throw (SystemException) {