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:1910–1929  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1908}
1909
1910static int posix_socket_path_identity_read(const cbm_daemon_ipc_endpoint_t *endpoint,
1911 const char *socket_name,
1912 posix_socket_identity_t *identity_out,
1913 struct stat *status_out) {
1914 struct stat status;
1915 if (!endpoint || !socket_name || !identity_out) {
1916 return -1;
1917 }
1918 if (fstatat(endpoint->dir_fd, socket_name, &status, AT_SYMLINK_NOFOLLOW) != 0) {
1919 return errno == ENOENT ? 0 : -1;
1920 }
1921 if (!posix_socket_status_secure_transport(&status) ||
1922 !posix_socket_identity_from_stat(&status, identity_out)) {
1923 return -1;
1924 }
1925 if (status_out) {
1926 *status_out = status;
1927 }
1928 return 1;
1929}
1930
1931static bool posix_path_unlink_regular_if_matches(int dir_fd, const char *name, dev_t device,
1932 ino_t inode, nlink_t links) {

Tested by

no test coverage detected