Menu

#31 Neat FIX for md5.h compile problem

open
nobody
None
5
2006-05-10
2006-05-10
Fabio
No

Hello.
I had the same problem compiling this library on my
Fedora Core 4, and i managed to fix it by editing
/usr/include/md5.h and adding the following lines near
the beginning of the file:

typedef unsigned long int UINT4;
#if PROTOTYPES
#define PROTO_LIST(list) list
#else
#define PROTO_LIST(list) ()
#endif

then it compiled fine.

Discussion

  • Erik Augustsson

    Erik Augustsson - 2006-07-01

    Logged In: YES
    user_id=126966

    Can you confim that your version of pam_mysql also works,
    not just compiles. Do you run any md5 authentications?

     
  • Nobody/Anonymous

    Logged In: NO

    To tell the truth i can't say i'm 100% sure! The reason is
    that after making it compile, i remembered that i needed a
    feature which was still not present, and so i switched to an
    older version of pam_mysql, which i had customized in order
    to make it work with DBMAIL mail accounts (where the DB can
    store the password in many different formats). The missing
    feature was the ability to dynamically read passwords in md5
    or plain format according to the value of a column.
    With my custom version (which is based on an older 0.5 if i
    remember well) md5 authentications work as expected, but i
    don't remember whether /usr/include/md5.h was required in
    order to make that version compile (and unfortunately, since
    i'm now working for a different company, i cannot easily
    check that out). Anyway, i think the latest version should
    work with this fix, because i copied those lines from a
    different md5.h file found on the internet, and those lines
    really looked like the missing part of "our" md5.h file.

    Did you actually encounter a problem with md5
    authentications or are you just asking for curiosity?

    Regards

     
  • Erik Augustsson

    Erik Augustsson - 2006-07-09

    Logged In: YES
    user_id=126966

    Ok, Thank you for the good reply.
    I was just curious. I decided to move back to a version of
    pam_mysql the I've been using before and known works. I
    can't afford another testcycle on this sytem :-(

     
  • Abel Cheung

    Abel Cheung - 2006-07-27

    Logged In: YES
    user_id=207218

    Editing header manually isn't a neat fix at all, the major
    problem is that the md5 headers are not correctly identified
    by pam-mysql currently. Although I must say RedHat and its
    descendants packaged cyrus-sasl in a somewhat broken way --
    placing sasl1 headers in /usr/include and sasl2 headers in
    /usr/include/sasl.

     
  • Nobody/Anonymous

    Logged In: NO

    Or... You could add:

    #include "md5global.h"

    to the top of /usr/include/md5.h and it'll fix it as well..

     
  • Nobody/Anonymous

    Logged In: NO

    I spent some time tracking this down what I think is a related issue today. If you are referring to a compile error when md5.h is brought in indicating that UINT4 is unknown, then the good news is that you don't have to edit the md5 source code as indicated by Nobody/Anonymous above. Instead, it is a one-line fix inside pam_mysql.c. The error is simple: any time md5.h is brought in, it must be preceded by md5global.h. I am looking at source code for RC7 dated, and md5.h is brought in conditionally through compile directives in two places - but only one place properly brings in md5global.h before it. Simply add the same md5global.h before the other md5.h and you'll be all set.

    Regards,
    seanATkeenkellyDOTcom

     

Log in to post a comment.