honeyd/setenv.c

Sat, 06 Oct 2012 16:24:01 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 06 Oct 2012 16:24:01 +0200
changeset 727
914043724d20
permissions
-rw-r--r--

Update to new vendor software version and adjust patch code accordingly.
Unfortunately the vendor has apparently failed to properly test this
release which depends on missing object symbols in libsasl2.a(common.o):

undefined reference to `sasl_randcreate'
undefined reference to `sasl_mkchal'
undefined reference to `sasl_utf8verify'
undefined reference to `sasl_rand'
undefined reference to `sasl_churn'
undefined reference to `sasl_encode64'
undefined reference to `sasl_decode64'
undefined reference to `sasl_erasebuffer'
undefined reference to `sasl_randfree'
undefined reference to `sasl_strlower'
undefined reference to `get_fqhostname'

...yet to be patched.

     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