NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/36381



The following reply was made to PR bin/36381; it has been noted by GNATS.

From: Aran.Clauson%wwu.edu@localhost
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/36381
Date: Thu, 10 Sep 2015 11:24:24 -0700 (PDT)

 Gnats,
 
 This isn't an elegant solution, but works for my purposes.
 
 Aran
 
 Index: usr.sbin/lpr/lpd/printjob.c
 ===================================================================
 RCS file: /cvsroot/src/usr.sbin/lpr/lpd/printjob.c,v
 retrieving revision 1.56
 diff -u -r1.56 printjob.c
 --- usr.sbin/lpr/lpd/printjob.c 30 Aug 2011 19:27:37 -0000      1.56
 +++ usr.sbin/lpr/lpd/printjob.c 9 Sep 2015 23:12:32 -0000
 @@ -798,6 +798,7 @@
  sendit(char *file)
  {
         int i, err = OK;
 +       extern int rflag;
         char *cp, last[BUFSIZ];
  
         /*
 @@ -812,6 +813,9 @@
          *      rest of the line is the argument.
          *      commands of interest are:
          *
 +        *              H -- "host name" of machine where lpr was done
 +        *              J -- "job name" on banner page
 +        *              P -- "person" user's login name
          *            a-z -- "file name" name of file to print
          *              U -- "unlink" name of file to remove
          *                    (after we print it. (Pass 2 only)).
 @@ -822,6 +826,20 @@
          */
         while (get_line(cfp)) {
         again:
 +               if (rflag) {
 +                       switch(line[0]) {
 +                       case 'H':
 +                               strlcpy(fromhost, line+1, sizeof(fromhost));
 +                               break;
 +                       case 'J':
 +                               strlcpy(jobname, line+1, sizeof(jobname));
 +                               break;
 +                       case 'P':
 +                               strlcpy(logname, line+1, sizeof(logname));
 +                               break;
 +                       }
 +               }
 +               
                 if (line[0] == 'S') {
                         cp = line+1;
                         i = 0;
 



Home | Main Index | Thread Index | Old Index