honeyd/setenv.c

Wed, 29 Aug 2012 21:07:12 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 29 Aug 2012 21:07:12 +0200
changeset 649
c44c510c1c7f
permissions
-rw-r--r--

Back out libexec substitution now longer correct, remove manpages correspoding
to not installed binaries, and most importantly avoid linking to
cats_dummy which serves no other purpose than to sabotage runtime
operations of all binaries calling db_init_database(3) with a fatal
error message 'Please replace this dummy libbaccats library with a
proper one.' Disabling libtool use resolves this problem in the build
configuration (probably in src/cats/Makefile.in.)

     2 #ifndef HAVE_SETENV
     3 #ifdef HAVE_CONFIG_H
     4 #include "config.h"
     5 #endif
     6 #include <sys/types.h>
     7 #include <stdlib.h>
     8 #include <string.h>
    10 int setenv(const char *kszName, const char *kszValue, int nOverwrite)
    11 {
    12     char *szPair = NULL;
    14     if (nOverwrite == 0 && getenv(kszName) != 0)
    15         return 0;
    16     szPair = malloc(strlen(kszName) + 1 + strlen(kszValue) + 1);
    17     if (szPair == NULL)
    18         return -1;
    19     strcpy(szPair, kszName);
    20     strcat(szPair, "=");
    21     strcat(szPair, kszValue);
    22     putenv(szPair);
    23     return 0;
    24 }
    25 #endif /* !HAVE_SETENV */

mercurial