bugSTUMP - Bugs: bug #59280, Replace C files with shell or Perl...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #59280: Replace C files with shell or Perl scripts

Submitter:  Tristan Miller <psychonaut>
Submitted:  Fri 16 Oct 2020 11:12:33 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  psychonaut
Open/Closed:  Open Planned Release:  None

Thu 27 Jan 2022 12:32:40 AM UTC, comment #2: 

I've written drop-in replacements for antivirus and isbinary in Perl. These behave like the originals and anything that currently uses them should continue to work as before. I have deleted checkquot and cuthead as suggested.

This seems to satisfy the original requirements, but as Owen says, we should probably add proper support for other character sets.

Rayner Lucas <rayner>
Group administrator
Sat 06 Nov 2021 05:09:38 PM UTC, comment #1: 

As far as I can tell by searching the code, checkquot and cuthead are not used so could just be deleted.

antivirus behaving as it does now could probably be replaced by a simple perl script but allowing for modern news clients that can handle a wider range of character sets would mean handling character encodings properly and might need work in quite a lot of places in STUMP and WebStump.

isbinary could be replaced by a simple perl script or, my preference, replace the conforms_charter script with a perl module that has a function to replace isbinary (simple to get the same behaviour as the curren tone).

Owen Rees <owenrees>
Group Member
Fri 16 Oct 2020 11:12:33 AM UTC, original submission:  

All the C programs included in STUMP can probably be replaced with shell or Perl scripts, which will eliminate the dependency on a compiler (and compiled binaries) and will be safer (see other bug reports).  Below are some ideas for solutions, though we will need to check if they can be implemented portably.

1. antivirus.c simply replaces most non-printable characters with underscores, and wraps long lines.  This can probably be replaced with a shell script that wraps a sed script with a few simple s commands.

2. checkquot.c checks whether an article has too great a proportion of quoted lines (or more specifically, whether any one ASCII character begins too great a proportion of lines in the article).  This can probably be replaced with a shell script that does something like


cut -c1 | sort | uniq -c | sort -nr | head


and compares number against the output of wc -l.

3. cuthead.c simply cuts the first n lines of the file. This can probably be replaced with a shell script that wraps a sed script.

4. isbinary.c attempts to determine whether an article contains ASCII-encoded binary data. This can probably be replaced with a shell script that invokes grep and wc -l.

Tristan Miller <psychonaut>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rayner (Posted a comment)
  • -email is unavailable- added by owenrees (Posted a comment)
  • -email is unavailable- added by psychonaut (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code