Error on keyboard interrupt

Issue #56 resolved
Daniel Aleksandersen created an issue
  1. Run sshguard
  2. Press Ctrl+C

/opt/sshguard/libexec/sshg-fw-firewalld: line 51: read error: 0: Success

Version master/88b2dce45.

Comments (9)

  1. Kevin Zheng
    • changed status to open

    Not able to reproduce the issue here. What OS and shell are you running? If you switch to sshg-fw-null, does the same thing happen?

  2. Daniel Aleksandersen reporter

    What OS and shell are you running?

    Bash on Fedora 25.

    If you switch to sshg-fw-null, does the same thing happen?

    Yes.

    /opt/sshguard/libexec/sshg-fw-null: line 41: read error: 0: Success

  3. Kevin Zheng

    I'm slightly stumped here. I've tried editing the shebangs to bash and still don't see this error.

    I wonder what happens when you run sshg-fw-null or sshg-fw-firewalld by itself and CTRL-C out of it?

  4. Daniel Aleksandersen reporter

    I'm slightly stumped here.

    I’ve tried minimizing sshg-fw-null, but I don’t understand what triggers the error and when.

    I wonder what happens when you run sshg-fw-null or sshg-fw-firewalld by itself and CTRL-C out of it?

    Same problem.

  5. Kevin Zheng

    Try this patch to sshg-fw.in:

    diff --git a/src/fw/sshg-fw.in b/src/fw/sshg-fw.in
    index de61713..990a36f 100644
    --- a/src/fw/sshg-fw.in
    +++ b/src/fw/sshg-fw.in
    @@ -11,6 +11,7 @@ cleanup() {
             fw_flush
         fi
         fw_fin
    +    exit
     }
    
     trap cleanup EXIT INT
    

    Make sure to touch the *.sh files or make clean so that the scripts are rebuilt.

  6. Daniel Aleksandersen reporter

    + exit

    That does indeed get rid of the error message!

    Make sure to touch the *.sh files or make clean so that the scripts are rebuilt.

    This suggests a problem with automake targets … . I’ve worked around this with make -B up until now. Never thought of it a s a bug, but I guess it is.

  7. Kevin Zheng

    Fixed in ba09cf4, thanks!

    Yes, but again I'm not entirely sure how to fix it. I could use a pattern rule but then break the Makefile for BSD Make, or use suffix rules. But a caveat with suffix rules:

    "Suffix rules cannot have any prerequisites of their own. If they have any, they are treated as normal files with funny names, not as suffix rules."

    Although suffix rules with prerequisites appear to work with BSD Make.

  8. Log in to comment