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

Function private_runtime_snapshot

src/daemon/ipc.c:856–871  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

854}
855
856static bool private_runtime_snapshot(int fd, const char *path, bool require_empty_acl,
857 struct stat *status_out) {
858 struct stat by_handle;
859 struct stat by_path;
860 bool valid = fd >= 0 && path && path[0] != '\0' && fstat(fd, &by_handle) == 0 &&
861 lstat(path, &by_path) == 0 && S_ISDIR(by_handle.st_mode) &&
862 S_ISDIR(by_path.st_mode) && by_handle.st_uid == geteuid() &&
863 by_path.st_uid == geteuid() && (by_handle.st_mode & 07777) == 0700 &&
864 (by_path.st_mode & 07777) == 0700 && by_handle.st_dev == by_path.st_dev &&
865 by_handle.st_ino == by_path.st_ino &&
866 (!require_empty_acl || cbm_macos_extended_acl_fd_is_empty(fd));
867 if (valid && status_out) {
868 *status_out = by_handle;
869 }
870 return valid;
871}
872
873static int private_directory_tree_open(const char *directory_path);
874

Callers 2

private_runtime_openFunction · 0.85

Calls 2

lstatFunction · 0.85

Tested by

no test coverage detected