Skip to content

Commit

Permalink
darwin: processes: add pipe support for get_fds
Browse files Browse the repository at this point in the history
  • Loading branch information
doronz88 committed Feb 20, 2022
1 parent db2b623 commit 820c550
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/rpcclient/rpcclient/darwin/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ class Fd:
fd: int


@dataclasses.dataclass()
class PipeFd(Fd):
pass


@dataclasses.dataclass()
class FileFd(Fd):
path: str
Expand Down Expand Up @@ -106,6 +111,9 @@ def get_fds(self, pid: int) -> List[Fd]:
if fd.proc_fdtype == PROX_FDTYPE_VNODE:
result.append(FileFd(fd=fd.proc_fd, path=parsed.pvip.vip_path))

elif fd.proc_fdtype == PROX_FDTYPE_PIPE:
result.append(PipeFd(fd=fd.proc_fd))

elif fd.proc_fdtype == PROX_FDTYPE_SOCKET:
if parsed.psi.soi_kind in (so_kind_t.SOCKINFO_TCP, so_kind_t.SOCKINFO_IN):
correct_class = SOCKET_TYPE_DATACLASS[parsed.psi.soi_family][parsed.psi.soi_kind]
Expand Down

0 comments on commit 820c550

Please sign in to comment.