Return the PID as handle in posix
Fixes some TypeError exceptions when attempting most operations on spawned processes, e.g.: p = client.sys.process.execute("/bin/sh", nil, "Channelized"=>true) p.close # raises TypeError: can't convert nil into Integer [FIXRM #7005]unstable
parent
b4b860f356
commit
c19102c6f1
|
@ -744,6 +744,7 @@ DWORD request_sys_process_execute(Remote *remote, Packet *packet)
|
|||
default:
|
||||
dprintf("child pid is %d\n", pid);
|
||||
packet_add_tlv_uint(response, TLV_TYPE_PID,(DWORD)pid);
|
||||
packet_add_tlv_uint(response, TLV_TYPE_PROCESS_HANDLE,(DWORD)pid);
|
||||
if (flags & PROCESS_EXECUTE_FLAG_CHANNELIZED) {
|
||||
if(have_pty) {
|
||||
dprintf("child channelized\n");
|
||||
|
@ -1005,7 +1006,6 @@ DWORD process_channel_read(Channel *channel, Packet *request,
|
|||
if((*bytesRead = read(ctx->pStdout, buffer, bufferSize) < 0)) {
|
||||
result = GetLastError();
|
||||
}
|
||||
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue