smbclient & winpopup patch (again)

Michael Ju. Tokarev mjt at tls.msk.ru
Sun Feb 13 17:40:00 GMT 2000


Sorry for repost.

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));


More information about the samba-technical mailing list