> On Jan. 11, 2017, 10:11 a.m., Jiang Yan Xu wrote:
> > I feel if we keep `os::system()` in the codebase at all, this is one of the few
places it could actually be used... we could eliminate it so we can say there's no references
to `os::systems()` left today but it's a bit harsh to nit-picking on future use like this
in order to keep a "clean state"?
>
> James Peach wrote:
> I don't consider this harsh, just a minor, obvious improvement. While `system()`
is safe, `spawn()` is slightly better because it doesn't use the shell. We can't completely
eliminate `system()` because there are places that actually require the shell (eg. the port
mapping CNI plugin).
>
> Jiang Yan Xu wrote:
> OK I guess if the command is a static string and trivial enough *and some shell features
make it easier to write* then os::system still fine. For this case yes we can replace it.
As long as `ifconfig` is guaranteed to be an elf binary and not a script I think this should
be ok. Looked at a few distributions and seems like that is the case.
- Avinash
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55238/#review161200
-----------------------------------------------------------
On Jan. 12, 2017, 12:26 a.m., James Peach wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55238/
> -----------------------------------------------------------
>
> (Updated Jan. 12, 2017, 12:26 a.m.)
>
>
> Review request for mesos, Avinash sridharan and Jiang Yan Xu.
>
>
> Bugs: MESOS-6862
> https://issues.apache.org/jira/browse/MESOS-6862
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Use os::spawn in the CNI isolator.
>
>
> Diffs
> -----
>
> src/slave/containerizer/mesos/isolators/network/cni/cni.cpp ea91c71fdfac48a2fc1d31a0ee088a73244be367
>
> Diff: https://reviews.apache.org/r/55238/diff/
>
>
> Testing
> -------
>
> `sudo make check` (Fedora 25)
>
>
> Thanks,
>
> James Peach
>
>
|