X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fslocal.c;h=993a141a0c3a6f217598554f9aad15bf88ee931c;hp=bbf1850615034813236eae29014838b0ab8d60cc;hb=0cd75fec1902ab5540539fe8c95a071caf18f58e;hpb=08baf4f8bc7623c41a9753c71aed9a4042196aac diff --git a/uip/slocal.c b/uip/slocal.c index bbf1850..993a141 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -48,20 +48,14 @@ extern int initgroups(char*, int); #endif - -#ifdef HAVE_DB1_NDBM_H -#include -#else -#ifdef HAVE_GDBM_NDBM_H -#include -#else -#if defined(HAVE_DB_H) && defined(HAVE_LIBDB) +/* This define is needed for Berkeley db v2 and above to + * make the header file expose the 'historical' ndbm APIs. + * We define it unconditionally because this is simple and + * harmless. + */ #define DB_DBM_HSEARCH 1 -#include -#else -#include -#endif -#endif +#ifdef NDBM_HEADER +#include NDBM_HEADER #endif #include @@ -965,9 +959,13 @@ logged_in (void) setutent(); while ((utp = getutent()) != NULL) { - if (utp->ut_type == USER_PROCESS - && utp->ut_user[0] != 0 - && strncmp (user, utp->ut_user, sizeof(utp->ut_user)) == 0) { + if ( +#ifdef HAVE_UTMP_UT_TYPE + utp->ut_type == USER_PROCESS + && +#endif + utp->ut_name[0] != 0 + && strncmp (user, utp->ut_name, sizeof(utp->ut_name)) == 0) { if (debug) continue; endutent();