smbclient & winpopup patch (again)

Richard Sharpe sharpe at ns.aus.com
Sun Feb 13 08:45:26 GMT 2000


Hi,

At 08:04 AM 2/14/00 +1100, Michael Ju. Tokarev wrote:
>Sorry for repost.

No problems.  Actually, it is welcome.  I was just looking at this problem
yesterday for my two-day Samba course, but did not have the time to fix it
due to two awsome deadlines ... I will apply this patch to the source, as I
saw the same problem ...

>When I post this the first time (about Oct 18, 1999), there was no
responces...
>
>Here is a patch for smbclient so it will issue a correct name query for
>winpopup messages.  With this patch where is ability to send winpopups
>to _user_, not just to machine.
>
>Background.  In smbclient (client/client.c), there is a variable called
>name_type that initializes to 0x03 if user wants to do a winpopup (default
>is 0x20).  But it is completely ignored in do_message_op(), and cli_connect()
>called with default name type = 0x20, but this type does not registered
>for usernames, just for workstations.  This patch adds explicit name query
>with correct type to do_message_op().
>
>Thanks.
>
>Michael.
>
>P.S. there may be some problems with tab characters in patch...
>This is against 2.0.5a, but appies cleanly to 2.0.6 and 2.0.7pre1 (offset
76 lines).
>P.P.S. I don't know the purpose of name_type global -- it is always 0x20
>except of do_message_op() func, so it may be just two #defines --
>one for "normal" mode (0x20) and another for message (0x03)...
>
>==================== Patch starts here ====================
>--- client.c.orig       Mon Oct 25 21:44:41 1999
>+++ client.c    Mon Oct 25 21:42:54 1999
>@@ -2076,6 +2076,12 @@
> 
> 	ip = ipzero;
> 	if (have_ip) ip = dest_ip;
>+	else {
>+		if (!resolve_name( desthost, &ip, name_type )) {
>+			DEBUG(0,("Unable to resolve name %s\n", desthost));
>+			return 1;
>+		}
>+	}
> 
> 	if (!(cli=cli_initialise(NULL)) || !cli_connect(cli, desthost, &ip)) {
> 		DEBUG(0,("Connection to %s failed\n", desthost));
>

Regards
-------
Richard Sharpe, sharpe at ns.aus.com, Master Linux Administrator :-),
Samba (Team member, www.samba.org), Ethereal (Team member, www.zing.org)
Co-author, SAMS Teach Yourself Samba in 24 Hours
Author: First Australian 5-day, intensive, hands-on Linux SysAdmin course



More information about the samba-technical mailing list