You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Jason Lai <ja...@jasonlai.net> on 2018/09/21 22:34:22 UTC

Review Request 68804: Added Stout `os::readlink` function for POSIX paths.

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68804/
-----------------------------------------------------------

Review request for mesos, Eric Chung, Gilbert Song, Jie Yu, James Peach, and Zhitao Li.


Bugs: MESOS-8257
    https://issues.apache.org/jira/browse/MESOS-8257


Repository: mesos


Description
-------

Added `os::readlink` for reading value of a POSIX symbolic link.


Diffs
-----

  3rdparty/stout/include/stout/os/posix/readlink.hpp PRE-CREATION 


Diff: https://reviews.apache.org/r/68804/diff/1/


Testing
-------


Thanks,

Jason Lai


Re: Review Request 68804: Added Stout `os::readlink` function for POSIX paths.

Posted by Jason Lai <ja...@jasonlai.net>.

> On Sept. 21, 2018, 10:53 p.m., Eric Chung wrote:
> > 3rdparty/stout/include/stout/os/posix/readlink.hpp
> > Lines 34 (patched)
> > <https://reviews.apache.org/r/68804/diff/1/?file=2091016#file2091016line34>
> >
> >     should the commented lines be removed?

No. If you look at the rest of the repo, it's just the convention here.


- Jason


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68804/#review208899
-----------------------------------------------------------


On Sept. 21, 2018, 10:34 p.m., Jason Lai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68804/
> -----------------------------------------------------------
> 
> (Updated Sept. 21, 2018, 10:34 p.m.)
> 
> 
> Review request for mesos, Eric Chung, Gilbert Song, Jie Yu, James Peach, and Zhitao Li.
> 
> 
> Bugs: MESOS-8257
>     https://issues.apache.org/jira/browse/MESOS-8257
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Added `os::readlink` for reading value of a POSIX symbolic link.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/os/posix/readlink.hpp PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/68804/diff/1/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Jason Lai
> 
>


Re: Review Request 68804: Added Stout `os::readlink` function for POSIX paths.

Posted by Eric Chung <ci...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68804/#review208899
-----------------------------------------------------------




3rdparty/stout/include/stout/os/posix/readlink.hpp
Lines 34 (patched)
<https://reviews.apache.org/r/68804/#comment293175>

    should the commented lines be removed?


- Eric Chung


On Sept. 21, 2018, 10:34 p.m., Jason Lai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68804/
> -----------------------------------------------------------
> 
> (Updated Sept. 21, 2018, 10:34 p.m.)
> 
> 
> Review request for mesos, Eric Chung, Gilbert Song, Jie Yu, James Peach, and Zhitao Li.
> 
> 
> Bugs: MESOS-8257
>     https://issues.apache.org/jira/browse/MESOS-8257
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Added `os::readlink` for reading value of a POSIX symbolic link.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/os/posix/readlink.hpp PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/68804/diff/1/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Jason Lai
> 
>


Re: Review Request 68804: Added Stout `os::readlink` function for POSIX paths.

Posted by Eric Chung <ci...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68804/#review208902
-----------------------------------------------------------


Ship it!




Ship It!

- Eric Chung


On Sept. 21, 2018, 10:34 p.m., Jason Lai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68804/
> -----------------------------------------------------------
> 
> (Updated Sept. 21, 2018, 10:34 p.m.)
> 
> 
> Review request for mesos, Eric Chung, Gilbert Song, Jie Yu, James Peach, and Zhitao Li.
> 
> 
> Bugs: MESOS-8257
>     https://issues.apache.org/jira/browse/MESOS-8257
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Added `os::readlink` for reading value of a POSIX symbolic link.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/os/posix/readlink.hpp PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/68804/diff/1/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Jason Lai
> 
>


Re: Review Request 68804: Added Stout `os::readlink` function for POSIX paths.

Posted by James Peach <jp...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68804/#review210424
-----------------------------------------------------------



Can you please add a simple test case? Just update `FsTest.SYMLINK_Symlink` to read back the symlink is fine.

3rdparty/stout/tests/os/filesystem_tests.cpp


3rdparty/stout/include/stout/os/posix/readlink.hpp
Lines 24 (patched)
<https://reviews.apache.org/r/68804/#comment295089>

    For consistency, we should have a Windows version that does:
    ```
    Try<std::string> readlink(const std::string& path) = delete;
    ```



3rdparty/stout/include/stout/os/posix/readlink.hpp
Lines 27 (patched)
<https://reviews.apache.org/r/68804/#comment295088>

    To detect truncation we should do something like this:
    ```
    char temp[PATH_MAX + 1];
    ssize_t len = ::readlink(path.c_str(), temp, sizeof(temp));
    if (len == -1) {
      return ErrnoError();
    }
    
    // Name is truncated and not NUL-terminated.
    if (len >= sizeof(temp)) {
      return ErrnoError(ENAMETOOLONG);
    }
      
    return std::string(temp);
    ```


- James Peach


On Nov. 7, 2018, 9:22 p.m., Jason Lai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68804/
> -----------------------------------------------------------
> 
> (Updated Nov. 7, 2018, 9:22 p.m.)
> 
> 
> Review request for mesos, Eric Chung, Gilbert Song, Jie Yu, James Peach, and Zhitao Li.
> 
> 
> Bugs: MESOS-8257
>     https://issues.apache.org/jira/browse/MESOS-8257
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Added `os::readlink` for reading value of a POSIX symbolic link.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/os/posix/readlink.hpp PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/68804/diff/2/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Jason Lai
> 
>


Re: Review Request 68804: Added Stout `os::readlink` function for POSIX paths.

Posted by Jason Lai <ja...@jasonlai.net>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68804/
-----------------------------------------------------------

(Updated Nov. 7, 2018, 9:22 p.m.)


Review request for mesos, Eric Chung, Gilbert Song, Jie Yu, James Peach, and Zhitao Li.


Changes
-------

Rebased to master


Bugs: MESOS-8257
    https://issues.apache.org/jira/browse/MESOS-8257


Repository: mesos


Description
-------

Added `os::readlink` for reading value of a POSIX symbolic link.


Diffs (updated)
-----

  3rdparty/stout/include/stout/os/posix/readlink.hpp PRE-CREATION 


Diff: https://reviews.apache.org/r/68804/diff/2/

Changes: https://reviews.apache.org/r/68804/diff/1-2/


Testing
-------


Thanks,

Jason Lai