[Samba] 3.0.6 & "string overflow by 1"

Gerald (Jerry) Carter jerry at samba.org
Mon Aug 23 12:45:00 GMT 2004


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

Martin Zielinski wrote:

| AFAIK the message is caused by the safe_strcpy call in
| printing/nt_printing.c : construct_nt_devicemode ()
| or get_a_printer2 ().
|
| The MAXDEVICENAME macro is set to 32 whereas printername plus
| servername is  usually longer than that.

This is the size defined by MS.  (see MSDN and one the
wire traces).

| I'd suggest, not to change the printername when
| assigning a driver unless the  printername contains
| the  drivername (e.g. "HP Laserjet 4 (Copy 2)" vs.
| "HP  Laserjet 4").

Not that easy.  It is safer not to try to play games with
filtering out fields in trhe SetPrinter() calls from the
client.  It is what the client asks us to do (which is what
I mentioned in the previous mail to you).  The current
behavior makes migration from an NT printer server much easier
and if don't allow the case of printername == drivername
then some migration scenarios will not work.

If you are automating the process of driver install then
the best thing to do is just to either (a) fix the original
SetPrinter() call from the client or (b) just issue a second
SetPrinter() call to change the printername back to its
original value.

But I might crack under large amounts of community pressure
if everyone complains.




cheers, jerry
- ---------------------------------------------------------------------
Alleviating the pain of Windows(tm)      ------- http://www.samba.org
GnuPG Key                ----- http://www.plainjoe.org/gpg_public.asc
"If we're adding to the noise, turn off this song"--Switchfoot (2003)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFBKebMIR7qMdg1EfYRAvU8AJ9W3AFTGUHuRc7aQqi1M54CnJH6KACeOfPk
qvSUZPMXgodi8N+tzOErjF4=
=GuSF
-----END PGP SIGNATURE-----


More information about the samba mailing list