mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jiang Yan Xu <...@jxu.me>
Subject Re: Review Request 55242: Stop using os::system to chown a directory hierarchy.
Date Tue, 17 Jan 2017 19:15:20 GMT

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


Fix it, then Ship it!




Just some style nits.


3rdparty/stout/include/stout/os/posix/chown.hpp (line 48)
<https://reviews.apache.org/r/55242/#comment232929>

    We rarely use C-style comments unless there's code following it on the same line.
    
    We also use complete sentences (capitalization and punctuations, etc.) even though these
are incomplete sentences.
    
    e.g.,
    
    ```
    // Preorder directory.
    ```
    
    Here and below.



3rdparty/stout/include/stout/os/posix/chown.hpp (line 55)
<https://reviews.apache.org/r/55242/#comment232932>

    When cases blocks are are not single line, use `{}` to enclose them.



3rdparty/stout/include/stout/os/posix/chown.hpp (line 74)
<https://reviews.apache.org/r/55242/#comment232931>

    Use a `default` statement to be explict about ignoring other values (we are not capturing
all possible fts cases and we are switching on an integer): https://google.github.io/styleguide/cppguide.html#Loops_and_Switch_Statements
    
    ```
    default:
      break
    ```



3rdparty/stout/tests/os_tests.cpp (lines 753 - 755)
<https://reviews.apache.org/r/55242/#comment232928>

    About the previous comment: s/tree/subtree/
    
    "the top of the tree" is `chown` right? Here you are making a symlink "two.link" to "chown/one/two",
which is at most the top of a subtree. Of course the subtree is still a "tree" but "subtree"
is at least bit more clear?


- Jiang Yan Xu


On Jan. 13, 2017, 3:12 p.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55242/
> -----------------------------------------------------------
> 
> (Updated Jan. 13, 2017, 3:12 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-6862
>     https://issues.apache.org/jira/browse/MESOS-6862
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Reimplement os::chown() to use fts(3) rather than sometimes spawning
> chown(1). This removes the use of the shell and the corresponding
> need to sanitize path arguments.  It also enables us to provide
> consistent handling of symbolic links for the recursive and
> non-recursive cases. We ensure that symlinks are never followed
> and that we always change the ownership of the link itself, not
> its referent.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/os/posix/chown.hpp c82e2e574019c5ee5f17ea105a6d225006388a45

>   3rdparty/stout/include/stout/os/posix/stat.hpp 1ab20e75fc18b336162b62e2f4f23b68f6685183

>   3rdparty/stout/tests/os_tests.cpp 30735e28a26ff713469711d63538676ed4e327d9 
> 
> Diff: https://reviews.apache.org/r/55242/diff/
> 
> 
> Testing
> -------
> 
> `sudo make check` (Fedora 25)
> 
> 
> Thanks,
> 
> James Peach
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message