MCPcopy Create free account
hub / github.com/qilingframework/qiling / ql_unix_socket_path

Function ql_unix_socket_path

qiling/os/posix/syscall/socket.py:83–97  ·  view source on GitHub ↗
(ql: Qiling, sun_path: bytearray)

Source from the content-addressed store, hash-verified

81
82
83def ql_unix_socket_path(ql: Qiling, sun_path: bytearray) -> Tuple[str, str]:
84 vpath, _, _ = sun_path.partition(b'\x00')
85
86 # an abstract Unix namespace?
87 if not vpath:
88 # TODO: isolate from host namespace
89 # TODO: Windows
90 ql.log.warning(f'Beware! Usage of hosts abstract socket namespace {bytes(sun_path)}')
91
92 return (sun_path.decode(), '')
93
94 vpath = ql.os.path.virtual_abspath(vpath.decode())
95 hpath = ql.os.path.virtual_to_host_path(vpath)
96
97 return (hpath, vpath)
98
99
100def __host_socket_type(vsock_type: int, arch_type: QL_ARCH) -> int:

Callers 3

ql_syscall_connectFunction · 0.85
ql_syscall_bindFunction · 0.85
ql_syscall_sendtoFunction · 0.85

Calls 2

virtual_abspathMethod · 0.80
virtual_to_host_pathMethod · 0.80

Tested by

no test coverage detected