mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Schwartzmeyer <and...@schwartzmeyer.com>
Subject Re: Review Request 54514: Add `os::runtime_dir()` to Stout.
Date Thu, 08 Dec 2016 01:59:58 GMT

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

(Updated Dec. 8, 2016, 1:59 a.m.)


Review request for mesos and Alex Clemmer.


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


Repository: mesos


Description (updated)
-------

Encapsulates the platform-specific runtime directories
`/var/run/mesos` and `C:\ProgramData\mesos\runtime`.
Checks for read/write access to `/var/run` and `C:\ProgramData`,
and falls back to `os::temp()/mesos/runtime` on error.

The `os::runtime_dir()` function is introduced to handle both the
platform-specificity of the the runtime data folders and the
error handling in the case of the default folder not being writable.
Note that previously the CLI code checked the usability of
`/var/run/mesos` on POSIX by checking `if (user == "root")`
instead of testing the read and write access of `/var/run`.
This made it so that Mesos would use `/tmp/mesos/runtime`
if it was run as any user other than `root`,
even if that user had write access to `/var/run`.
Checking for permission instead of checking a username
is the preferred way to handle permission checks.


Diffs
-----

  3rdparty/stout/include/stout/posix/os.hpp 8443aa0cf0a8d8d52e36282611c2ab15ca4dd354 
  3rdparty/stout/include/stout/windows/os.hpp 2f20ccc64e255a60a1b7f33d684969942f12e45f 

Diff: https://reviews.apache.org/r/54514/diff/


Testing (updated)
-------

make && make check on Linux: no failures.
msbuild and attach to a master on Windows: no failures.


Thanks,

Andrew Schwartzmeyer


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