Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-8821

stout's `os::permissions()` does not follow symlinks

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • 1.5.0
    • None
    • stout

    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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            arojas Alexander Rojas
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: