From 06491a4cb12d8753c63525b3ba4d754d2ab1e822 Mon Sep 17 00:00:00 2001 From: James Peach Date: Thu, 15 Jun 2006 23:51:20 +0000 Subject: r16274: Fix the smbclient prompting behaviour for both systems that have libreadline and those that don't. We always use the built-in readline replacement for non-interactive mode. Interactive prompts are always emitted to stdout and non-interactive mode never prompts at all. Introduce x_fdup to avoid spuriously closing stdout when a logfile is specified on the command line and setup_logging is called a second time. (This used to be commit 848ac756f651a4be231e5635580c0fd5f3d3fa0e) --- source3/client/smbctool.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source3/client/smbctool.c') diff --git a/source3/client/smbctool.c b/source3/client/smbctool.c index 5b21d195b7..b3acca5573 100644 --- a/source3/client/smbctool.c +++ b/source3/client/smbctool.c @@ -3561,10 +3561,11 @@ static int do_message_op(void) set_global_myname( "" ); /* set default debug level to 0 regardless of what smb.conf sets */ - setup_logging( "smbclient", True ); + setup_logging( "smbctool", True ); DEBUGLEVEL_CLASS[DBGC_ALL] = 1; - dbf = x_stderr; - x_setbuf( x_stderr, NULL ); + if ((dbf = x_fdup(x_stderr))) { + x_setbuf( dbf, NULL ); + } pc = poptGetContext("smbclient", argc, (const char **) argv, long_options, POPT_CONTEXT_KEEP_FIRST); -- cgit