aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--adapter/protocol/http.nim6
-rw-r--r--src/utils/sandbox.nim2
2 files changed, 5 insertions, 3 deletions
diff --git a/adapter/protocol/http.nim b/adapter/protocol/http.nim
index ec56b6f4..e2e53f22 100644
--- a/adapter/protocol/http.nim
+++ b/adapter/protocol/http.nim
@@ -64,14 +64,14 @@ proc curlWriteHeader(p: cstring, size, nitems: csize_t, userdata: pointer):
return nitems
# From the documentation: size is always 1.
-proc curlWriteBody(p: cstring, size, nmemb: csize_t, userdata: pointer):
+proc curlWriteBody(p: cstring; size, nmemb: csize_t; userdata: pointer):
csize_t {.cdecl.} =
return csize_t(write(stdout.getFileHandle(), p, int(nmemb)))
# From the documentation: size is always 1.
-proc readFromStdin(buffer: cstring, size, nitems: csize_t, userdata: pointer):
+proc readFromStdin(p: pointer; size, nitems: csize_t; userdata: pointer):
csize_t {.cdecl.} =
- return csize_t(stdin.readBuffer(buffer, nitems))
+ return csize_t(read(0, p, int(nitems)))
proc curlPreRequest(clientp: pointer, conn_primary_ip, conn_local_ip: cstring,
conn_primary_port, conn_local_port: cint): cint {.cdecl.} =
diff --git a/src/utils/sandbox.nim b/src/utils/sandbox.nim
index 4697523f..ad37c2d2 100644
--- a/src/utils/sandbox.nim
+++ b/src/utils/sandbox.nim
@@ -88,6 +88,7 @@ elif defined(linux) and not disableSandbox:
"exit_group", # for quit
"fcntl", "fcntl64", # for changing blocking status
"fork", # for when fork is really fork
+ "fstat", # glibc fread seems to call it
"getpid", # for determining current PID after we fork
"getrlimit", # glibc uses it after fork it seems
"getsockname", # Nim needs it for connecting
@@ -131,6 +132,7 @@ elif defined(linux) and not disableSandbox:
"fcntl", "fcntl64", # so we can set nonblock etc.
"mmap", "mmap2", "munmap", "brk", # memory allocation
"poll", # curl needs poll
+ "fstat", # glibc fread seems to call it
# maybe it will need epoll too in the future
"epoll_create", "epoll_create1", "epoll_ctl", "epoll_wait",
"ppoll", # or ppoll