[patch] additional conversion for winpopup in 2.2

Ihar Viarheichyk i.viarheichyk at sam-solutions.net
Tue Jan 15 11:53:10 GMT 2002


Hello.

Here is a small patch, which adds dos<->unix conversion for usernames
and hostnames in winpopup messages.

-- 
Igor Vergeichik
ICQ 47298730

-------------- next part --------------
diff -ruNk.orig samba-2.2/source/libsmb/climessage.c.orig samba-2.2/source/libsmb/climessage.c
--- samba-2.2/source/libsmb/climessage.c.orig	Tue Jan 15 20:25:29 2002
+++ samba-2.2/source/libsmb/climessage.c	Tue Jan 15 20:26:43 2002
@@ -79,8 +79,7 @@
 	p = smb_buf(cli->outbuf);
 	*p++ = 1;
 	SSVAL(p,0,len); p += 2;
-	memcpy(p,msg,len);
-	p += len;
+	clistr_push(cli, p, msg, len, 0);
 
 	cli_setup_bcc(cli, p);
 	cli_send_smb(cli);
diff -ruNk.orig samba-2.2/source/smbd/message.c.orig samba-2.2/source/smbd/message.c
--- samba-2.2/source/smbd/message.c.orig	Tue Jan 15 19:18:00 2002
+++ samba-2.2/source/smbd/message.c	Tue Jan 15 20:43:15 2002
@@ -84,8 +84,8 @@
       pstring s;
 
       pstrcpy(s,lp_msg_command());
-      pstring_sub(s,"%f",alpha_strcpy(alpha_msgfrom,msgfrom,NULL,sizeof(alpha_msgfrom)));
-      pstring_sub(s,"%t",alpha_strcpy(alpha_msgto,msgto,NULL,sizeof(alpha_msgto)));
+      pstring_sub(s,"%f",alpha_strcpy(alpha_msgfrom,dos_to_unix(msgfrom, False),NULL,sizeof(alpha_msgfrom)));
+      pstring_sub(s,"%t",alpha_strcpy(alpha_msgto,dos_to_unix(msgto, False),NULL,sizeof(alpha_msgto)));
       standard_sub_basic(s);
       pstring_sub(s,"%s",name);
       smbrun(s,NULL);


More information about the samba-technical mailing list