Details
-
Task
-
Status: Resolved
-
Major
-
Resolution: Invalid
-
1.5.0
-
None
Description
The os::permissions() function is implemented using stat():
inline Try<Permissions> permissions(const std::string& path) { struct stat status; if (::stat(path.c_str(), &status) < 0) { return ErrnoError(); } return Permissions(status.st_mode); }
This works pretty well except in cases where the file given is a symlink, since symlinks are created with full 777 permissions but defer all the security questions to the real file, so probably this function should be implemented using lstat() instead, unless not following symlinks was the original intention.