[net.bugs.4bsd] Lprm seg-faults when printer is offline.

gamiddleton@thunder.UUCP (Guy Middleton) (02/16/85)

If the printer is offline, lprm tries to get the name of the control file
of the file being printed.  It opens it successfully (since a null file name
in BSD is a synonym for the current working directory), and reads garbage.
Following is the fix, in function chk() in file rmjob.c:

*** /tmp/,RCSt1022475	Fri Feb 15 17:10:45 1985
--- rmjob.c	Fri Feb 15 17:06:13 1985
***************
*** 173,178
  
  	if (all && (from == host || !strcmp(from, file+6)))
  		return(1);
  
  	/*
  	 * get the owner's name from the control file.

--- 173,180 -----
  
  	if (all && (from == host || !strcmp(from, file+6)))
  		return(1);
+ 	if (strlen(file) == 0)
+ 		return(1);
  
  	/*
  	 * get the owner's name from the control file.