NetBSD Problem Report #8880

Received: (qmail 12152 invoked from network); 26 Nov 1999 08:17:36 -0000
Message-Id: <199911260816.CAA02577@callisto.niangua.net>
Date: Fri, 26 Nov 1999 02:16:45 -0600 (CST)
From: bstark@uswest.net
Reply-To: bstark@uswest.net
To: gnats-bugs@gnats.netbsd.org
Subject: Output from pac not always formatted correctly. 
X-Send-Pr-Version: 3.95

>Number:         8880
>Category:       bin
>Synopsis:       Output from pac not always formatted correctly.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jdolecek
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Nov 26 00:18:00 +0000 1999
>Closed-Date:    Sun Dec 05 22:27:26 +0000 1999
>Last-Modified:  Sun Dec 05 22:27:42 +0000 1999
>Originator:     Brian Stark
>Release:        NetBSD 1.4.1
>Organization:

Brian Stark
bstark@uswest.net
>Environment:

System: NetBSD callisto.niangua.net 1.4.1 NetBSD 1.4.1 (CALLISTO) #5: Sat Nov 6 00:20:51 CST 1999 bstark@callisto.niangua.net:/usr/src/sys/arch/i386/compile/CALLISTO i386


>Description:
	Output from pac not always formatted correctly.

>How-To-Repeat:

  While processing the printer accounting file pac attempts to limit the
  size of the hostname and user name field to 24 characters. However,
  printf() on NetBSD does not limit the size of the field to the size
  specified if the string exceeds this value (see man page for printf
  on a NetBSD 1.4.1 system).

  (NOTE: My copy of 'POSIX Programmer's Guide' from O'Reilly & Associates
  in the section for printf() states that the meaning of the width
  string for the "s" format character will be the maximum number of
  characters to be written. Why doesn't NetBSD's implementation of
  printf follow this??) 

  This presents a formatting problem on systems where the length of the
  hostname and user name fields exceed the 24 character limit that pac
  tries to impose. In file pac.c, functon dumpit(), the following code
  segment exists:

        printf("  Login               pages/feet   runs    price\n"); 
        feet = 0.0;
        runs = 0;
        for (ap = base, c = hcount; c--; ap++) {
                hp = *ap;
                runs += hp->h_count;
                feet += hp->h_feetpages;
                printf("%-24s %7.2f %4d   $%6.2f\n", hp->h_name,
                    hp->h_feetpages, hp->h_count, hp->h_feetpages * price);
        }
        if (allflag) {
                printf("\n");  
                printf("%-24s %7.2f %4d   $%6.2f\n", "total", feet,
                    runs, feet * price);
        }

  Here is an example using hostname 'callisto.niangua.net' and user
  names 'bstark' and 'root'. This example will show summary information
  for all entries in the accounting file:

  # pac -Pljet4
    Login               pages/feet   runs    price
  callisto.niangua.net:bstark   70.00   26   $  1.40
  callisto.niangua.net:root   21.00   12   $  0.42

  total                      91.00   38   $  1.82
  #

  Here is another example using the same hostname and a specific user,
  'bstark': 

  # pac -Pljet4 callisto.niangua.net:bstark
    Login               pages/feet   runs    price
  callisto.niangua.net:bstark   70.00   26   $  1.40
  #  



>Fix:

  I see several possible solutions for this problem. First, the functionality
  of printf could be modified so that if a width is specified for a string
  that will be the maximum number of characters to be printed. A second
  solution would be to change the formatting of the output to avoid this
  problem.

  IMHO, both of these solutions should be implemented. It would be really
  nice if printf worked according to how a POSIX system should work, and
  even if printf did correctly limit the characters printed, it would
  be nice to see full information for the hostname and user (as opposed
  to truncated information). To solve the second solution, the code in
  dumpit could be changed to the following:

        printf("pages/feet runs price   host name and/or login\n");
        printf("---------- ---- ------- ----------------------\n");
        feet = 0.0;
        runs = 0;
        for (ap = base, c = hcount; c--; ap++) {
                hp = *ap;
                runs += hp->h_count;
                feet += hp->h_feetpages;
                printf("   %7.2f %4d $%6.2f %-s\n",
                    hp->h_feetpages, hp->h_count, hp->h_feetpages * price,
                    hp->h_name);
        }
        if (allflag) {
                printf("\n");
                printf("   %7.2f %4d $%6.2f total\n",feet,runs,feet * price);
        }

  Using the above section of code, the output would now look like this:

  callisto:{root}#  ./pac -Pljet4
  pages/feet runs price   host name and/or login
  ---------- ---- ------- ----------------------
       71.00   27 $  1.42 callisto.niangua.net:bstark
        1.00    1 $  0.02 callisto.niangua.net:root

       72.00   28 $  1.44 total
  callisto:{root}#  ./pac -Pljet4 callisto.niangua.net:bstark
  pages/feet runs price   host name and/or login
  ---------- ---- ------- ----------------------
       71.00   27 $  1.42 callisto.niangua.net:bstark
  callisto:{root}#

NOTE #1: The pac command takes a "-s" parameter that causes it to write
information to a summary file. The format of the data written to this
file looks ok because the data fields are separated by a tab character
and the hostname/login name field is written as a complete string.

NOTE #2: There still could be formatting problems if the number of
pages is large and the price per page is large. The maximum dollar
amount that can be shown without formatting problems is $999.99.
However, this is something that can be addressed later...


Diff for my changes:

callisto:{root}# ident  pac.c.netbsd141
pac.c.netbsd141:
     $NetBSD: pac.c,v 1.10 1997/10/05 15:12:25 mrg Exp $
     $NetBSD: pac.c,v 1.10 1997/10/05 15:12:25 mrg Exp $
callisto:{root}# diff pac.c pac.c.netbsd141
269,270c269
<         printf("pages/feet runs price   host name and/or login\n");
<         printf("---------- ---- ------- ----------------------\n");
---
>       printf("  Login               pages/feet   runs    price\n");
277,279c276,277
<               printf("   %7.2f %4d $%6.2f %-s\n",
<                   hp->h_feetpages, hp->h_count, hp->h_feetpages * price,
<                     hp->h_name);
---
>               printf("%-24s %7.2f %4d   $%6.2f\n", hp->h_name,
>                   hp->h_feetpages, hp->h_count, hp->h_feetpages * price);
283c281,282
<                 printf("   %7.2f %4d $%6.2f total\n",feet,runs,feet * price);
---
>               printf("%-24s %7.2f %4d   $%6.2f\n", "total", feet,
>                   runs, feet * price);


>Release-Note:
>Audit-Trail:

From: Dave Huang <khym@bga.com>
To: bstark@uswest.net
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/8880: Output from pac not always formatted correctly.
Date: Fri, 26 Nov 1999 02:58:12 -0600 (CST)

 > (NOTE: My copy of 'POSIX Programmer's Guide' from O'Reilly & Associates
 >  in the section for printf() states that the meaning of the width
 >  string for the "s" format character will be the maximum number of
 >  characters to be written. Why doesn't NetBSD's implementation of
 >  printf follow this??) 

 I dunno about POSIX, but according to The Single UNIX Specification,
 Version 2 (http://www.opengroup.org/onlinepubs/007908799/xsh/fprintf.html),
 the width specification is the _minimum_ number of characters to be
 written. The precision specifies the maximum... so if you wanted exactly
 5 characters, you'd do something like printf("%5.5s", mystring);

 All implementations of printf() that I've seen behave like that, and
 that's also how printf() is described in K&R _The C Programming
 Language_, 2nd ed. So, I don't think NetBSD's printf should change...


From: Brian Stark <bstark@uswest.net>
To: Dave Huang <khym@bga.com>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/8880: Output from pac not always formatted correctly.
Date: Fri, 26 Nov 1999 04:31:09 -0600 (CST)

 On Fri, 26 Nov 1999, Dave Huang wrote:

 > > (NOTE: My copy of 'POSIX Programmer's Guide' from O'Reilly & Associates
 > >  in the section for printf() states that the meaning of the width
 > >  string for the "s" format character will be the maximum number of
 > >  characters to be written. Why doesn't NetBSD's implementation of
 > >  printf follow this??) 
 > 
 > I dunno about POSIX, but according to The Single UNIX Specification,
 > Version 2 (http://www.opengroup.org/onlinepubs/007908799/xsh/fprintf.html),
 > the width specification is the _minimum_ number of characters to be
 > written. The precision specifies the maximum... so if you wanted exactly
 > 5 characters, you'd do something like printf("%5.5s", mystring);

 Hello Dave,

 Hmm... I guess the Single UNIX Specification and POSIX differ somewhat
 then. I don't have a copy of the actual POSIX 1003.1 document, so I
 am (blindly) assuming that the O'Reilly book is accurately stating what is
 in the document. 

 I'm looking at my O'Reilly book now, and it says that the use of a
 precision "... may be used only with the e, E, f, g and G conversions."


 > All implementations of printf() that I've seen behave like that, and
 > that's also how printf() is described in K&R _The C Programming
 > Language_, 2nd ed. So, I don't think NetBSD's printf should change...

 Well, NetBSD has support for POSIX functions, so if the POSIX 
 document states that it should behave like this, then it would be
 really nice to see it implemented. Unfortunately, I don't have
 access to a copy of that document, so I can't see what it
 really says (any chance you or someone else has a copy and could 
 look this up??).

 Regards,

 Brian Stark
 bstark@uswest.net


From: Jaromir Dolecek <dolecek@ics.muni.cz>
To: bstark@uswest.net
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/8880: Output from pac not always formatted correctly.
Date: Fri, 26 Nov 1999 13:22:05 +0100 (MET)

 bstark@uswest.net wrote:
 >                 printf("%-24s %7.2f %4d   $%6.2f\n", hp->h_name,
 >                     hp->h_feetpages, hp->h_count, hp->h_feetpages * price);

 Please note that what you are saying is just not true. "%-24s"
 means "pad on right with blanks to the width of 24 characters".
 It doesn't mean the value should have 24 characters as a whole.
 If you want to achieve this, you should use format "%-24.24s".

 >   I see several possible solutions for this problem. First, the functionality
 >   of printf could be modified so that if a width is specified for a string
 >   that will be the maximum number of characters to be printed. A second
 >   solution would be to change the formatting of the output to avoid this
 >   problem.

 It's not the problem of printf(3). The "%-24s" format specifies that
 if the string is shorter than 24 characters, it would be padded on right
 with blanks so that result has 24 characters. Such format doesn't specify
 that the written string can't be longer than 24 characters.

 >   IMHO, both of these solutions should be implemented. It would be really
 >   nice if printf worked according to how a POSIX system should work, and

 Our printf(3) DOES work according to POSIX. Please check facts before
 claiming brokeness.

 So, this is just problem of pac, not printf(3).

 Jaromir
 -- 
 Jaromir Dolecek <jdolecek@NetBSD.org>      http://www.ics.muni.cz/~dolecek/
 @@@@  Wanna a real operating system ? Go and get NetBSD, damn it!  @@@@

From: Jaromir Dolecek <dolecek@ics.muni.cz>
To: Brian Stark <bstark@uswest.net>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/8880: Output from pac not always formatted correctly.
Date: Fri, 26 Nov 1999 15:56:41 +0100

 Brian Stark wrote:
 > Again, according to my copy of "POSIX Programmer's Guide" from
 > O'Reilly & Assocoiates it states "-   Will cause this conversion to
 > be left justified. If the - flag is not used, the result will be
 > right justified." So, yes, this fits with your description that
 > means pad on the right. The description of the 's' format character
 > then states that the width field "Specifies the maximum number of
 > characters to be written." As per my comment to Dave, the same
 > POSIX book states that the precision field is only for the format
 > characters e, E, f, g and G.

 That's correct.

 The maximum width is specified via "%.NUMBERs" notation, i.e.
 "%.24s" should write maximum of 24 characters from passed string
 or less if the string is shorter.
 The "%-NUMBERs" specifies just that the string should be _at least_
 24 characters long; if the string is shorter, it's padded with blanks
 on the right side (because of the "-" in format).
 Format string of "%-24.24s" should do the thing we wanted to do - if
 the string is shorter than 24 characters, it would append blanks on
 right.
 If the string is longer, it would take just first 24 characters from it.

 I've run into this problem more than once, so I'm aware it's kind of
 confusing. However, our behaviour is correct - I don't have any POSIX
 spec book around, but the behaviour matches what other OSes do.

 > Do you have a copy of the POSIX standard?

 I don't have, unfortunately :(

 > > Our printf(3) DOES work according to POSIX. Please check facts before
 > > claiming brokeness.
 > 
 > I was trying to check the facts... Not everyone has a copy of the
 > actual standards, so a lot of people like myself use reference books
 > that cover the official documents.

 I apologize for beeing a bit mean - I should not have reacted so
 cholerically :)

 > Well, if the O'Reilly book is wrong in what it says, then yes, I
 > agree, this is a problem with pac (and in that case I'll be hand
 > writing the corrections into my book!).

 The POSIX book is correct as well as our manpage. The "%-NUMBERs"
 notation
 just doesn't specify maximum length, but rather that the string is
 padded
 with blanks on right, if it's shorter than NUMBER characters.

 BTW - I'm going to fix the formatting problem with pac(1), using your
 patches.
 I'll probably also add one more character to the $$ field, hopefully
 maximum
 of $9999.99 would be enough :)

 Jaromir

From: Dave Huang <khym@bga.com>
To: Brian Stark <bstark@uswest.net>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/8880: Output from pac not always formatted correctly.
Date: Fri, 26 Nov 1999 10:29:10 -0600 (CST)

 On Fri, 26 Nov 1999, Brian Stark wrote:
 > Hmm... I guess the Single UNIX Specification and POSIX differ somewhat
 > then. I don't have a copy of the actual POSIX 1003.1 document, so I
 > am (blindly) assuming that the O'Reilly book is accurately stating what is
 > in the document. 

 I have a feeling that the O'Reilly book is wrong about this... I'd be
 surprised if POSIX was gratuitously incompatible with other standards
 and historical practice about something as trivial as this... and it
 seems like a loss of functionality too (e.g. what if you wanted a
 minimum width, but no maximum?)

 AFAIK, getting a copy of the POSIX standard costs money, and a quick
 search didn't turn up anything online... pretty much all I found were
 manpages from other unixes which claimed to be POSIX compliant. The
 HP/UX manpage for printf
 (http://www.software.hp.com/STK/man/10.30/printf_3s.html) says that the
 field width is a minimum width, and the precision is "the maximum number
 of bytes to be printed from a string in the s conversion." At the
 bottom, in the standards conformance section, it lists POSIX.1 (among
 many other standards).

 A Solaris 7 manpage (http://hoth.stsci.edu/man/man3S/printf.html) says
 pretty much the same thing, although it makes the distinction that a
 standards-conforming application interprets the width and precision as
 the number of bytes, while a non-standards-conforming app interprets it
 as the number of columns/characters (a distinction that probably only
 makes a difference with multi-byte characters, but maybe the tab
 character would be affected too).

 Anyways, I believe some other folks around here have access to the real
 POSIX standard, so hopefully they'll chime in :)


From: Jaromir Dolecek <dolecek@ics.muni.cz>
To: Brian Stark <bstark@uswest.net>, gnats-bugs@gnats.netbsd.org,
 	tech-userlevel@netbsd.org
Cc:  Subject: Re: bin/8880: Output from pac not always formatted correctly.
Date: Sat, 27 Nov 1999 12:39:23 +0100

 Hi,
 seems like ANSI C and POSIX doesn't aggree on usage of "width" for %s
 type
 for printf(3). According to POSIX (Brian Stark sent me a scanned copy or
 relevant pages, I don't have copy available myself), "%24s" should mean
 in POSIX prontf(3) the same as "%.24s" means for ANSI C - i.e. use
 maximum of 24 characters from the passed string.

 Am I seriously confused or the POSIX and ANSI C really don't treat this
 the
 same way ? If so, it's rather unfortunate ...

 From the POSIX:
 			Description	Meaning of width	Meaning of precision
 s	Argument is assumed to be	Specifies the maximum	UNDEFINED
 	char *. Characters up to (but	number of characters
 	not including) a terminating	to be written.
 	null are written.

 The ANSI C way is explained in manpage.

 Jaromir

From: Brian Stark <bstark@uswest.net>
To: dolecek@ics.muni.cz
Cc: gnats-bugs@gnats.netbsd.org, tech-userlevel@netbsd.org
Subject: Re: bin/8880: Output from pac not always formatted correctly.
Date: Sat, 27 Nov 1999 13:44:34 -0600

 Jaromir Dolecek wrote:

 > Hi,
 > seems like ANSI C and POSIX doesn't aggree on usage of "width" for %s
 > type
 > for printf(3). According to POSIX (Brian Stark sent me a scanned copy or
 > relevant pages, I don't have copy available myself), "%24s" should mean
 > in POSIX prontf(3) the same as "%.24s" means for ANSI C - i.e. use
 > maximum of 24 characters from the passed string.

 Just a clarification for those who haven't seen the related messages 
 posted to gnats-bugs: I don't have a copy of the POSIX 1003.1 document,
 but I do have a copy of "POSIX Programmer's Guide" published by O'Reilly
 and Associates. The pages that Jaromir mentions came from this book's 
 section on printf. Oh, my copy of the book appears to have been printed 
 in March 1994.

 Brian
 bstark@uswest.net

From: Giles Lean <giles@nemeton.com.au>
To: dolecek@ics.muni.cz
Cc: Brian Stark <bstark@uswest.net>, gnats-bugs@gnats.netbsd.org,
        tech-userlevel@netbsd.org
Subject: Re: bin/8880: Output from pac not always formatted correctly. 
Date: Fri, 03 Dec 1999 08:23:48 +1100

 On Sat, 27 Nov 1999 12:39:23 +0100  Jaromir Dolecek wrote:

 > seems like ANSI C and POSIX doesn't aggree on usage of "width" for
 > %s type for printf(3).
 > ...
 > Am I seriously confused or the POSIX and ANSI C really don't treat
 > this the same way ? If so, it's rather unfortunate ...

 Since POSIX references the C standard for this, there isn't an
 inconsistency.  I can't tell if you're confused or not. :-)

 [From the O'Reilly POSIX Programmer's Guide]
 > 			Description	Meaning of width	Meaning of precision
 > s	Argument is assumed to be	Specifies the maximum	UNDEFINED
 > 	char *. Characters up to (but	number of characters
 > 	not including) a terminating	to be written.
 > 	null are written.

 Answer: the book is wrong.  The width is the minimum width of the
 field.  The precision is the maximum number of characters to use from
 the argument.

 In preference to this book, I recommend using the "Single Unix
 Standard" which is freely accessible at http://www.opengroup.org.

 (This isn't the only error I have found in the O'Reilly POSIX book,
 but since I haven't used it much (I now have the real standards) I
 don't really know if I've found the only errors, or if it is just
 inaccurate.  Maybe there is an errata page at www.oreilly.com?)

 Regards,

 Giles


From: Brian Stark <bstark@uswest.net>
To: Giles Lean <giles@nemeton.com.au>
Cc: dolecek@ics.muni.cz, gnats-bugs@gnats.netbsd.org,
 	tech-userlevel@netbsd.org
Subject: Re: bin/8880: Output from pac not always formatted correctly.
Date: Thu, 02 Dec 1999 21:01:38 -0600

 Giles Lean wrote:

 > In preference to this book, I recommend using the "Single Unix
 > Standard" which is freely accessible at http://www.opengroup.org.

 Hello Giles,

 I will check this out...

 > (This isn't the only error I have found in the O'Reilly POSIX book,
 > but since I haven't used it much (I now have the real standards) I
 > don't really know if I've found the only errors, or if it is just
 > inaccurate.  Maybe there is an errata page at www.oreilly.com?)

 Thanks for the clarification! I don't have a copy of the standard so
 I have been relying on what is in the O'Reilly book. I have looked
 for errata on the O'Reilly web site, but I have not seen anything
 for the POSIX book. 

 Regards,

 Brian
 bstark@usweset.net
State-Changed-From-To: open->analyzed 
State-Changed-By: jdolecek 
State-Changed-When: Sat Dec 4 02:20:42 PST 1999 
State-Changed-Why:  
According to discussion on tech-userlevel, there seems to be a bug 
in O'Reilly POSIX book. 
The pac formatting problems will be addressed shortly. 


Responsible-Changed-From-To: bin-bug-people->jdolecek 
Responsible-Changed-By: jdolecek 
Responsible-Changed-When: Sat Dec 4 02:20:42 PST 1999 
Responsible-Changed-Why:  
I'll take care of this. 

From: Jaromir Dolecek <dolecek@ics.muni.cz>
To: bstark@uswest.net
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/8880: Output from pac not always formatted correctly.
Date: Sun, 5 Dec 1999 14:53:50 +0100 (MET)

 Hi,
 could you please try out this patch, if everything is correctly
 aligned and such ? I don't have accounting configured, so I can't
 check it myself. Try also passing the -m flag if possible please.
 It would be great if you'd also send me some sample output, so
 I could see if I like the way it's formatted :)

 Thanks in advance

 Jaromir

 XXXXX
 Index: pac.c
 ===================================================================
 RCS file: /cvsroot/basesrc/usr.sbin/lpr/pac/pac.c,v
 retrieving revision 1.10
 diff -u -p -r1.10 pac.c
 --- pac.c	1997/10/05 15:12:25	1.10
 +++ pac.c	1999/12/05 13:44:48
 @@ -266,15 +266,18 @@ dumpit()
  		hp = hp->h_link;
  	}
  	qsort(base, hcount, sizeof hp, qucmp);
 -	printf("  Login               pages/feet   runs    price\n");
 +	printf(" pages/feet runs price    %s\n",
 +		(mflag ? "host name and login" : "login"));
 +	printf(" ---------- ---- -------- ----------------------\n");
  	feet = 0.0;
  	runs = 0;
  	for (ap = base, c = hcount; c--; ap++) {
  		hp = *ap;
  		runs += hp->h_count;
  		feet += hp->h_feetpages;
 -		printf("%-24s %7.2f %4d   $%6.2f\n", hp->h_name,
 -		    hp->h_feetpages, hp->h_count, hp->h_feetpages * price);
 +		printf("    %7.2f %4d   $%7.2f %s\n",
 +			hp->h_feetpages, hp->h_count, hp->h_feetpages * price,
 +			hp->h_name);
  	}
  	if (allflag) {
  		printf("\n");
 XXXXX

 -- 
 Jaromir Dolecek <jdolecek@NetBSD.org>      http://www.ics.muni.cz/~dolecek/
 @@@@  Wanna a real operating system ? Go and get NetBSD, damn it!  @@@@

From: Brian Stark <bstark@uswest.net>
To: Jaromir Dolecek <dolecek@ics.muni.cz>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/8880: Output from pac not always formatted correctly.
Date: Sun, 5 Dec 1999 13:08:49 -0600 (CST)

 On Sun, 5 Dec 1999, Jaromir Dolecek wrote:

 > Hi,
 > could you please try out this patch, if everything is correctly
 > aligned and such ? I don't have accounting configured, so I can't

 Hello Jaromir,

 The formatting is not quite right:

 callisto:{root}# ./pac -Pljet4
  pages/feet runs price    login
  ---------- ---- -------- ----------------------
       16.00    3   $   0.32 callisto.niangua.net:bstark
       18.00    4   $   0.36 callisto.niangua.net:root

 total                      34.00    7   $  0.68
 callisto:{root}# ./pac -m -Pljet4
  pages/feet runs price    host name and login
  ---------- ---- -------- ----------------------
       16.00    3   $   0.32 bstark
       18.00    4   $   0.36 root

 total                      34.00    7   $  0.68
 callisto:{root}# 


 For comparison, here is the output from the patch I submitted:

 callisto:{root}# ./pac -Pljet4
 pages/feet runs price   host name and/or login
 ---------- ---- ------- ----------------------
      16.00    3 $  0.32 callisto.niangua.net:bstark
      18.00    4 $  0.36 callisto.niangua.net:root

      34.00    7 $  0.68 total
 callisto:{root}#  ./pac -m -Pljet4
 pages/feet runs price   host name and/or login
 ---------- ---- ------- ----------------------
      16.00    3 $  0.32 bstark
      18.00    4 $  0.36 root

      34.00    7 $  0.68 total
 callisto:{root}# 


 I am using Ghostscript 5.5 on my system and the unix-lpr.sh script that
 comes with the package is the one writing to my printer accounting file.
 Assuming you have printing queues on your system, you could manually
 create an 'acct' file in the printer queue directory with the information
 that pac needs. For example, here is my acct file for my ljet4 queue:

 callisto:{root}# cat /var/spool/output/ljet4/acct
    1.00 callisto.niangua.net:root
    1.00 callisto.niangua.net:bstark
    2.00 callisto.niangua.net:bstark
   13.00 callisto.niangua.net:bstark
   11.00 callisto.niangua.net:root
    3.00 callisto.niangua.net:root
    3.00 callisto.niangua.net:root
 callisto:{root}# 


 I would be happy to test any further patches you have.

 Brian Stark
 bstark@uswest.net

State-Changed-From-To: analyzed->closed 
State-Changed-By: jdolecek 
State-Changed-When: Sun Dec 5 14:27:26 PST 1999 
State-Changed-Why:  
Fixed, thanks. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.