Chris Miller <[EMAIL PROTECTED]> wrote:
> I'm attempting to compile using the freeradius-0.8.1-7.src.rpm located in
> the "rawhide" section of the RedHat ftp server, this was released just a
> few days ago. In this SRPM are a couple of patches. Aside from
> umteen-toomany dependancies for snmp which I have disabled via
> --with-snmp=no (don't need it), the build fails in the rlm_eap module
> apparently due to a redhat specific patch. Here's the compiler output :

  The patch is garbage.

> eap.c: In function `eaptype_load':
> eap.c:98: parse error before `char'
...
>         /* Link the loaded EAP-Type */
> -       handle = lt_dlopenext(auth_type_name);
> +       char *tmp = malloc(strlen(auth_type_name) + 4);

  It's C, not C++.  You CANNOT declare variables in the middle of a
function.  They should know this.

  GCC is often a little more forgiving, but that's no excuse.

  And I don't know why they found it necessary to make that patch, it
SHOULD work as-is.

> I've played around a little with the code, but this is beyond my immediate
> abilities. I'm hoping someone here may be familiar with what is trying to
> be done and can suggest a fix. I'm a little reluctant to remove the patch
> since someone was obviously trying to fix something with memory allocation

  No.  The lt_dlopenext() function does:

/* If FILENAME has an ARCHIVE_EXT or SHLIB_EXT extension, try to
   open the FILENAME as passed.  Otherwise try appending ARCHIVE_EXT,
   and if a file is still not found try again with SHLIB_EXT appended
   instead.  */

  i.e. lt_dlopenext() TAKES CARE of adding '.so' to  'auth_type_name',
and finding that library.  If it doesn't work on Redhat's system, then
they broke libltdl.

  Note that src/main/modules ALSO calls lt_dlopenext(), and DOES NOT
add the '.so' to the end.


  To "fix" the problem, you can go to the top of the function they're
patching, and add:

  char tmp[8192]

  and delete the lines in the patch calling 'malloc' and 'free'.

  It's a stupid patch, for at least 3 reasons.

  Alan DeKok.

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to