> From [EMAIL PROTECTED] Mon Jul 10 07:12:49 2000
> Date: Mon, 10 Jul 2000 16:12:19 +0200
> From: Klaus Singvogel <[EMAIL PROTECTED]>
> To: Patrick Powell <[EMAIL PROTECTED]>
> Subject: spawning lpd processes
>
>
> Hi,
> I discovered a serious problem with LPRng. If a printcap entry is
> broken in such a way that it doesn't contain an lp=  nor an rm=/rp=
> entry, and someone is querying this spool, then lpd subprocesses are
> flooding your system after a while. This means the main process is
> forking more and more child processes w/o waiting or killing
> previously started ones.
>
> I'm trying to investigate this problem and if sending you my
> patches as soon as I know more.
>
> Regards,
>       Klaus.
> -- 
>   .-.  | Klaus Singvogel
>   oo|  | Caldera (Deutschland) GmbH, Naegelsbachstr. 49c, 91052 Erlangen
>  /`'\  | email: [EMAIL PROTECTED]        internet: http://www.caldera.de
> (\_;/) | phone: ++49 9131 7192-300   fax: ++49 9131 7192-399 
>

Thanks for the report.  Fixed in next release.  Here is a patch for this:


*** src/common/getprinter.c     2000/07/07 14:08:39     5.15
--- src/common/getprinter.c     2000/07/13 15:14:31
***************
*** 8,14 ****
   ***************************************************************************/
  
   static char *const _id =
! "$Id: getprinter.c,v 5.15 2000/07/07 14:08:39 papowell Exp $";
  
  
  #include "lp.h"
--- 8,14 ----
   ***************************************************************************/
  
   static char *const _id =
! "$Id: getprinter.c,v 5.15 2000/07/07 14:08:39 papowell Exp papowell $";
  
  
  #include "lp.h"
***************
*** 130,135 ****
--- 130,140 ----
                                &PC_entry_line_list );
                        Set_var_list( Pc_var_list, &PC_entry_line_list);
                }
+               if( RemoteHost_DYN && Lp_device_DYN && report_conflict ){
+                       SNPRINTF(report_conflict,report_len,
+                               "conflicting printcap entries :lp=%s:rm=%s",
+                               Lp_device_DYN, RemoteHost_DYN );
+               }
                if( !Is_server && Force_localhost_DYN ){
                        /* we force a connection to the localhost using
                         * the print queue primary name
***************
*** 144,154 ****
                        Set_DYN( &RemoteHost_DYN, LOCALHOST );
                        Set_DYN( &Lp_device_DYN, 0 );
                } else if( safestrchr( Lp_device_DYN, '@' ) ){
-                       if( RemoteHost_DYN && report_conflict ){
-                               SNPRINTF(report_conflict,report_len,
-                                       "lp=%s:rm=%s",
-                                       Lp_device_DYN, RemoteHost_DYN );
-                       }
                        Set_DYN(&RemotePrinter_DYN, Lp_device_DYN );
                        s = safestrchr( RemotePrinter_DYN, '@');
                        if( s ) *s++ = 0;
--- 149,154 ----
***************
*** 161,175 ****
                        Set_DYN(&Lp_device_DYN,0);
                        goto set_default;
                } else if( Lp_device_DYN && Is_server ){
-                       if( RemoteHost_DYN && report_conflict ){
-                               SNPRINTF(report_conflict,report_len,
-                                       "lp=%s:rm=%s",
-                                       Lp_device_DYN, RemoteHost_DYN );
-                       }
-                       DEBUG2("Fix_Rm_Rp_info: checking conflict :lp='%s', :rp='%s', 
'%s'",
-                               Lp_device_DYN, RemoteHost_DYN, report_conflict );
                        Set_DYN(&RemoteHost_DYN,0);
                        Set_DYN(&RemotePrinter_DYN,0);
                } else {
     set_default:
                        if( RemoteHost_DYN == 0 || *RemoteHost_DYN == 0 ){
--- 161,177 ----
                        Set_DYN(&Lp_device_DYN,0);
                        goto set_default;
                } else if( Lp_device_DYN && Is_server ){
                        Set_DYN(&RemoteHost_DYN,0);
                        Set_DYN(&RemotePrinter_DYN,0);
+               } else if( RemoteHost_DYN && Is_server ){
+                       if( RemotePrinter_DYN == 0 || *RemotePrinter_DYN == 0 ){
+                               Set_DYN( &RemotePrinter_DYN, Printer_DYN );
+                       }
+               } else if( Is_server && Server_names_DYN == 0 ){
+                       if( report_conflict ){
+                               SNPRINTF(report_conflict,report_len,
+                                       "no :rm, :lp, or :sv entry");
+                       }
                } else {
     set_default:
                        if( RemoteHost_DYN == 0 || *RemoteHost_DYN == 0 ){
***************
*** 258,269 ****
        error[0] = 0;
        Fix_Rm_Rp_info(error,sizeof(error));
        if( error[0] ){
-               char *p;
-               if( (p = strchr(error,':')) ){
-                       *p++ = 0; } else { p=error; }
                WARNMSG(
!                       "%s: printcap entry ':%s' and ':%s' are conflicting",
!                       Printer_DYN, error, p );
        }
        if(DEBUGL1)Dump_line_list("Aliases",&PC_alias_line_list);
        s = Join_line_list_with_sep(&PC_alias_line_list,"|");
--- 260,268 ----
        error[0] = 0;
        Fix_Rm_Rp_info(error,sizeof(error));
        if( error[0] ){
                WARNMSG(
!                       "%s: '%s'",
!                       Printer_DYN, error );
        }
        if(DEBUGL1)Dump_line_list("Aliases",&PC_alias_line_list);
        s = Join_line_list_with_sep(&PC_alias_line_list,"|");

-----------------------------------------------------------------------------
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
with:                           | example:
subscribe LIST <mailaddr>       |  subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr>     |  unsubscribe lprng [EMAIL PROTECTED]

If you have major problems,  send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------

Reply via email to