Alexander Rojas created MESOS-8821:
--------------------------------------
Summary: stout's `os::permissions()` does not follow symlinks
Key: MESOS-8821
URL: https://issues.apache.org/jira/browse/MESOS-8821
Project: Mesos
Issue Type: Task
Components: stout
Affects Versions: 1.5.0
Reporter: Alexander Rojas
The {{os::permissions()}} function is implemented using {{stat()}}:
{code}
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);
}
{code}
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.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)