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

Function posix_socket_path_identity_read

src/daemon/ipc.c:1856–1875  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1854}
1855
1856static int posix_socket_path_identity_read(const cbm_daemon_ipc_endpoint_t *endpoint,
1857 const char *socket_name,
1858 posix_socket_identity_t *identity_out,
1859 struct stat *status_out) {
1860 struct stat status;
1861 if (!endpoint || !socket_name || !identity_out) {
1862 return -1;
1863 }
1864 if (fstatat(endpoint->dir_fd, socket_name, &status, AT_SYMLINK_NOFOLLOW) != 0) {
1865 return errno == ENOENT ? 0 : -1;
1866 }
1867 if (!posix_socket_status_secure_transport(&status) ||
1868 !posix_socket_identity_from_stat(&status, identity_out)) {
1869 return -1;
1870 }
1871 if (status_out) {
1872 *status_out = status;
1873 }
1874 return 1;
1875}
1876
1877static bool posix_path_unlink_regular_if_matches(int dir_fd, const char *name, dev_t device,
1878 ino_t inode, nlink_t links) {

Tested by

no test coverage detected