Sign inSign up

nowx/nbsp-ldmfilter

By nowx

Updated about 9 years ago

Stand up an LDMFilter on your NBSP!

Image
0

340

nowx/nbsp-ldmfilter repository overview

nbsp-ldmfilter-dockerfile Build Status Docker Build Status Docker Build Status

Does the necessary magic to enable the LDMFilter with NBSP. This simply extends our NBSP Dockerfile to compile the LDMFilter. It does not alter any configuration.

Notes for the wise
  • You need to make install LDM because the LDMFilter looks in the installed location for the files it needs
  • This suffers from the same version mess that the NBSP Dockerfile has with regards to FTP. You can see more details in the README for that repo (note that instead of being the NBSP version it is the LDM version).
  • The thing probably compiles like a champ on BSD things, but on normal people Linux, it does not work out of the box. See the next heading.
About the broken implementation of the LDMFilter

Consider the following excerpt from grep:

> grep optreset nbsp2ldm.c
   * FreeBSD optreset must be set to 1 before the second and each additional
    optreset = 1;

And the following excerpt from ldmfilter.c:

/*
 * If (optind != 1) it means we are re-entering this function. In
 * FreeBSD optreset must be set to 1 before the second and each additional
 * set of calls to getopt(), and the variable optind must be reinitialized.
 */
if(optind != 1){
    optreset = 1;
    optind = 1;
}

To the everyman eye it probably looks fine. However, the Eye of Sauron would catch that optreset has not been declared anywhere! "How could this ever work", you scream in frustration. "This isn't PHP!", you scream, hoping for some kind of divine intervention before your keyboard is nothing more than a plastic base sitting in a pile of scattered buttons. Because the Elven smiths of BSD have forged it in the fires of Mount Doom. It is everywhere and nowhere. And of course very precious.

So sed/(optreset = 1;)/int \1/ that fool and move on!

Tag summary

Content type

Image

Digest

Size

224 MB

Last updated

about 9 years ago

docker pull nowx/nbsp-ldmfilter