#48 fix for the broken @@ifhost and @@ifnhost directives


According to the documentation (and how aide / tripwire
has worked in the past), @@ifhost checks whether the
hostname, without the domain name, marches.

The ifhost logic in do_ifxhost() in commandconf.c fails
to strip off any .domain from the buffer used by
gethostname(). Note that in many systems, the hostname
is set to a fully qualified domain name, so this strip
is needed prior to the token compare.

Also, the malloc for the buffer used by gethostame is
not checked for a return of NULL.

This patch fixes this problem


  • (chongo) Landon Curt Noll

    • priority: 5 --> 8
    • summary: fix of @@ifhost and @@ifnhost: --> fix for the broken @@ifhost and @@ifnhost directives
  • (chongo) Landon Curt Noll

    Logged In: YES

    See attached file for the patch

  • Richard van den Berg

    Logged In: YES

    This bug/patch has been fixed in CVS. Please note that anonymous
    access to CVS lags about 2 hours behind the authenticated access
    that developers use.

    If you don't know how to use CVS, you can try the daily snapshot
    which within 24 hours should include this change:

  • Richard van den Berg

    • assigned_to: nobody --> rvdb
    • status: open --> closed

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks