[cups.bugs] Re: [CRIT] STR #1206: Loosing the printers at cups 1.2

Tamas Bagyal keef at freemail.hu
Tue Jun 21 05:24:35 PDT 2005


[STR New]

hello Franz!

I have same problem. here is the patch for printers.c file. ugly, dirty
and so on, but working for me. with this patch cupsd read the
printers.conf, but the configure on the web interface not working.
--- printers.c  2005-06-02 21:37:05.000000000 +0200                       
                                                                          
           
+++ printers.c-mod      2005-06-20 16:37:01.000000000 +0200               
                                                                          
           
@@ -835,7 +835,15 @@                                                      
                                                                          
           
    /*                                                                    
                                                                          
           
     * Decode the directive...                                            
                                                                          
           
     */                                                                   
                                                                          
           
-                                                                         
                                                                          
           
+    int counter23;                                                       
                                                                          
           
+    for (counter23=0; counter23<1023; counter23++)                       
                                                                          
           
+       {                                                                 
                                                                          
           
+        name[counter23]=line[counter23];                                 
                                                                          
           
+        if (isspace(name[counter23]))                                    
                                                                          
           
+           break;                                                        
                                                                          
           
+       }                                                                 
                                                                          
           
+    name[++counter23]='\0';                                              
                                                                          
           
+    LogMessage(L_DEBUG, "LoadAllPrinters: name: |%s|", name);            
                                                                          
           
     if (!strcasecmp(name, "<Printer") ||                                 
                                                                          
           
         !strcasecmp(name, "<DefaultPrinter"))                            
                                                                          
           
     {                                                                    
                                                                          
           
@@ -864,7 +872,7 @@                                                       
                                                                          
           
       }                                                                  
                                                                          
           
       else                                                               
                                                                          
           
       {                                                                  
                                                                          
           
-        LogMessage(L_ERROR, "Syntax error on line %d of printers.conf.", 
                                                                          
           
+        LogMessage(L_ERROR, "Syntax error on line %d of
printers.conf.<Printer>",                                                 
                             
                   linenum);                                              
                                                                          
           
         return;                                                          
                                                                          
           
       }                                                                  
                                                                          
           
@@ -879,14 +887,14 @@                                                     
                                                                          
           
       }                                                                  
                                                                          
           
       else                                                               
                                                                          
           
       {                                                                  
                                                                          
           
-        LogMessage(L_ERROR, "Syntax error on line %d of printers.conf.", 
                                                                          
           
+        LogMessage(L_ERROR, "Syntax error on line %d of printers.conf.p =
NULL vagy mi",                                                            
           
                   linenum);                                              
                                                                          
           
         return;                                                          
                                                                          
           
       }                                                                  
                                                                          
           
     }                                                                    
                                                                          
           
     else if (!p)                                                         
                                                                          
           
     {                                                                    
                                                                          
           
-      LogMessage(L_ERROR, "Syntax error on line %d of printers.conf.",   
                                                                          
           
+      LogMessage(L_ERROR, "Syntax error on line %d of
printers.conf.</Printer>",                                                
                               
                 linenum);                                                
                                                                          
           
       return;                                                            
                                                                          
           
     }                                                                    
                                                                          
           
@@ -896,9 +904,10 @@                                                      
                                                                          
           
        SetString(&p->info, value);                                       
                                                                          
           
       else                                                               
                                                                          
           
       {                                                                  
                                                                          
           
-       LogMessage(L_ERROR, "Syntax error on line %d of printers.conf.",  
                                                                          
           
-                  linenum);                                              
                                                                          
           
-       return;                                                           
                                                                          
           
+       SetString(&p->info, "");                                          
                                                                          
           
+//     LogMessage(L_ERROR, "Syntax error on line %d of
printers.conf.<Info>",                                                    
                              
+//                linenum);                                              
                                                                          
           
+//     return;                                                           
                                                                          
           
       }                                                                  
                                                                          
           
     }                                                                    
                                                                          
           
     else if (!strcasecmp(name, "Location"))
@@ -907,9 +916,10 @@                                                      
                                                                          
           
        SetString(&p->location, value);                                   
                                                                          
           
       else                                                               
                                                                          
           
       {                                                                  
                                                                          
           
-       LogMessage(L_ERROR, "Syntax error on line %d of printers.conf.",  
                                                                          
           
-                  linenum);                                              
                                                                          
           
-       return;                                                           
                                                                          
           
+       SetString(&p->location, "");                                      
                                                                          
           
+//     LogMessage(L_ERROR, "Syntax error on line %d of printers.conf.",  
                                                                          
           
+//                linenum);                                              
                                                                          
           
+//     return;                                                           
                                                                          
           
       }                                                                  
                                                                          
           
     }                                                                    
                                                                          
           
     else if (!strcasecmp(name, "DeviceURI"))

Link: http://www.cups.org/str.php?L1206
Version: 1.2-current





More information about the cups mailing list