MCPcopy Create free account
hub / github.com/dmtcp/dmtcp / isdir0700

Function isdir0700

src/util_exec.cpp:100–110  ·  view source on GitHub ↗

'screen' requires directory with permissions 0700

Source from the content-addressed store, hash-verified

98
99// 'screen' requires directory with permissions 0700
100static int
101isdir0700(const char *pathname)
102{
103 struct stat st;
104
105 stat(pathname, &st);
106 return S_ISDIR(st.st_mode) == 1
107 && (st.st_mode & 0777) == 0700
108 && st.st_uid == getuid()
109 && access(pathname, R_OK | W_OK | X_OK) == 0;
110}
111
112int
113Util::safeMkdir(const char *pathname, mode_t mode)

Callers 1

safeMkdirMethod · 0.85

Calls 2

accessFunction · 0.85
statClass · 0.70

Tested by

no test coverage detected