]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/auth/basic/NIS/nis_support.cc
2 * Copyright (C) 1996-2016 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
10 * Written By Rabellino Sergio (rabellino@di.unito.it) For Solaris 2.x
20 #include <sys/types.h>
26 #if _SQUID_FREEBSD_ && !defined(BOOL_DEFINED)
27 // BUG: FreeBSD rpcsvc/yp_* headers try to redefine bool unless we match their non-standard hack.
31 #if HAVE_RPCSVC_YPCLNT_H
32 #include <rpcsvc/ypclnt.h>
34 #if HAVE_RPCSVC_YP_PROT_H
35 #include <rpcsvc/yp_prot.h>
38 #include "auth/basic/NIS/nis_support.h"
40 #define NO_YPERR 0 /* There is no error */
43 get_nis_password(char *user
, char *nisdomain
, char *nismap
)
45 static char *val
= NULL
;
46 char *password
= NULL
;
50 printf("Domain is set to %s\n", nisdomain
);
51 printf("YP Map is set to %s\n", nismap
);
61 res
= yp_match(nisdomain
, nismap
, user
, strlen(user
), &val
, &vallen
);
66 (void) strtok(val
, ":");
67 password
= strtok(NULL
, ",:");
70 syslog(LOG_ERR
, "Squid Authentication through ypbind failure: can't communicate with ypbind");
72 case YPERR_KEY
: /* No such key in map */