[PATCH] rpcclient/cmd_spoolss.c

Benjamin Kuit bj at it.uts.edu.au
Sun Dec 30 04:54:05 GMT 2001


in cmd_spoolss.c, an array of characters (including nulls) is converted
to 'unicode' using this method:

info->dependentfiles[i] = (uint16)str2[i];

This caused problems on my sparc workstation with a different byte
order.

Patch changes this line to:

SSVAL(&info->dependentfiles[i], 0, str2[i]);

The included patch only effects "adddriver", dont know where else it
might be needed.

Bj

-- 
+-------------------------------+--------------------------------------+
|      Benjamin (Bj) Kuit       |  Building 4, 447                     |
|      Systems Programmer       |  Faculty of Information Technology   |
|      Phone: 02 9514 1841      |  University of Technology, Sydney    |
|      Mobile: 0416 184 972     |  Email: bj at it.uts.edu.au             |
+-------------------------------+--------------------------------------+
-------------- next part --------------
--- rpcclient/cmd_spoolss.c.orig	Sun Dec 30 23:45:25 2001
+++ rpcclient/cmd_spoolss.c	Sun Dec 30 23:47:42 2001
@@ -932,7 +932,7 @@
 	}
 	for (i=0; i<len; i++)
 	{
-		info->dependentfiles[i] = (uint16)str2[i];
+		SSVAL(&info->dependentfiles[i], 0, str2[i]);
 	}
 	info->dependentfiles[len] = '\0';
 


More information about the samba-technical mailing list