diff options
-rw-r--r-- | source4/lib/socket/socket.c | 2 | ||||
-rw-r--r-- | source4/param/loadparm.c | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/source4/lib/socket/socket.c b/source4/lib/socket/socket.c index eff2c0a743..26cdac99a3 100644 --- a/source4/lib/socket/socket.c +++ b/source4/lib/socket/socket.c @@ -70,7 +70,7 @@ _PUBLIC_ NTSTATUS socket_create_with_ops(TALLOC_CTX *mem_ctx, const struct socke if (!(flags & SOCKET_FLAG_BLOCK) && type == SOCKET_TYPE_STREAM && - lp_parm_bool(global_loadparm, NULL, "socket", "testnonblock", false)) { + getenv("SOCKET_TESTNONBLOCK") != NULL) { (*new_sock)->flags |= SOCKET_FLAG_TESTNONBLOCK; } diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c index b79be28ac0..79132a388a 100644 --- a/source4/param/loadparm.c +++ b/source4/param/loadparm.c @@ -2482,6 +2482,14 @@ bool lp_load(struct loadparm_context *lp_ctx, const char *filename) ntstatus_check_dos_mapping = lp_nt_status_support(lp_ctx); + /* FIXME: This is a bit of a hack, but we can't use a global, since + * not everything that uses lp also uses the socket library */ + if (lp_parm_bool(lp_ctx, NULL, "socket", "testnonblock", false)) { + setenv("SOCKET_TESTNONBLOCK", "1", 1); + } else { + unsetenv("SOCKET_TESTNONBLOCK"); + } + /* FIXME: Check locale in environment for this: */ if (strcmp(lp_display_charset(lp_ctx), lp_unix_charset(lp_ctx)) != 0) d_set_iconv(smb_iconv_open(lp_display_charset(lp_ctx), lp_unix_charset(lp_ctx))); |