MCPcopy Create free account
hub / github.com/apache/mesos / chmodExecutable

Function chmodExecutable

src/launcher/fetcher.cpp:266–279  ·  view source on GitHub ↗

TODO(bernd-mesos): Refactor this into stout so that we can more easily chmod an executable. For example, we could define some static flags so that someone can do: os::chmod(path, EXECUTABLE_CHMOD_FLAGS).

Source from the content-addressed store, hash-verified

264// chmod an executable. For example, we could define some static flags
265// so that someone can do: os::chmod(path, EXECUTABLE_CHMOD_FLAGS).
266static Try<string> chmodExecutable(const string& filePath)
267{
268 // TODO(coffler): Fix Windows chmod handling, see MESOS-3176.
269#ifndef __WINDOWS__
270 Try<Nothing> chmod = os::chmod(
271 filePath, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
272 if (chmod.isError()) {
273 return Error("Failed to chmod executable '" +
274 filePath + "': " + chmod.error());
275 }
276#endif // __WINDOWS__
277
278 return filePath;
279}
280
281
282// Returns the resulting file or in case of extraction the destination

Callers 2

fetchBypassingCacheFunction · 0.85
fetchFromCacheFunction · 0.85

Calls 4

chmodFunction · 0.85
errorMethod · 0.65
ErrorFunction · 0.50
isErrorMethod · 0.45

Tested by

no test coverage detected