[Samba] PATCH: downloading drivers from Solaris [was Re: So SAMBA no longer ...]

Gerald (Jerry) Carter jerry at samba.org
Fri Feb 21 00:17:27 GMT 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, 31 Jan 2003, Robert M. Martel wrote:

> 	I've followed the steps as listed in the manual.  Log onto a
> windows 2000 client as a user listed as a printer admin.  Load the
> printer driver and make the changes to reflect installed options on the
> printer.  Just as listed in section 6.2.2 of the "how-to" manual
> 	
> 	Install the printer on the client PC using the add printer wizard
> while logged onto the client machine as a printer admin user - see that
> the device settings are OK.  Change the paper orientation, apply, change
> it back, apply.  Test the printer.  A-OK.
> 	
> 	Log on to a windows 2000 client as a regular user.  Install the
> printer, check the device settings and all the settings are back to the
> driver defaults.  Remove the printer.  Stop Samba, add my test user to
> the printer admin list, start samba, try again to install the printer,
> now the device settings are as they should be.
> 	
> 	Samba "knows" the settings I have selected but is not sharing them
> with non-print admin users.  What would prevent the settings from
> downloading along with the drivers?

OK.  after more time than I would like to admit, here the's fix.
The bug is obvious now that I see it.  Sorry for the headaches 
this caused.

This will definitely be in 2.2.8



cheers, jerry
 ----------------------------------------------------------------------
 Hewlett-Packard            ------------------------- http://www.hp.com
 SAMBA Team                 ---------------------- http://www.samba.org
 GnuPG Key                  ---- http://www.plainjoe.org/gpg_public.asc
 "You can never go home again, Oatman, but I guess you can shop there."  
                            --John Cusack - "Grosse Point Blank" (1997)

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (GNU/Linux)
Comment: For info see http://quantumlab.net/pine_privacy_guard/

iD8DBQE+VXAYIR7qMdg1EfYRAo/EAKDefxRHBrxBFnqvvQVEXctW7Qc0TACeIMFw
6/EShEhvyOdlmRvHQOvwMQU=
=FNI/
-----END PGP SIGNATURE-----
-------------- next part --------------
Index: source/rpc_server/srv_spoolss_nt.c
===================================================================
RCS file: /data/cvs/samba/source/rpc_server/srv_spoolss_nt.c,v
retrieving revision 1.115.2.224
diff -u -B -b -r1.115.2.224 srv_spoolss_nt.c
--- source/rpc_server/srv_spoolss_nt.c	13 Feb 2003 19:40:21 -0000	1.115.2.224
+++ source/rpc_server/srv_spoolss_nt.c	21 Feb 2003 00:15:05 -0000
@@ -7876,12 +7876,22 @@
 	uint16  enumkeys[ENUMERATED_KEY_SIZE+1];
 	char*   ptr = NULL;
 	int     i;
-	char 	*PrinterKey = "PrinterDriverData";
+	fstring	PrinterKey;
+	UNISTR2	uni_keys;
+	int	enum_key_len;
 
 	DEBUG(4,("_spoolss_enumprinterkey\n"));
 
 	unistr2_to_dos(key, &q_u->key, sizeof(key) - 1);
 
+	ZERO_STRUCTP(PrinterKey);
+	fstrcpy( PrinterKey, "PrinterDriverData" );
+
+	/* add space for 2 terminating NULLs */
+
+	enum_key_len = strlen( PrinterKey ) + 2;
+
+
 	/* 
 	 * we only support enumating all keys (key == "")
 	 * Of course, the only key we support is the "PrinterDriverData" 
@@ -7889,22 +7899,13 @@
 	 */	
 	if (strlen(key) == 0)
 	{
-		r_u->needed = ENUMERATED_KEY_SIZE *2;
+		r_u->needed = enum_key_len*2;
 		if (q_u->size < r_u->needed)
 			return WERR_MORE_DATA;
 	
-		ptr = PrinterKey;
-		for (i=0; i<ENUMERATED_KEY_SIZE-2; i++)
-		{
-			enumkeys[i] = (uint16)(*ptr);
-			ptr++;
-		}
-
-		/* tag of with 2 '\0's */
-		enumkeys[i++] = '\0';
-		enumkeys[i] = '\0';
+		init_unistr2( &uni_keys, PrinterKey, enum_key_len );
 	
-		if (!make_spoolss_buffer5(p->mem_ctx, &r_u->keys, ENUMERATED_KEY_SIZE, enumkeys))
+		if ( !make_spoolss_buffer5(p->mem_ctx, &r_u->keys, enum_key_len, uni_keys.buffer) )
 			return WERR_BADFILE;
 			
 		return WERR_OK;


More information about the samba mailing list