MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / diag_posix_file_valid

Function diag_posix_file_valid

src/foundation/diagnostics.c:406–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

404#else
405
406static bool diag_posix_file_valid(int descriptor) {
407 struct stat state;
408 return descriptor >= 0 && fstat(descriptor, &state) == 0 && S_ISREG(state.st_mode) &&
409 state.st_uid == geteuid() && state.st_nlink == 1 && (state.st_mode & 07777) == 0600 &&
410 cbm_macos_extended_acl_fd_is_empty(descriptor);
411}
412
413static bool diag_write_file(const char *base_name, const char *data, size_t length, bool append) {
414 int flags = O_WRONLY | O_CLOEXEC | O_NOFOLLOW | O_NONBLOCK;

Callers 1

diag_write_fileFunction · 0.85

Calls 1

Tested by

no test coverage detected