Florian Streibelt
2004-Nov-12 16:23 UTC
[Samba] Panic in log when Win98/ME tries to print on samba 3.0.8
Hi folks, I got this in the client-logfiles on my samba 3.0.8 PDC after updating from 3.0.3 via 3.0.7 and I was not able to find a solution somewhere in the archives. assmat-pc (172.16.4.102) connect to service standard initially as user asssas (uid=3023, gid=3000) (pid 16207) [2004/11/11 21:52:39, 0] printing/printing_db.c:get_print_db_byname(40) PANIC: assert failed at printing/printing_db.c(40) [2004/11/11 21:52:39, 0] lib/util.c:smb_panic2(1403) PANIC: assert failed [2004/11/11 21:52:39, 0] lib/util.c:smb_panic2(1411) BACKTRACE: 15 stack frames: #0 /usr/local/samba/sbin/smbd(smb_panic2+0x1fc) [0x1019f348] #1 /usr/local/samba/sbin/smbd(smb_panic+0x14) [0x1019f13c] #2 /usr/local/samba/sbin/smbd(get_print_db_byname+0x9c) [0x101ce958] #3 /usr/local/samba/sbin/smbd [0x101bcb2c] #4 /usr/local/samba/sbin/smbd(print_job_set_name+0x34) [0x101bf364] #5 /usr/local/samba/sbin/smbd [0x100496f0] #6 /usr/local/samba/sbin/smbd(api_reply+0x368) [0x1004d220] [...] I found this happens because printing_db.c:get_print_db_byname gets called like callget_print_db_byname( printerone ) callget_print_db_byname( printertwo ) callget_print_db_byname( NULL ) this workaround lets my Win98 and ME clients print again: --- samba-3.0.8/source/printing/printing_db.c.defunc Fri Nov 12 17:03:44 2004 +++ samba-3.0.8/source/printing/printing_db.c Fri Nov 12 17:02:00 2004 @@ -32,13 +32,26 @@ struct tdb_print_db *get_print_db_byname(const char *printername) { + struct tdb_print_db *p = NULL, *last_entry = NULL; int num_open = 0; pstring printdb_path; BOOL done_become_root = False; - - SMB_ASSERT(printername != NULL); - + + /* + * When a Win98 or ME client tries to print + * the assertion killed the printjob because + * get_print_db_byname was called with NULL as an + * argument after the valid printers had been + * searched. Then the client gets an error and + * the prinjob is beeing canceled. + * I concider this change as a workaround? + * Florian Streibelt <samba@f-streibelt.de> + */ + + if (printername == NULL) return NULL; + //SMB_ASSERT(printername != NULL); + for (p = print_db_head, last_entry = print_db_head; p; p = p->next) { /* Ensure the list terminates... JRA. */ SMB_ASSERT(p->next != print_db_head); bye, Florian
Gerald (Jerry) Carter
2004-Nov-12 17:52 UTC
[Samba] Panic in log when Win98/ME tries to print on samba 3.0.8
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Florian Streibelt wrote: | Hi folks, | | I got this in the client-logfiles on my samba 3.0.8 | PDC after updating from 3.0.3 via 3.0.7 and I was not | able to find a solution somewhere in the archives. | | | assmat-pc (172.16.4.102) connect to service standard initially as user | asssas (uid=3023, gid=3000) (pid 16207) | [2004/11/11 21:52:39, 0] printing/printing_db.c:get_print_db_byname(40) | PANIC: assert failed at printing/printing_db.c(40) Already fixed for the upcoming 3.0.9. The fix is at : http://websvn.samba.org/cgi-bin/viewcvs.cgi?rev=3682&view=rev 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 Thunderbird - http://enigmail.mozdev.org iD8DBQFBlPhdIR7qMdg1EfYRAotqAJ9yvwUerxAbJDvE2HeHd00zvzTidgCgiFDZ f3hWpwtRlx8c4Hcu3+M6TrI=bVlg -----END PGP SIGNATURE-----