> From [EMAIL PROTECTED] Mon Jul 10 08:55:37 2000
> Date: Mon, 10 Jul 2000 16:45:06 +0200 (MET DST)
> From: Carsten Sejer Christensen <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: LPRng: Accounting changed in new ifhp filter?
>
>
> After having changed to ifhp-3.3.17 from ifhp-3.3.10, my accounting.sh
> is no longer called with the same parameters. Job file ("-J") and host
> name ("-h") of the printing pc is missing.
> I'm using LPRng v. 3.6.13 on Solaris 2.6.
>
>
> My printcap is like this:
>
> .hp-standard
> :lp=%P%9100
> :sd=/var/spool/printer/%P
> :if=/pack/lprng/libexec/filters/ifhp
> :of=/pack/lprng/libexec/filters/ifhp
>-Taccounting=/pack/admin/printeracct/bin/accounting.sh,config=/pack/lprng/etc/ifhp.conf
> :lf=log
> :fix_bad_job:
> :fx=flpv
> :rw:sh:sf
> :#mx#0
> :af=acct
>
>
> f11009
> :tc=.hp-standard
> :cm=HP LaserJet 4+
> :ifhp=model=hp4plus :ifhp=model=hp4plus
>
>
> The accounting option in ifhp.conf is disabled.
>
>
> The "acct" file looks like this when using the new 3.3.17 filter:
>
> jobstart '-Hi4.auc.dk' '-nroot' '-Pf11009' '-kcfA758i4.auc.dk' '-b26'
>'-t2000-07-10-16:26:32.000'
> start '-q16761' '-p331159' '-t2000-07-10-16:26:34.294' '-Aroot@i4+758' '-nroot'
>'-Pf11009'
> filestart '-q16765' '-p331159' '-t2000-07-10-16:26:36.204' '-Aroot@i4+758' '-nroot'
>'-Pf11009'
> fileend '-b2' '-T51' '-q16765' '-p331161' '-t2000-07-10-16:27:25.235'
>'-Aroot@i4+758' '-nroot' '-Pf11009'
> end '-b2' '-T57' '-q16761' '-p331161' '-t2000-07-10-16:27:29.025' '-Aroot@i4+758'
>'-nroot' '-Pf11009'
>
>
> And like this when using ":of=/path/ifhp-3.3.10 ...":
>
> start [EMAIL PROTECTED] -Jlpr -Pf11009 -tno -pno
> jobstart '-Hi4.auc.dk' '-nroot' '-Pf11009' '-kcfA800i4.auc.dk' '-b26'
>'-t2000-07-10-16:28:21.000'
> /pack/admin/printeracct/bin/accounting.sh 'start' '-q16803' '-p331161'
>'-t2000-07-10-16:28:25.647'
>'-Taccounting=/pack/admin/printeracct/bin/accounting.sh,config=/pack/lprng/etc/ifhp.conf'
> '-CA' '-Aroot@i4+800' '-Fo' '-Hi4.auc.dk' '-Jlpr' '-Lroot' '-Pf11009' '-Qf11009'
>'-aacct' '-d/var/spool/printer/f11009' '-hi4.auc.dk' '-j800' '-kcfA800i4.auc.dk'
>'-l66' '-nroot' '-sstatus' '-w80' '-x0' '-y0' 'acct'
> start [EMAIL PROTECTED] -Jlpr -Pf11009 -t2000-07-10-16:28:25.647 -p331161
> filestart '-q16806' '-p331161' '-t2000-07-10-16:28:27.538' '-Aroot@i4+800' '-nroot'
>'-Pf11009'
> fileend '-b1' '-T24' '-q16806' '-p331162' '-t2000-07-10-16:28:49.228'
>'-Aroot@i4+800' '-nroot' '-Pf11009'
> /pack/admin/printeracct/bin/accounting.sh 'end' '-b1' '-T32' '-q16803' '-p331162'
>'-t2000-07-10-16:28:53.018'
>'-Taccounting=/pack/admin/printeracct/bin/accounting.sh,config=/pack/lprng/etc/ifhp.conf'
> '-CA' '-Aroot@i4+800' '-Fo' '-Hi4.auc.dk' '-Jlpr' '-Lroot' '-Pf11009' '-Qf11009'
>'-aacct' '-d/var/spool/printer/f11009' '-hi4.auc.dk' '-j800' '-kcfA800i4.auc.dk'
>'-l66' '-nroot' '-sstatus' '-w80' '-x0' '-y0' 'acct'
> end [EMAIL PROTECTED] -Jlpr -Pf11009 -t2000-07-10-16:28:53.018 -p331162 -b1
> jobend '-Hi4.auc.dk' '-nroot' '-Pf11009' '-kcfA800i4.auc.dk' '-b26'
>'-t2000-07-10-16:28:53.000'
>
>
> It's like the accounting script isn't called when using the new filter
> when looking at the "acct" file, but it does, just not with "-J" and
> "-h" option.
>
Try the following patch to ifhp:
*** src/accounting.c 2000/06/25 17:13:57 1.12
--- src/accounting.c 2000/07/13 15:35:16
***************
*** 60,78 ****
Accounting_script, Accountfile, list );
- for( s = Accounting_info; *s; ++s ){
- c = cval(s);
- t = 0;
- if( isupper(c) ) t = Upperopts[c-'A'];
- if( islower(c) ) t = Loweropts[c-'a'];
- if( t && *t ){
- SNPRINTF( working, sizeof(working), " '-%c%s'", c, t );
- list = safeextend2(list, working,__FILE__,__LINE__);
- }
- }
/* this is probably the best way to do the output */
if( !ISNULL(Accountfile) && (accounting_fd = open(Accountfile,
O_WRONLY|O_APPEND )) >= 0 ) {
DEBUG1("Accounting: writing to %d, '%s'", accounting_fd, list );
n = strlen(list);
list = safeextend2(list, "\n",__FILE__,__LINE__);
--- 60,78 ----
Accounting_script, Accountfile, list );
/* this is probably the best way to do the output */
if( !ISNULL(Accountfile) && (accounting_fd = open(Accountfile,
O_WRONLY|O_APPEND )) >= 0 ) {
+ for( s = Accounting_info; *s; ++s ){
+ c = cval(s);
+ t = 0;
+ if( isupper(c) ) t = Upperopts[c-'A'];
+ if( islower(c) ) t = Loweropts[c-'a'];
+ if( t && *t ){
+ SNPRINTF( working, sizeof(working), " '-%c%s'", c, t );
+ list = safeextend2(list, working,__FILE__,__LINE__);
+ }
+ }
DEBUG1("Accounting: writing to %d, '%s'", accounting_fd, list );
n = strlen(list);
list = safeextend2(list, "\n",__FILE__,__LINE__);
***************
*** 83,88 ****
--- 83,102 ----
if( Accounting_script && *Accounting_script ){
s = safestrdup3( Accounting_script, " ", list, __FILE__,__LINE__ );
+ for( c = 'A'; c <= 'Z'; ++c ){
+ t = Upperopts[c-'A'];
+ if( t && *t ){
+ SNPRINTF( working, sizeof(working), " '-%c%s'", c, t );
+ s = safeextend2(s, working,__FILE__,__LINE__);
+ }
+ }
+ for( c = 'a'; c <= 'z'; ++c ){
+ t = Loweropts[c-'a'];
+ if( t && *t ){
+ SNPRINTF( working, sizeof(working), " '-%c%s'", c, t );
+ s = safeextend2(s, working,__FILE__,__LINE__);
+ }
+ }
n = Filter_file( s, "ACCOUNTING", -1 , -1 );
DEBUG1("Accounting: exec '%s'", s );
if( n ){
-----------------------------------------------------------------------------
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.
-----------------------------------------------------------------------------