[Samba] Panic in log when Win98/ME tries to print on samba 3.0.8

Florian Streibelt samba at F-Streibelt.de
Fri Nov 12 16:22:38 GMT 2004


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 at 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




More information about the samba mailing list