#92891 trn4: has 1024-char limit on TRNINIT

#92891#5
Date:
2001-04-04 14:22:19 UTC
From:
To:
When I read news, I like to see all headers except ones I've
specifically decided are `boring', so that when an unexpected header
shows up I get to see it by default. Hence, in my trn configuration,
I switch all headers on (+h) and then hide specific ones
(-hHeader-Name).

So my .trn/trnrc file contains this:

TRNINIT="-F'> ' -Os -q
+h
-hApproved
-hApproved-By
[...]
-hX-Trace
-hXref
"

with a long list of boring headers in the middle.

Recently I've suddenly started to see Xref headers again. Since
`-hXref' is still in my TRNINIT specification, I'd expect not to see
them.

On a hunch I checked the total length of TRNINIT, and it came to a
bit over 1024. When I rearranged the headers so that `-hXref' was
closer to the beginning and another header (X-MIME-Autoconverted, I
think) was at the end, trn correctly hid Xref headers again but
displayed the header listed last.

So it looks as if there's a limit of 1024 characters on the value of
TRNINIT as read from .trn/trnrc, and this in turn is limiting the
number of boring news headers I can tell trn to hide. It would be
better if this string were allocated dynamically to be as large as
necessary.

My complete .trn/trnrc is attached below, for reference.

I am using Debian 2.2, kernel 2.2.14, libc 2.1.3-17.
----------- begin .trn/trnrc ------------
[environment]
TRNINIT="-F'> ' -Os -q
+h
-hApproved
-hApproved-By
-hCache-Post-Path
-hComments
-hContent-Class
-hContent-Disposition
-hContent-Transfer-Encoding
-hContent-Type
-hDelivered-To
-hErrors-To
-hImportance
-hIn-Reply-To
-hLines
-hList-Archive
-hList-Help
-hList-Id
-hList-Post
-hList-Subscribe
-hList-Unsubscribe
-hMail-Copies-To
-hMail-Followup-To
-hMessage-ID
-hMime-Version
-hNNTP-Posting-Date
-hNNTP-Posting-Host
-hOriginator
-hPath
-hPrecedence
-hReferences
-hReturn-Path
-hSender
-hThread-Index
-hThread-Topic
-hUser-Agent
-hX-Accept-Language
-hX-Authenticated-User
-hX-Authentication-Warning
-hX-BeenThere
-hX-Cache
-hX-Complaints-To
-hX-Debian
-hX-Envelope-Sender
-hX-Face
-hX-Local-Date
-hX-Loop
-hX-MIME-Autoconverted
-hX-MIMETrack
-hX-MSMail-Priority
-hX-MS-Has-Attach
-hX-MS-TNEF-Correlator
-hX-Mailer
-hX-Mailing-List
-hX-Mailman-Version
-hX-MimeOLE
-hX-NCC-RegID
-hX-Newsreader
-hX-No-Archive
-hX-Original-Date
-hX-Original-Message-ID
-hX-OriginalArrivalTime
-hX-Originating-IP
-hX-Path-Stamp
-hX-Priority
-hX-Received
-hX-Sender
-hX-Sent
-hX-Trace
-hXref
"
ATTRIBUTION="%(%)f=^ *\(.*[^ ]\) *?%1:%)f) <%>f> wrote:"
[options]
# ==Display Options========
Terse Output = #default of no
Pager Line-Marking = #default of no
Erase Screen = #default of no
Erase Each Line = #default of no
Muck Up Clear = #default of no
Background Spinner = #default of no
Charset = #default of patm
Filter Control Characters = #default of yes
# ==Selector Options========
Use Universal Selector = #default of no
Universal Selector Order = #default of natural
Universal Selector article follow = #default of yes
Universal Selector Commands = #default of Z>
Use Newsrc Selector = #default of no
Newsrc Selector Commands = #default of Z>
Use Addgroup Selector = #default of yes
Addgroup Selector Commands = #default of Z>
Use Newsgroup Selector = #default of no
Newsgroup Selector Order = #default of natural
Newsgroup Selector Commands = #default of Z>
Newsgroup Selector Display Styles = #default of slm
Use News Selector = #default of yes
News Selector Mode = subjects
News Selector Order = #default of date
News Selector Commands = #default of Z>
News Selector Display Styles = #default of lmds
Option Selector Commands = #default of Z>
Use Selector Numbers = #default of no
Selector Number Auto-Goto = #default of no
# ==Newsreading Options========
Use Threads = #default of yes
Select My Postings = #default of no
Initial Article Lines = #default of $LINES
Article Tree Lines = #default of 6
Word-Wrap Margin = #default of 8
Auto-Grow Groups = #default of yes
Compress Subjects = #default of yes
Join Subject Lines = #default of no
Line Num for Goto = #default of 1
Ignore THRU on Select = #default of yes
Read Breadth First = #default of no
Background Threading = #default of yes
Scan Mode Count = #default of 0
Header Magic = #default of
Header Hiding = #default of approved,comments,content-class,content-disposition,content-transfer-encoding,content-type,delivered-to,errors-to,importance,in-reply-to,lines,list-archive,list-help,list-id,list-post,list-subscribe,list-unsubscribe,mail-copies-to,mail-followup-to,message-id,mime-version,nntp-posting-date,nntp-posting-host,originator,path,precedence,references,return-path,sender,thread-index,thread-topic,user-agent,x-accept-language,x-authentication-warning,x-beenthere,x-cache,x-complaints-to,x-debian,x-envelope-sender,x-face,x-local-date,x-loop,x-mime-autoconverted,x-mimetrack,x-msmail-priority,x-ms-has-attach,x-ms-tnef-correlator,x-mailer,x-mailing-list,x-mailman-version,x-mimeole,x-ncc-regid,x-newsreader,x-no-archive,x-original-date,x-original-message-id,x-originalarrivaltime,x-originating-ip,x-priority,x-received,x-sender,x-sent,x-trace,xref
# ==Posting Options========
Cited Text String = "> "
# ==Save Options========
Save Dir = #default of %./News
Auto Savename = #default of no
Default Savefile Type = mail
# ==Mouse Options========
Use XTerm Mouse = #default of no
Mouse Modes = #default of acjlptwvK
Universal Selector Mousebar = #default of [Top]^ [PgUp]< [PgDn]> [ OK ]^j [Quit]q [Help]?
Newsrc Selector Mousebar = #default of [Top]^ [PgUp]< [PgDn]> [ OK ]^j [Quit]q [Help]?
Addgroup Selector Mousebar = #default of [Top]^ [Bot]$ [PgUp]< [PgDn]> [ OK ]Z [Quit]q [Help]?
Newsgroup Selector Mousebar = #default of [Top]^ [PgUp]< [PgDn]> [ OK ]Z [Quit]q [Help]?
News Selector Mousebar = #default of [Top]^ [Bot]$ [PgUp]< [PgDn]> [KillPg]D [ OK ]Z [Quit]q [Help]?
Option Selector Mousebar = #default of [Find]/ [FindNext]/^j [Top]^ [Bot]$ [PgUp]< [PgDn]> [Use]^i [Save]S [Abandon]q [Help]?
Article Pager Mousebar = #default of [Next]n [Sel]+ [Quit]q [Help]h
# ==MIME Options========
Multipart Separator = #default of -=-=-=-=-=-
Auto-View Inline = #default of no
# ==Misc Options========
Check for New Groups = no
Restriction Includes Empty Groups = #default of yes
Append Unsubscribed Groups = #default of no
Initial Group List = #default of 5
Restart At Last Group = #default of no
Eat Type-Ahead = #default of yes
Verify Input = #default of no
Fuzzy Newsgroup Names = #default of no
Auto Arrow Macros = #default of regular
Checkpoint Newsrc Frequency = #default of 20
Default Refetch Time = #default of 4 hours
Novice Delays = #default of yes
Old Mthreads Database = #default of no
# ==Article Scan Mode Options========
Follow Threads = #default of yes
Fold Subjects = #default of no
Re-fold Subjects = #default of no
Mark Without Moving = #default of no
VI Key Movement Allowed = #default of no
Display Item Numbers = #default of yes
Display Article Number = #default of no
Display Author = #default of yes
Display Score = #default of yes
Display Subject Count = #default of no
Display Subject = #default of yes
Display Summary = #default of no
Display Keywords = #default of no
# ==Scoring Options========
Verbose scoring = #default of yes
------------ end .trn/trnrc -------------

Cheers,
Simon
-- 
Simon Tatham         "I'm cross. I'm going to have a tantrum.
<anakin@pobox.com>    <pause> How do I start?"            - my uncle

#92891#8
Date:
2001-04-04 15:03:47 UTC
From:
To:
[Please keep at least the Cc: to 92891-forwarded@bugs.debian.org when
replying. Thanks!]

I've received the following bug report against the Debian trn4 package.
If nobody else does so, I can probably get time to write a patch over
the weekend.

This isn't the only place where trn has fixed buffer sizes, of course.
See http://bugs.debian.org/24783 for an example; newsgroup names are
read into a fixed-size (and fairly short) buffer. I started writing a
patch some time ago but got a bit bogged down in the sheer amount of
static allocation. :( At least the more limiting ones, like this,
deserve to be fixed.

As a workaround, Simon, you could try using the Header Hiding option in
trnrc rather than TRNINIT? I haven't checked that for memory allocation,
mind you ...

Cheers,
----- Forwarded message from Simon Tatham <anakin@pobox.com> ----- Subject: Bug#92891: trn4 has 1024-char limit on TRNINIT Reply-To: Simon Tatham <anakin@pobox.com>, 92891@bugs.debian.org From: Simon Tatham <anakin@pobox.com> To: submit@bugs.debian.org Message-Id: <E14koAt-0006aQ-00@ixion.tartarus.org> Date: Wed, 04 Apr 2001 15:22:19 +0100 Package: trn4 Version: 4.0-test75-2 When I read news, I like to see all headers except ones I've specifically decided are `boring', so that when an unexpected header shows up I get to see it by default. Hence, in my trn configuration, I switch all headers on (+h) and then hide specific ones (-hHeader-Name). So my .trn/trnrc file contains this: TRNINIT="-F'> ' -Os -q +h -hApproved -hApproved-By [...] -hX-Trace -hXref " with a long list of boring headers in the middle. Recently I've suddenly started to see Xref headers again. Since `-hXref' is still in my TRNINIT specification, I'd expect not to see them. On a hunch I checked the total length of TRNINIT, and it came to a bit over 1024. When I rearranged the headers so that `-hXref' was closer to the beginning and another header (X-MIME-Autoconverted, I think) was at the end, trn correctly hid Xref headers again but displayed the header listed last. So it looks as if there's a limit of 1024 characters on the value of TRNINIT as read from .trn/trnrc, and this in turn is limiting the number of boring news headers I can tell trn to hide. It would be better if this string were allocated dynamically to be as large as necessary. My complete .trn/trnrc is attached below, for reference. I am using Debian 2.2, kernel 2.2.14, libc 2.1.3-17.
----------- begin .trn/trnrc ------------ [environment] TRNINIT="-F'> ' -Os -q +h -hApproved -hApproved-By -hCache-Post-Path -hComments -hContent-Class -hContent-Disposition -hContent-Transfer-Encoding -hContent-Type -hDelivered-To -hErrors-To -hImportance -hIn-Reply-To -hLines -hList-Archive -hList-Help -hList-Id -hList-Post -hList-Subscribe -hList-Unsubscribe -hMail-Copies-To -hMail-Followup-To -hMessage-ID -hMime-Version -hNNTP-Posting-Date -hNNTP-Posting-Host -hOriginator -hPath -hPrecedence -hReferences -hReturn-Path -hSender -hThread-Index -hThread-Topic -hUser-Agent -hX-Accept-Language -hX-Authenticated-User -hX-Authentication-Warning -hX-BeenThere -hX-Cache -hX-Complaints-To -hX-Debian -hX-Envelope-Sender -hX-Face -hX-Local-Date -hX-Loop -hX-MIME-Autoconverted -hX-MIMETrack -hX-MSMail-Priority -hX-MS-Has-Attach -hX-MS-TNEF-Correlator -hX-Mailer -hX-Mailing-List -hX-Mailman-Version -hX-MimeOLE -hX-NCC-RegID -hX-Newsreader -hX-No-Archive -hX-Original-Date -hX-Original-Message-ID -hX-OriginalArrivalTime -hX-Originating-IP -hX-Path-Stamp -hX-Priority -hX-Received -hX-Sender -hX-Sent -hX-Trace -hXref " ATTRIBUTION="%(%)f=^ *\(.*[^ ]\) *?%1:%)f) <%>f> wrote:" [options] # ==Display Options======== Terse Output = #default of no Pager Line-Marking = #default of no Erase Screen = #default of no Erase Each Line = #default of no Muck Up Clear = #default of no Background Spinner = #default of no Charset = #default of patm Filter Control Characters = #default of yes # ==Selector Options======== Use Universal Selector = #default of no Universal Selector Order = #default of natural Universal Selector article follow = #default of yes Universal Selector Commands = #default of Z> Use Newsrc Selector = #default of no Newsrc Selector Commands = #default of Z> Use Addgroup Selector = #default of yes Addgroup Selector Commands = #default of Z> Use Newsgroup Selector = #default of no Newsgroup Selector Order = #default of natural Newsgroup Selector Commands = #default of Z> Newsgroup Selector Display Styles = #default of slm Use News Selector = #default of yes News Selector Mode = subjects News Selector Order = #default of date News Selector Commands = #default of Z> News Selector Display Styles = #default of lmds Option Selector Commands = #default of Z> Use Selector Numbers = #default of no Selector Number Auto-Goto = #default of no # ==Newsreading Options======== Use Threads = #default of yes Select My Postings = #default of no Initial Article Lines = #default of $LINES Article Tree Lines = #default of 6 Word-Wrap Margin = #default of 8 Auto-Grow Groups = #default of yes Compress Subjects = #default of yes Join Subject Lines = #default of no Line Num for Goto = #default of 1 Ignore THRU on Select = #default of yes Read Breadth First = #default of no Background Threading = #default of yes Scan Mode Count = #default of 0 Header Magic = #default of Header Hiding = #default of approved,comments,content-class,content-disposition,content-transfer-encoding,content-type,delivered-to,errors-to,importance,in-reply-to,lines,list-archive,list-help,list-id,list-post,list-subscribe,list-unsubscribe,mail-copies-to,mail-followup-to,message-id,mime-version,nntp-posting-date,nntp-posting-host,originator,path,precedence,references,return-path,sender,thread-index,thread-topic,user-agent,x-accept-language,x-authentication-warning,x-beenthere,x-cache,x-complaints-to,x-debian,x-envelope-sender,x-face,x-local-date,x-loop,x-mime-autoconverted,x-mimetrack,x-msmail-priority,x-ms-has-attach,x-ms-tnef-correlator,x-mailer,x-mailing-list,x-mailman-version,x-mimeole,x-ncc-regid,x-newsreader,x-no-archive,x-original-date,x-original-message-id,x-originalarrivaltime,x-originating-ip,x-priority,x-received,x-sender,x-sent,x-trace,xref # ==Posting Options======== Cited Text String = "> " # ==Save Options======== Save Dir = #default of %./News Auto Savename = #default of no Default Savefile Type = mail # ==Mouse Options======== Use XTerm Mouse = #default of no Mouse Modes = #default of acjlptwvK Universal Selector Mousebar = #default of [Top]^ [PgUp]< [PgDn]> [ OK ]^j [Quit]q [Help]? Newsrc Selector Mousebar = #default of [Top]^ [PgUp]< [PgDn]> [ OK ]^j [Quit]q [Help]? Addgroup Selector Mousebar = #default of [Top]^ [Bot]$ [PgUp]< [PgDn]> [ OK ]Z [Quit]q [Help]? Newsgroup Selector Mousebar = #default of [Top]^ [PgUp]< [PgDn]> [ OK ]Z [Quit]q [Help]? News Selector Mousebar = #default of [Top]^ [Bot]$ [PgUp]< [PgDn]> [KillPg]D [ OK ]Z [Quit]q [Help]? Option Selector Mousebar = #default of [Find]/ [FindNext]/^j [Top]^ [Bot]$ [PgUp]< [PgDn]> [Use]^i [Save]S [Abandon]q [Help]? Article Pager Mousebar = #default of [Next]n [Sel]+ [Quit]q [Help]h # ==MIME Options======== Multipart Separator = #default of -=-=-=-=-=- Auto-View Inline = #default of no # ==Misc Options======== Check for New Groups = no Restriction Includes Empty Groups = #default of yes Append Unsubscribed Groups = #default of no Initial Group List = #default of 5 Restart At Last Group = #default of no Eat Type-Ahead = #default of yes Verify Input = #default of no Fuzzy Newsgroup Names = #default of no Auto Arrow Macros = #default of regular Checkpoint Newsrc Frequency = #default of 20 Default Refetch Time = #default of 4 hours Novice Delays = #default of yes Old Mthreads Database = #default of no # ==Article Scan Mode Options======== Follow Threads = #default of yes Fold Subjects = #default of no Re-fold Subjects = #default of no Mark Without Moving = #default of no VI Key Movement Allowed = #default of no Display Item Numbers = #default of yes Display Article Number = #default of no Display Author = #default of yes Display Score = #default of yes Display Subject Count = #default of no Display Subject = #default of yes Display Summary = #default of no Display Keywords = #default of no # ==Scoring Options======== Verbose scoring = #default of yes ------------ end .trn/trnrc ------------- Cheers, Simon -- Simon Tatham "I'm cross. I'm going to have a tantrum. <anakin@pobox.com> <pause> How do I start?" - my uncle
----- End forwarded message -----
#92891#9
Date:
2001-04-04 19:02:10 UTC
From:
To:
The TRNINIT variable is traditionally size-limited because it is
supposed to be either a short list of options, or a filename of the
.trninit file (which can contains an "unlimited" size of options).
Thus, it was not expected that that variable would need to be longer
than 1K.

The best solution for Simon is to transfer his TRNINIT items into the
new trnrc option settings.  Fortunately, trn does this (mostly)
automatically for you, and it looks like Simon has done a 'S'ave in
the options selector recently, because most of the data is already
there.  For instance -F'> ' is already set in the "Cited Text String"
option, -Os is already set in the "News Selector Mode" option, -q is
already set in the "Check for New Groups" option.  The only item that
is partially set is the Header Hiding option, and that (I believe) is
mainly because of the truncation in the TRNINIT value (but see below
too).

I suggest using the following two lines in the .trn/trnrc file:

TRNINIT='+t'
Header Hiding = approved,cache-post-path,comments,content-class,content-disposition,content-transfer-encoding,content-type,delivered-to,errors-to,importance,in-reply-to,lines,list-archive,list-help,list-id,list-post,list-subscribe,list-unsubscribe,mail-copies-to,mail-followup-to,message-id,mime-version,nntp-posting-date,nntp-posting-host,originator,path,precedence,references,return-path,sender,thread-index,thread-topic,user-agent,x-accept-language,x-authenticated-user,x-authentication-warning,x-beenthere,x-cache,x-complaints-to,x-debian,x-envelope-sender,x-face,x-local-date,x-loop,x-mime-autoconverted,x-mimetrack,x-msmail-priority,x-ms-has-attach,x-ms-tnef-correlator,x-mailer,x-mailing-list,x-mailman-version,x-mimeole,x-ncc-regid,x-newsreader,x-no-archive,x-original-date,x-original-message-id,x-originalarrivaltime,x-originating-ip,x-path-stamp,x-priority,x-received,x-sender,x-sent,x-trace,xref

The reason that the TRNINIT variable is not empty above is that trn is
apparently not storing the "+t" properly in the Header Hiding option.
I could have manually added a "!," to the start of the list (to turn
off the hiding of all the headers), but the next time that the trnrc
file gets saved that part of the option line would have been lost.
Going with the slightly-fudged TRNINIT line above will work until this
bug is fixed.

..wayne..

#92891#10
Date:
2001-04-04 23:05:56 UTC
From:
To:
Yikes!  I meant +h.  My brain slipped a cog there when I was typing.

..wayne..

#92891#11
Date:
2001-04-05 08:30:26 UTC
From:
To:
Wayne Davison <trn@blorf.net> wrote:

I'd already tried this and it hadn't worked. What happens is that
the presence of `+h' in TRNINIT appears to cause the Header Hiding
string to be cleared. (That is, it's still there in my trnrc, but
when I look at it in the option selector, it's empty, and during the
running of trn it behaves as if it's empty.)

I tried it with the `+t' typo, and that _did_ keep the Header Hiding
string the way it was in my trnrc. But when you mentioned that it
had been an error, I corrected it to `+h', and suddenly my Header
Hiding string vanished. So what's going on?

(I'm amused to notice your Header Hiding string has had my
`Approved-By' header removed, because I hadn't realised -h options
are prefixes and so it was already covered by `Approved' :-)

Cheers,
Simon

#92891#12
Date:
2001-04-05 17:29:35 UTC
From:
To:
Yeah, that's correct.  I wasn't thinking about the order of the option
parsing quite right.  The .trnrc file is read first, and any TRNINIT
settings override those.

Your best bet for now is to put "!," at the start of the Header Hiding
option, set TRNINIT to an empty string, and then avoid using the
option selector to save the file (edit the .trnrc file directly).
Once the bug that causes the "!," to be lost is fixed, you won't have
to worry about this.

..wayne..

#92891#13
Date:
2001-04-06 08:01:23 UTC
From:
To:
Wayne Davison <trn@blorf.net> wrote:

Ouch :-)

Actually, currently I'm getting what appear to be pretty good
results from the thing you alluded to a couple of mails back: that
instead of containing options, TRNINIT can contain a filename and
that file is then read for an unlimited-size string of options. I've
set that up and it seems to be working fine, and also doesn't give
me the ability to accidentally overwrite my config, so I think I'll
leave it like this until some bug fixes come my way ...

Cheers,
Simon