Implemented leak detection via environment variables. Example error:

*** Sandboxed method dostuff executing in sandboxes: [box] may leak private data through env var "PUBLIC"
+++ Line 18 of file test-sandboxprivate-leakviasetenv.c

for the code...

  1 #include "soaap.h"
  2 #include <string.h>
  3 #include <stdlib.h>
  4
  5 void dostuff();
  6
  7 int main() {
  8   dostuff();
  9   printf("value of secret sandbox-private password: %s\n", getenv("PUBLIC"));
 10   return 0;
 11 }
 12
 13 __soaap_sandbox_persistent_named("box")
 14 void dostuff() {
 15   char* password __soaap_sandbox_private("box");
 16   password = "mypass";
 17   printf("leaking sandbox-private password to environment variable PUBLIC\n");
 18   setenv("PUBLIC", password, 1);
 19 }