svn commit: samba r16046 - branches/SAMBA_3_0/source/lib trunk/source/lib

James Peach jpeach at samba.org
Tue Jun 6 00:12:13 GMT 2006


On Mon, 2006-06-05 at 13:00 +0000, vlendec at samba.org wrote:
> Author: vlendec
> Date: 2006-06-05 13:00:24 +0000 (Mon, 05 Jun 2006)
> New Revision: 16046
> 
> WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=16046
> 
> Log:
> Hmmm. I don't fully understand popt, but this is necessary for smbclient to
> show a prompt again :-)
> 
> James, could you check that this is ok? I think this was part of your Revision
> 15848.

Ok, I think I see what happened. When I moved the setting of
override_logfile into set_logfile(), I didn't notice that set_logfile is
always called as a popt pre-op. This means that override_logfile was, if
fact, always true.

Now, in smbclient, if override_logfile was true, this makes it call
setup_logging(), telling it to enter non-interactive mode. This closes
the global XFILE * dbf and forces it to NULL.

Just prior to this, however, we have forced dbf to x_stderr. It turns
out that dbf is being used in the readline replacement. If you run
smbclient on a system that used the readline replacement, the smbclient
prompt actually goes to stderr, whereas other output goes to stdout!!

So, without readline, we are now emitting prompts to stderr, which we
have just closed, so no prompts for you!

I think the fix here is ok, but it would be good to have a cleanup of
this because it seems very fragile :)

-- 
James Peach | jpeach at samba.org



More information about the samba-technical mailing list