🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
2 messages
2 total messages Started by Sherilyn Tue, 20 Jul 1999 00:00
slrn 0.9.5.2: duplicated periods in post.c
#49992
Author: Sherilyn
Date: Tue, 20 Jul 1999 00:00
105 lines
3961 bytes
-----BEGIN PGP SIGNED MESSAGE-----


To sign my postings with PGP, I have written a macro based on the
post-file-hook example shipped with slrn 0,9.5.2.  It simply splits
the posting into header and body sections, stripping the sig at "--",
PGP-signs the body, and then reconstructs the posting file from the
header, body and signature file.

It's just come to my notice that the postings output are sometimes
corrupted, and upon examining one such posting I notice that it is
because, when I type an ellipsis ("...") on its own on a blank line,
which is how I habitually represent a snip in quoted text in a followup,
slrn in posting it always adds an extra "." if it finds a "." in the
first character position in the line, thereby busting my PGP armor.

Here's the relevant code fragment from post.c, around line 900 in
my copy:

Before:  ? represents "don't care".
    line[]
     012345...
    [?.?????????????????????]
      ^
      |
      linep

Code fragment:
        if (*linep == '.')
          {
             linep--;
             *linep = '.';
          }

After:
    line[]
     012345...
    [..?????????????????????]
     ^
     |
     linep
   

'linep' is the pointer to the first character in a line, which is
loaded into the buffer 'line' from the second character position onwards,
presumably so that the code can neatly add an extra period to the
beginning of the line by just "taking one step backwards" in the buffer
in this way and saving itself a memmove() call.

I deduce that this code is written as it is because a lone period
will be interpreted as the end of the posting--and indeed I notice
that the nntp_end_post() function in nntplib.c signals the end of
a posting by sending a line containing a single period.

Cautiously, I'd suggest that the duplication of a period except where it
is absolutely necessary represents an undesirable feature in slrn.  The
code could be rewritten as:

        if (*linep == '.' && !linep[1]) /* lone period on line */
          {
             linep--;
             *linep = '.';
          }

Thus the code would only alter the posted output if absolutely necessary.

Of course, for the purposes of my macro, I have to ensure that my
filter pre-empts John's treatment of the single period case, but
with the code as it is I see no workaround since even if I add an extra
period to a line containing a single period, John's code will add a
further period, busting the armor again.

Slrn Version: 0.9.5.2 (Feb 17 1999 21:46:36)
S-Lang Library Version: 1.2.2
OS-Type: Unix

slrn compiled with support for:
        character set mapping
        nntp (SLtcp socket code)
        spool
        inews
        slrnpull
        S-Lang Macros

Default server object: nntp
Default posting mechanism: nntp
Supported character sets include:
        ISOLatin
        ibm850
        NeXT
Default character set: isolatin

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBN5T/xNSR8rI01qX9AQHscQQAho/MMtD+qUeQJK7axsxwUtHLFBZN36Uv
vXCBZqdzUs7BGdG8hv46jZECgDdo53AslY9d2GRdBLXLWmJtn9EDeUbxKyDnED6y
TzuLWXe5Hwd5bzP+RaYJoTfvW8A8/QWyEZ9lXeC+Oszjs70SGUBy1X8HVwFYGLrQ
hPPHZOiw4Uk=
=WbO2
-----END PGP SIGNATURE-----
-- 
Sherilyn

Re: slrn 0.9.5.2: duplicated periods in post.c
#50023
Author: Sherilyn
Date: Wed, 21 Jul 1999 00:00
68 lines
3068 bytes
-----BEGIN PGP SIGNED MESSAGE-----

[Sorry to follow this up]
In article <slrn7p9vts.5sh.Sherilyn@sidaway.demon.co.uk>, Sherilyn wrote:
...
>To sign my postings with PGP, I have written a macro based on the
>post-file-hook example shipped with slrn 0,9.5.2.  It simply splits
>the posting into header and body sections, stripping the sig at "--",
>PGP-signs the body, and then reconstructs the posting file from the
>header, body and signature file.
>
>It's just come to my notice that the postings output are sometimes
>corrupted, and upon examining one such posting I notice that it is
>because, when I type an ellipsis ("...") on its own on a blank line,
>which is how I habitually represent a snip in quoted text in a followup,
>slrn in posting it always adds an extra "." if it finds a "." in the
>first character position in the line, thereby busting my PGP armor.
...
Still investigating this.  It seems that John's code _does_ work because
the news server strips up to one period from the line (the traditional
method of checking this is RTFS, but I haven't got a copy of innd source
to hand).

The real reason for my corrupted postings is as far away as ever, but there
are definitely some postings from me with "...." instead of "...", and
removing the extra period causes the signature to verify.

Example:

Newsgroups: alt.internet.providers.uk,alt.internet.providers.uk.free
Message-ID: <slrn7p8q6l.2fk.Sherilyn@sidaway.demon.co.uk> 

Perhaps my macro is introducing an extra period?  I considered this first,
but it doesn't seem possible because the record copy loops are like this:


   while (-1 != fgets (&line, fp))
     {
	if (line == "\n")
	  break;
	() = fputs (line, header_fp);
     }
   () = fclose (header_fp);
   
   % Now do body
   while (-1 != fgets (&line, fp))
     {
	% Break on signature
	if (line == "-- \n")
	  break;
	() = fputs (line, body_fp);
     }

and so on.  There isn't a lot of room for a period to creep in there.

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBN5UswdSR8rI01qX9AQG5gwP/SYYvIp1CG0cYXkHGBmbtewsoCZNqr6Tt
Uf9uxe3+RShz9IF7xvdte29J7RIgMAGRGPKtao2Z809/cNJIh5A2Kdxvu3MaTTbh
XiI0VjML8g3hK89mxrxMlkUwsmIyTkRi+JHJe8HWHzgBrZ9yHy990cyham/yM5hp
TioUhwLMvT4=
=4Euy
-----END PGP SIGNATURE-----
-- 
Sherilyn

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads