]>
git.ipfire.org Git - thirdparty/squid.git/blob - helpers/basic_auth/NIS/nis_support.cc
2 * Written By Rabellino Sergio (rabellino@di.unito.it) For Solaris 2.x
12 #if _SQUID_FREEBSD_ && !defined(BOOL_DEFINED)
13 // BUG: FreeBSD rpcsvc/yp_* headers try to redefine bool unless we match their non-standard hack.
17 #include <rpcsvc/ypclnt.h>
18 #include <rpcsvc/yp_prot.h>
20 #include "nis_support.h"
22 #define NO_YPERR 0 /* There is no error */
25 get_nis_password(char *user
, char *nisdomain
, char *nismap
)
27 static char *val
= NULL
;
28 char *password
= NULL
;
32 printf("Domain is set to %s\n", nisdomain
);
33 printf("YP Map is set to %s\n", nismap
);
43 res
= yp_match(nisdomain
, nismap
, user
, strlen(user
), &val
, &vallen
);
48 (void) strtok(val
, ":");
49 password
= strtok(NULL
, ",:");
52 syslog(LOG_ERR
, "Squid Authentication through ypbind failure: can't communicate with ypbind");
54 case YPERR_KEY
: /* No such key in map */