Logo Search packages:      
Sourcecode: remotefs version File versions

crypt.c

#include <dlfcn.h>
#include <string.h>

extern char *__md5_crypt(const char *, const char *);

char *
crypt(const char *pw, const char *salt)
{
      char *(*func)(const char *, const char *);

      if (strncmp(salt, "$1$", 3) == 0) {
            func = __md5_crypt;
      } else {
            func = dlsym(RTLD_NEXT, "crypt");
            if (!func)
                  func = __md5_crypt;
      }

      return func(pw, salt);
}

Generated by  Doxygen 1.6.0   Back to index