diff --git a/Makefile b/Makefile index 867fbf2..fbcde68 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,8 @@ endif XMPPIPE_SANDBOX ?= XMPPIPE_SANDBOX_NULL XMPPIPE_SANDBOX_RLIMIT_NOFILE ?= -1 -CFLAGS += -D$(XMPPIPE_SANDBOX) -DXMPPIPE_SANDBOX_RLIMIT_NOFILE=$(XMPPIPE_SANDBOX_RLIMIT_NOFILE) +CFLAGS += -DXMPPIPE_SANDBOX=\"$(XMPPIPE_SANDBOX)\" -D$(XMPPIPE_SANDBOX) \ + -DXMPPIPE_SANDBOX_RLIMIT_NOFILE=$(XMPPIPE_SANDBOX_RLIMIT_NOFILE) all: $(CC) -g -Wall $(CFLAGS) -o xmppipe src/*.c $(LDFLAGS) -lstrophe diff --git a/src/xmppipe.c b/src/xmppipe.c index 1c7ae9b..9010497 100644 --- a/src/xmppipe.c +++ b/src/xmppipe.c @@ -221,9 +221,11 @@ main(int argc, char **argv) if (xmppipe_connect_init(state) < 0) errx(EXIT_FAILURE, "XMPP handshake failed"); - if (xmppipe_sandbox_init(state) < 0) { + if (state->verbose) + (void)fprintf(stderr, "sandbox: entering %s\n", XMPPIPE_SANDBOX); + + if (xmppipe_sandbox_init(state) < 0) err(EXIT_FAILURE, "sandbox failed"); - } if (xmppipe_stream_init(state) < 0) errx(EXIT_FAILURE, "enabling stream management failed");