| Index: base/file_util_posix.cc
|
| diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc
|
| index f566efb1a542fba67a997fd4a56c696f976deea5..f3a7553148721a34ca190c86e5fda45646f9a5b7 100644
|
| --- a/base/file_util_posix.cc
|
| +++ b/base/file_util_posix.cc
|
| @@ -623,6 +623,22 @@ bool CreateDirectoryAndGetError(const FilePath& full_path,
|
| return true;
|
| }
|
|
|
| +bool NormalizeFilePath(const FilePath& path, FilePath* normalized_path) {
|
| + FilePath real_path_result;
|
| + if (!RealPath(path, &real_path_result))
|
| + return false;
|
| +
|
| + // To be consistant with windows, fail if |real_path_result| is a
|
| + // directory.
|
| + stat_wrapper_t file_info;
|
| + if (CallStat(real_path_result.value().c_str(), &file_info) != 0 ||
|
| + S_ISDIR(file_info.st_mode))
|
| + return false;
|
| +
|
| + *normalized_path = real_path_result;
|
| + return true;
|
| +}
|
| +
|
| } // namespace base
|
|
|
| // -----------------------------------------------------------------------------
|
| @@ -637,7 +653,6 @@ using base::DirectoryExists;
|
| using base::FileEnumerator;
|
| using base::FilePath;
|
| using base::MakeAbsoluteFilePath;
|
| -using base::RealPath;
|
| using base::VerifySpecificPathControlledByUser;
|
|
|
| base::FilePath MakeUniqueDirectory(const base::FilePath& path) {
|
| @@ -804,22 +819,6 @@ bool SetCurrentDirectory(const FilePath& path) {
|
| return !ret;
|
| }
|
|
|
| -bool NormalizeFilePath(const FilePath& path, FilePath* normalized_path) {
|
| - FilePath real_path_result;
|
| - if (!RealPath(path, &real_path_result))
|
| - return false;
|
| -
|
| - // To be consistant with windows, fail if |real_path_result| is a
|
| - // directory.
|
| - stat_wrapper_t file_info;
|
| - if (CallStat(real_path_result.value().c_str(), &file_info) != 0 ||
|
| - S_ISDIR(file_info.st_mode))
|
| - return false;
|
| -
|
| - *normalized_path = real_path_result;
|
| - return true;
|
| -}
|
| -
|
| bool VerifyPathControlledByUser(const FilePath& base,
|
| const FilePath& path,
|
| uid_t owner_uid,
|
|
|