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

Function private_runtime_snapshot

src/daemon/ipc.c:677–692  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

675}
676
677static bool private_runtime_snapshot(int fd, const char *path, bool require_empty_acl,
678 struct stat *status_out) {
679 struct stat by_handle;
680 struct stat by_path;
681 bool valid = fd >= 0 && path && path[0] != '\0' && fstat(fd, &by_handle) == 0 &&
682 lstat(path, &by_path) == 0 && S_ISDIR(by_handle.st_mode) &&
683 S_ISDIR(by_path.st_mode) && by_handle.st_uid == geteuid() &&
684 by_path.st_uid == geteuid() && (by_handle.st_mode & 07777) == 0700 &&
685 (by_path.st_mode & 07777) == 0700 && by_handle.st_dev == by_path.st_dev &&
686 by_handle.st_ino == by_path.st_ino &&
687 (!require_empty_acl || cbm_macos_extended_acl_fd_is_empty(fd));
688 if (valid && status_out) {
689 *status_out = by_handle;
690 }
691 return valid;
692}
693
694static int private_directory_tree_open(const char *directory_path);
695

Callers 2

private_runtime_openFunction · 0.85

Calls 1

Tested by

no test coverage detected