Date: Sun, 2 Aug 2009 11:15:16 GMT From: "Alexander V. Chernikov" <melifaro@ipfw.ru> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/137349: New port: net/nss_ldapd nss_ldap advanced fork Message-ID: <200908021115.n72BFG41039477@www.freebsd.org> Resent-Message-ID: <200908021120.n72BK2F9011689@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 137349 >Category: ports >Synopsis: New port: net/nss_ldapd nss_ldap advanced fork >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Aug 02 11:20:02 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Alexander V. Chernikov >Release: 8.0-BETA1 >Organization: >Environment: FreeBSD ws.ipfw.ru 8.0-BETA1 FreeBSD 8.0-BETA1 #9: Wed Jul 8 22:57:18 MSD 2009 root@ws.ipfw.ru:/usr/obj/usr/src/sys/WS amd64 >Description: Key features: * Moves all ldap_* queries to nslcd daemon * nss client library is small and fast * extendability of client<>server protocol >How-To-Repeat: >Fix: Patch attached with submission follows: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # nss_ldapd # nss_ldapd/files # nss_ldapd/files/patch-fbsd # nss_ldapd/files/patch-getpw # nss_ldapd/files/nslcd.in # nss_ldapd/files/bsdnss.c # nss_ldapd/files/nss_compat.diff # nss_ldapd/files/patch-exports # nss_ldapd/Makefile # nss_ldapd/distinfo # nss_ldapd/pkg-descr # nss_ldapd/pkg-plist # echo c - nss_ldapd mkdir -p nss_ldapd > /dev/null 2>&1 echo c - nss_ldapd/files mkdir -p nss_ldapd/files > /dev/null 2>&1 echo x - nss_ldapd/files/patch-fbsd sed 's/^X//' >nss_ldapd/files/patch-fbsd << 'END-of-nss_ldapd/files/patch-fbsd' X--- nslcd/cfg.c.orig 2009-07-23 15:44:11.000000000 +0400 X+++ nslcd/cfg.c 2009-07-23 15:44:14.000000000 +0400 X@@ -36,9 +36,11 @@ X #include <errno.h> X #include <netdb.h> X #include <sys/socket.h> X+#ifndef __FreeBSD__ X #ifdef HAVE_GSSAPI_H X #include <gssapi.h> X #endif /* HAVE_GSSAPI_H */ X+#endif X #ifdef HAVE_GSSAPI_GSSAPI_KRB5_H X #include <gssapi/gssapi.h> X #include <gssapi/gssapi_krb5.h> X--- nss/shadow.c.orig 2009-07-23 15:44:49.000000000 +0400 X+++ nss/shadow.c 2009-07-23 15:44:55.000000000 +0400 X@@ -22,6 +22,7 @@ X X #include "config.h" X X+#ifdef HAVE_SHADOW_H X #include <string.h> X #include <nss.h> X #include <errno.h> X@@ -73,3 +74,6 @@ X { X NSS_ENDENT(spentfp); X } X+ X+#endif X+ X--- nslcd/common.c.orig 2009-07-23 15:46:05.000000000 +0400 X+++ nslcd/common.c 2009-07-23 15:46:20.000000000 +0400 X@@ -27,6 +27,9 @@ X #include <stdarg.h> X #include <sys/types.h> X #include <sys/socket.h> X+#ifdef __FreeBSD__ X+#include <netinet/in.h> X+#endif X #include <arpa/inet.h> X #include <strings.h> X #include <limits.h> X--- nss/prototypes.h.orig 2009-07-23 12:35:41.000000000 +0400 X+++ nss/prototypes.h 2009-07-23 15:21:43.000000000 +0400 X@@ -24,13 +24,40 @@ X #define _NSS_EXPORTS_H 1 X X #include <nss.h> X-#include <aliases.h> X+#ifndef __FreeBSD__ X #include <netinet/ether.h> X+#else X+#include <net/ethernet.h> X+#include <sys/socket.h> X+#endif X #include <sys/types.h> X #include <grp.h> X #include <netdb.h> X #include <pwd.h> X+#ifdef HAVE_SHADOW_H X #include <shadow.h> X+#endif X+ X+#ifdef __FreeBSD__ X+/* X+ * Import from aliases.h X+ */ X+struct aliasent X+ { X+ char *alias_name; X+ size_t alias_members_len; X+ char **alias_members; X+ int alias_local; X+ }; X+ X+struct rpcent X+{ X+ char *r_name; /* Name of server for this rpc program. */ X+ char **r_aliases; /* Alias list. */ X+ int r_number; /* RPC program number. */ X+}; X+ X+#endif X X /* We define struct etherent here because it does not seem to X be defined in any publicly available header file exposed X@@ -160,10 +187,12 @@ X enum nss_status _nss_ldap_getservent_r(struct servent *result,char *buffer,size_t buflen,int *errnop); X enum nss_status _nss_ldap_endservent(void); X X+#ifdef HAVE_SHADOW_H X /* shadow - extended user information */ X enum nss_status _nss_ldap_getspnam_r(const char *name,struct spwd *result,char *buffer,size_t buflen,int *errnop); X enum nss_status _nss_ldap_setspent(int stayopen); X enum nss_status _nss_ldap_getspent_r(struct spwd *result,char *buffer,size_t buflen,int *errnop); X enum nss_status _nss_ldap_endspent(void); X+#endif X X #endif /* not NSS_EXPORTS */ END-of-nss_ldapd/files/patch-fbsd echo x - nss_ldapd/files/patch-getpw sed 's/^X//' >nss_ldapd/files/patch-getpw << 'END-of-nss_ldapd/files/patch-getpw' X--- nslcd/nslcd.c.orig 2009-08-02 13:29:40.000000000 +0400 X+++ nslcd/nslcd.c 2009-08-02 13:54:14.000000000 +0400 X@@ -398,9 +398,9 @@ X case NSLCD_ACTION_NETWORK_BYNAME: (void)nslcd_network_byname(fp,session); break; X case NSLCD_ACTION_NETWORK_BYADDR: (void)nslcd_network_byaddr(fp,session); break; X case NSLCD_ACTION_NETWORK_ALL: (void)nslcd_network_all(fp,session); break; X- case NSLCD_ACTION_PASSWD_BYNAME: (void)nslcd_passwd_byname(fp,session); break; X- case NSLCD_ACTION_PASSWD_BYUID: (void)nslcd_passwd_byuid(fp,session); break; X- case NSLCD_ACTION_PASSWD_ALL: (void)nslcd_passwd_all(fp,session); break; X+ case NSLCD_ACTION_PASSWD_BYNAME: (void)nslcd_passwd_byname(fp,session,uid); break; X+ case NSLCD_ACTION_PASSWD_BYUID: (void)nslcd_passwd_byuid(fp,session,uid); break; X+ case NSLCD_ACTION_PASSWD_ALL: (void)nslcd_passwd_all(fp,session,uid); break; X case NSLCD_ACTION_PROTOCOL_BYNAME: (void)nslcd_protocol_byname(fp,session); break; X case NSLCD_ACTION_PROTOCOL_BYNUMBER:(void)nslcd_protocol_bynumber(fp,session); break; X case NSLCD_ACTION_PROTOCOL_ALL: (void)nslcd_protocol_all(fp,session); break; X--- nslcd/common.h.orig 2009-08-02 13:39:07.000000000 +0400 X+++ nslcd/common.h 2009-08-02 14:15:20.000000000 +0400 X@@ -124,9 +124,9 @@ X int nslcd_network_byname(TFILE *fp,MYLDAP_SESSION *session); X int nslcd_network_byaddr(TFILE *fp,MYLDAP_SESSION *session); X int nslcd_network_all(TFILE *fp,MYLDAP_SESSION *session); X-int nslcd_passwd_byname(TFILE *fp,MYLDAP_SESSION *session); X-int nslcd_passwd_byuid(TFILE *fp,MYLDAP_SESSION *session); X-int nslcd_passwd_all(TFILE *fp,MYLDAP_SESSION *session); X+int nslcd_passwd_byname(TFILE *fp,MYLDAP_SESSION *session,uid_t uid); X+int nslcd_passwd_byuid(TFILE *fp,MYLDAP_SESSION *session,uid_t uid); X+int nslcd_passwd_all(TFILE *fp,MYLDAP_SESSION *session,uid_t uid); X int nslcd_protocol_byname(TFILE *fp,MYLDAP_SESSION *session); X int nslcd_protocol_bynumber(TFILE *fp,MYLDAP_SESSION *session); X int nslcd_protocol_all(TFILE *fp,MYLDAP_SESSION *session); X@@ -145,8 +145,12 @@ X int nslcd_pam_pwmod(TFILE *fp,MYLDAP_SESSION *session); X X /* macro for generating service handling code */ X-#define NSLCD_HANDLE(db,fn,readfn,logcall,action,mkfilter,writefn) \ X- int nslcd_##db##_##fn(TFILE *fp,MYLDAP_SESSION *session) \ X+#define COMMA , X+#define NSLCD_HANDLE(db,fn,readfn,logcall,action,mkfilter,writefn) NSLCD_HANDLE_PARAMS(db,fn,,readfn,logcall,action,mkfilter,writefn) X+#define NSLCD_HANDLE_UID(db,fn,readfn,logcall,action,mkfilter,writefn) NSLCD_HANDLE_PARAMS(db,fn,COMMA uid_t calleruid,readfn,logcall,action,mkfilter,writefn) X+ X+#define NSLCD_HANDLE_PARAMS(db,fn,params,readfn,logcall,action,mkfilter,writefn) \ X+ int nslcd_##db##_##fn(TFILE *fp,MYLDAP_SESSION *session params ) \ X { \ X /* define common variables */ \ X int32_t tmpint32; \ X--- nslcd/passwd.c.orig 2009-08-02 13:53:38.000000000 +0400 X+++ nslcd/passwd.c 2009-08-02 13:59:27.000000000 +0400 X@@ -292,7 +292,7 @@ X #define MAXUIDS_PER_ENTRY 5 X X static int write_passwd(TFILE *fp,MYLDAP_ENTRY *entry,const char *requser, X- const uid_t *requid) X+ const uid_t *requid,uid_t calleruid) X { X int32_t tmpint32; X const char **tmpvalues; X@@ -323,7 +323,7 @@ X else X { X passwd=get_userpassword(entry,attmap_passwd_userPassword); X- if (passwd==NULL) X+ if ((passwd==NULL) || (calleruid!=0)) X passwd=default_passwd_userPassword; X } X /* get the uids for this entry */ X@@ -451,7 +451,7 @@ X return 0; X } X X-NSLCD_HANDLE( X+NSLCD_HANDLE_UID( X passwd,byname, X char name[256]; X char filter[1024]; X@@ -463,10 +463,10 @@ X log_log(LOG_DEBUG,"nslcd_passwd_byname(%s)",name);, X NSLCD_ACTION_PASSWD_BYNAME, X mkfilter_passwd_byname(name,filter,sizeof(filter)), X- write_passwd(fp,entry,name,NULL) X+ write_passwd(fp,entry,name,NULL,calleruid) X ) X X-NSLCD_HANDLE( X+NSLCD_HANDLE_UID( X passwd,byuid, X uid_t uid; X char filter[1024]; X@@ -474,15 +474,15 @@ X log_log(LOG_DEBUG,"nslcd_passwd_byuid(%d)",(int)uid);, X NSLCD_ACTION_PASSWD_BYUID, X mkfilter_passwd_byuid(uid,filter,sizeof(filter)), X- write_passwd(fp,entry,NULL,&uid) X+ write_passwd(fp,entry,NULL,&uid,calleruid) X ) X X-NSLCD_HANDLE( X+NSLCD_HANDLE_UID( X passwd,all, X const char *filter; X /* no parameters to read */, X log_log(LOG_DEBUG,"nslcd_passwd_all()");, X NSLCD_ACTION_PASSWD_ALL, X (filter=passwd_filter,0), X- write_passwd(fp,entry,NULL,NULL) X+ write_passwd(fp,entry,NULL,NULL,calleruid) X ) END-of-nss_ldapd/files/patch-getpw echo x - nss_ldapd/files/nslcd.in sed 's/^X//' >nss_ldapd/files/nslcd.in << 'END-of-nss_ldapd/files/nslcd.in' X#!/bin/sh X# X# $FreeBSD: ports/net/nslcd4/files/nslcd.in,v 1.1 2006/10/31 02:42:33 marcus Exp $ X# X# PROVIDE: nslcd X# REQUIRE: DAEMON X# X# Add the following line to /etc/rc.conf to enable the nslcd daemon: X# X# nslcd_enable="YES" X# X Xnslcd_enable=${nslcd_enable-"NO"} X X. %%RC_SUBR%% X Xname=nslcd Xrcvar=`set_rcvar` X Xcommand="/usr/local/sbin/nslcd" Xpidfile="/var/run/${name}.pid" X Xload_rc_config ${name} Xrun_rc_command "$1" END-of-nss_ldapd/files/nslcd.in echo x - nss_ldapd/files/bsdnss.c sed 's/^X//' >nss_ldapd/files/bsdnss.c << 'END-of-nss_ldapd/files/bsdnss.c' X#include <errno.h> X#include <sys/param.h> X#include <netinet/in.h> X#include <pwd.h> X#include <grp.h> X#include <nss.h> X#include <netdb.h> X Xextern enum nss_status _nss_ldap_getgrent_r(struct group *, char *, size_t, X int *); Xextern enum nss_status _nss_ldap_getgrnam_r(const char *, struct group *, X char *, size_t, int *); Xextern enum nss_status _nss_ldap_getgrgid_r(gid_t gid, struct group *, char *, X size_t, int *); Xextern enum nss_status _nss_ldap_setgrent(void); Xextern enum nss_status _nss_ldap_endgrent(void); X Xextern enum nss_status _nss_ldap_getpwent_r(struct passwd *, char *, size_t, X int *); Xextern enum nss_status _nss_ldap_getpwnam_r(const char *, struct passwd *, X char *, size_t, int *); Xextern enum nss_status _nss_ldap_getpwuid_r(gid_t gid, struct passwd *, char *, X size_t, int *); Xextern enum nss_status _nss_ldap_setpwent(void); Xextern enum nss_status _nss_ldap_endpwent(void); X Xextern enum nss_status _nss_ldap_gethostbyname_r (const char *name, struct hostent * result, X char *buffer, size_t buflen, int *errnop, X int *h_errnop); X Xextern enum nss_status _nss_ldap_gethostbyname2_r (const char *name, int af, struct hostent * result, X char *buffer, size_t buflen, int *errnop, X int *h_errnop); Xextern enum nss_status _nss_ldap_gethostbyaddr_r (struct in_addr * addr, int len, int type, X struct hostent * result, char *buffer, X size_t buflen, int *errnop, int *h_errnop); X XNSS_METHOD_PROTOTYPE(__nss_compat_getgrnam_r); XNSS_METHOD_PROTOTYPE(__nss_compat_getgrgid_r); XNSS_METHOD_PROTOTYPE(__nss_compat_getgrent_r); XNSS_METHOD_PROTOTYPE(__nss_compat_setgrent); XNSS_METHOD_PROTOTYPE(__nss_compat_endgrent); X XNSS_METHOD_PROTOTYPE(__nss_compat_getpwnam_r); XNSS_METHOD_PROTOTYPE(__nss_compat_getpwuid_r); XNSS_METHOD_PROTOTYPE(__nss_compat_getpwent_r); XNSS_METHOD_PROTOTYPE(__nss_compat_setpwent); XNSS_METHOD_PROTOTYPE(__nss_compat_endpwent); X XNSS_METHOD_PROTOTYPE(__nss_compat_gethostbyname); XNSS_METHOD_PROTOTYPE(__nss_compat_gethostbyname2); XNSS_METHOD_PROTOTYPE(__nss_compat_gethostbyaddr); X Xstatic ns_mtab methods[] = { X{ NSDB_GROUP, "getgrnam_r", __nss_compat_getgrnam_r, _nss_ldap_getgrnam_r }, X{ NSDB_GROUP, "getgrgid_r", __nss_compat_getgrgid_r, _nss_ldap_getgrgid_r }, X{ NSDB_GROUP, "getgrent_r", __nss_compat_getgrent_r, _nss_ldap_getgrent_r }, X{ NSDB_GROUP, "setgrent", __nss_compat_setgrent, _nss_ldap_setgrent }, X{ NSDB_GROUP, "endgrent", __nss_compat_endgrent, _nss_ldap_endgrent }, X X{ NSDB_PASSWD, "getpwnam_r", __nss_compat_getpwnam_r, _nss_ldap_getpwnam_r }, X{ NSDB_PASSWD, "getpwuid_r", __nss_compat_getpwuid_r, _nss_ldap_getpwuid_r }, X{ NSDB_PASSWD, "getpwent_r", __nss_compat_getpwent_r, _nss_ldap_getpwent_r }, X{ NSDB_PASSWD, "setpwent", __nss_compat_setpwent, _nss_ldap_setpwent }, X{ NSDB_PASSWD, "endpwent", __nss_compat_endpwent, _nss_ldap_endpwent }, X X{ NSDB_HOSTS, "gethostbyname", __nss_compat_gethostbyname, _nss_ldap_gethostbyname_r }, X{ NSDB_HOSTS, "gethostbyaddr", __nss_compat_gethostbyaddr, _nss_ldap_gethostbyaddr_r }, X{ NSDB_HOSTS, "gethostbyname2", __nss_compat_gethostbyname2, _nss_ldap_gethostbyname2_r }, X X{ NSDB_GROUP_COMPAT, "getgrnam_r", __nss_compat_getgrnam_r, _nss_ldap_getgrnam_r }, X{ NSDB_GROUP_COMPAT, "getgrgid_r", __nss_compat_getgrgid_r, _nss_ldap_getgrgid_r }, X{ NSDB_GROUP_COMPAT, "getgrent_r", __nss_compat_getgrent_r, _nss_ldap_getgrent_r }, X{ NSDB_GROUP_COMPAT, "setgrent", __nss_compat_setgrent, _nss_ldap_setgrent }, X{ NSDB_GROUP_COMPAT, "endgrent", __nss_compat_endgrent, _nss_ldap_endgrent }, X X{ NSDB_PASSWD_COMPAT, "getpwnam_r", __nss_compat_getpwnam_r, _nss_ldap_getpwnam_r }, X{ NSDB_PASSWD_COMPAT, "getpwuid_r", __nss_compat_getpwuid_r, _nss_ldap_getpwuid_r }, X{ NSDB_PASSWD_COMPAT, "getpwent_r", __nss_compat_getpwent_r, _nss_ldap_getpwent_r }, X{ NSDB_PASSWD_COMPAT, "setpwent", __nss_compat_setpwent, _nss_ldap_setpwent }, X{ NSDB_PASSWD_COMPAT, "endpwent", __nss_compat_endpwent, _nss_ldap_endpwent }, X X}; X X Xns_mtab * Xnss_module_register(const char *source, unsigned int *mtabsize, X nss_module_unregister_fn *unreg) X{ X *mtabsize = sizeof(methods)/sizeof(methods[0]); X *unreg = NULL; X return (methods); X} X Xint __nss_compat_gethostbyname(void *retval, void *mdata, va_list ap) X{ X enum nss_status (*fn)(const char *, struct hostent *, char *, size_t, int *, int *); X const char *name; X struct hostent *result; X char buffer[1024]; X size_t buflen = 1024; X int errnop; X int h_errnop; X int af; X enum nss_status status; X fn = mdata; X name = va_arg(ap, const char*); X af = va_arg(ap,int); X result = va_arg(ap,struct hostent *); X status = fn(name, result, buffer, buflen, &errnop, &h_errnop); X status = __nss_compat_result(status,errnop); X h_errno = h_errnop; X return (status); X} X Xint __nss_compat_gethostbyname2(void *retval, void *mdata, va_list ap) X{ X enum nss_status (*fn)(const char *, struct hostent *, char *, size_t, int *, int *); X const char *name; X struct hostent *result; X char buffer[1024]; X size_t buflen = 1024; X int errnop; X int h_errnop; X int af; X enum nss_status status; X fn = mdata; X name = va_arg(ap, const char*); X af = va_arg(ap,int); X result = va_arg(ap,struct hostent *); X status = fn(name, result, buffer, buflen, &errnop, &h_errnop); X status = __nss_compat_result(status,errnop); X h_errno = h_errnop; X return (status); X} X Xint __nss_compat_gethostbyaddr(void *retval, void *mdata, va_list ap) X{ X struct in_addr *addr; X int len; X int type; X struct hostent *result; X char buffer[1024]; X size_t buflen = 1024; X int errnop; X int h_errnop; X enum nss_status (*fn)(struct in_addr *, int, int, struct hostent *, char *, size_t, int *, int *); X enum nss_status status; X fn = mdata; X addr = va_arg(ap, struct in_addr*); X len = va_arg(ap,int); X type = va_arg(ap,int); X result = va_arg(ap, struct hostent*); X status = fn(addr, len, type, result, buffer, buflen, &errnop, &h_errnop); X status = __nss_compat_result(status,errnop); X h_errno = h_errnop; X return (status); X} END-of-nss_ldapd/files/bsdnss.c echo x - nss_ldapd/files/nss_compat.diff sed 's/^X//' >nss_ldapd/files/nss_compat.diff << 'END-of-nss_ldapd/files/nss_compat.diff' X--- nslcd/cfg.c.orig 2009-08-02 04:47:26.000000000 +0400 X+++ nslcd/cfg.c 2009-08-02 04:51:49.000000000 +0400 X@@ -33,6 +33,7 @@ X #include <sys/types.h> X #include <sys/stat.h> X #include <unistd.h> X+#include <libgen.h> X #include <errno.h> X #include <netdb.h> X #include <sys/socket.h> X@@ -651,13 +652,30 @@ X { X FILE *fp; X int lnr=0; X- char linebuf[MAX_LINE_LENGTH]; X+ char linebuf[MAX_LINE_LENGTH], secret_path[512]; X char *line; X char keyword[32]; X char token[64]; X int i; X int rc; X char *value; X+ X+ /* get secret password */ X+ snprintf(secret_path, sizeof(secret_path), "%s/nss_ldap.secret", dirname(filename)); X+ if ((fp=fopen(secret_path,"r"))==NULL) X+ { X+ log_log(LOG_ERR,"cannot open secret file (%s): %s",secret_path,strerror(errno)); X+ /* exit(EXIT_FAILURE); */ X+ } X+ if (fgets(linebuf,MAX_LINE_LENGTH,fp)!=NULL) X+ { X+ i=strlen(linebuf); X+ if (i>0) X+ linebuf[i-1]='\0'; X+ cfg->ldc_bindpw=strdup(linebuf); X+ } X+ fclose(fp); X+ X /* open config file */ X if ((fp=fopen(filename,"r"))==NULL) X { X@@ -726,13 +744,14 @@ X get_int(filename,lnr,keyword,&line,&cfg->ldc_version); X get_eol(filename,lnr,keyword,&line); X } X- else if (strcasecmp(keyword,"binddn")==0) X+ else if (strcasecmp(keyword,"rootbinddn")==0) X { X get_restdup(filename,lnr,keyword,&line,&cfg->ldc_binddn); X } X else if (strcasecmp(keyword,"bindpw")==0) X { X- get_restdup(filename,lnr,keyword,&line,&cfg->ldc_bindpw); X+ if (cfg->ldc_bindpw == NULL) X+ get_restdup(filename,lnr,keyword,&line,&cfg->ldc_bindpw); X } X /* SASL authentication options */ X else if (strcasecmp(keyword,"sasl_authcid")==0) X@@ -933,12 +952,14 @@ X get_int(filename,lnr,keyword,&line,&cfg->ldc_pagesize); X get_eol(filename,lnr,keyword,&line); X } X+#if 0 X /* fallthrough */ X else X { X log_log(LOG_ERR,"%s:%d: unknown keyword: '%s'",filename,lnr,keyword); X exit(EXIT_FAILURE); X } X+#endif X } X /* we're done reading file, close */ X fclose(fp); END-of-nss_ldapd/files/nss_compat.diff echo x - nss_ldapd/files/patch-exports sed 's/^X//' >nss_ldapd/files/patch-exports << 'END-of-nss_ldapd/files/patch-exports' X--- nss/exports.linux 2009-07-26 16:29:19.000000000 +0400 X+++ nss/exports.freebsd 2009-07-26 16:29:16.000000000 +0400 X@@ -78,6 +78,27 @@ X _nss_ldap_getspent_r; X _nss_ldap_endspent; X X+ # compat 4 bsd X+ __nss_compat_getgrnam_r; X+ __nss_compat_getgrgid_r; X+ __nss_compat_getgrent_r; X+ __nss_compat_setgrent; X+ __nss_compat_endgrent; X+ X+ __nss_compat_getpwnam_r; X+ __nss_compat_getpwuid_r; X+ __nss_compat_getpwent_r; X+ __nss_compat_setpwent; X+ __nss_compat_endpwent; X+ X+ __nss_compat_gethostbyname; X+ __nss_compat_gethostbyname2; X+ __nss_compat_gethostbyaddr; X+ X+ # module init X+ nss_module_register; X+ X+ X # everything else should not be exported X local: X *; END-of-nss_ldapd/files/patch-exports echo x - nss_ldapd/Makefile sed 's/^X//' >nss_ldapd/Makefile << 'END-of-nss_ldapd/Makefile' X# Ports collection Makefile for: nss_ldapd X# Date created: 23/7/2009 X# Whom: nectar@FreeBSD.org X# X# $FreeBSD$ X# X XPORTNAME= nss_ldapd XPORTVERSION= 0.6.11 XCATEGORIES= net XMASTER_SITES= http://arthurdejong.org/nss-ldapd/ XDISTNAME= nss-ldapd-${PORTVERSION} X XMAINTAINER= melifaro@ipfw.ru XCOMMENT= nss_ldap advanced fork X XGNU_CONFIGURE= yes XUSE_GMAKE= yes XUSE_LDCONFIG= yes XUSE_OPENLDAP= yes XUSE_RC_SUBR= nslcd X XOPTIONS= NSS_COMPAT "Enable nss_ldap compatibility" on \ X SASL "Enable SASL" off X X.include <bsd.port.pre.mk> X X.if ${OSVERSION} < 700000 XBROKEN=Problems with nss/libc? TLS X.endif X XCONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \ X LDFLAGS="-L${LOCALBASE}/lib" X XCONFIGURE_ARGS+= --with-nslcd-pidfile=/var/run/nslcd.pid \ X --with-nslcd-socket=/var/run/nslcd.ctl X X.if defined(WITHOUT_NSS) X.undef NSS_COMPAT X.endif X X.if defined(WITH_NSS_COMPAT) XCONFIGURE_ARGS+= --with-ldap-conf-file=${PREFIX}/etc/nss_ldap.conf XPLIST_SUB+= COMPAT="nss_ldap" XEXTRA_PATCHES+= ${PATCHDIR}/nss_compat.diff X.else XCONFIGURE_ARGS+= --with-ldap-conf-file=${PREFIX}/etc/nss_ldapd.conf XPLIST_SUB+= COMPAT="nss_ldapd" X.endif X X.if defined(WITH_SASL) XWANT_OPENLDAP_SASL=yes XCONFIGURE_ARGS+= --enable-sasl X.else XCONFIGURE_ARGS+= --disable-sasl X.endif X X.if defined(WITH_PAM) XCONFIGURE_ARGS+= --enable-pam X.else XCONFIGURE_ARGS+= --disable-pam X.endif X X.if defined(WITHOUT_NSS) XCONFIGURE_ARGS+= --disable-nss XPLIST_SUB+= NSS="@comment " X.else XCONFIGURE_ARGS+= --enable-nss XCONFLICTS+= nss_ldap-.* XPLIST_SUB+= NSS="" X.endif X X.if defined(WITHOUT_NSLCD) XCONFIGURE_ARGS+= --disable-nslcd XPLIST_SUB+= NSLCD="@comment " X.else XCONFIGURE_ARGS+= --enable-nslcd XPLIST_SUB+= NSLCD="" XMAN8= nslcd.8 X.endif X XMAN5= nss-ldapd.conf.5 X Xpost-extract: X @${REINPLACE_CMD} -e 's/\(INSTALL_\)\(.*\)) -D /\1\2) /' ${WRKSRC}/Makefile.in ${WRKSRC}/nss/Makefile.in X @${REINPLACE_CMD} -e 's/shadow.$$(OBJEXT)/shadow.$$(OBJEXT) bsdnss.$$(OBJEXT)/;s/shadow\.c/shadow.c bsdnss.c/;s/exports\.linux/exports.freebsd/' ${WRKSRC}/nss/Makefile.in X @${REINPLACE_CMD} -e 's/^NSS_VERS = .*/NSS_VERS = 1/;s/libnss_ldap\.so/nss_ldap.so/' ${WRKSRC}/nss/Makefile.in X @${CP} ${FILESDIR}/bsdnss.c ${WRKSRC}/nss/ X @${MV} ${WRKSRC}/nss/exports.linux ${WRKSRC}/nss/exports.freebsd X @${REINPLACE_CMD} -e 's/$$(DESTDIR)$$(NSS_LDAP_PATH_CONF)/$$(DESTDIR)$$(NSS_LDAP_PATH_CONF).sample/' ${WRKSRC}/Makefile.in X Xpost-install: X @${ECHO_MSG} X @${ECHO_MSG} ===================================================================== X @${ECHO_MSG} X.if defined(WITH_NSS_COMPAT) X @${ECHO_MSG} " NSS_LDAP compatibility ENABLED." X @${ECHO_MSG} X @${ECHO_MSG} " LDAP configuration: ${PREFIX}/etc/nss_ldap.conf" X @${ECHO_MSG} " Secret file: ${PREFIX}/etc/nss_ldap.secret" X @${ECHO_MSG} " Sample configuration: ${PREFIX}/etc/nss_ldap.conf.sample" X @${ECHO_MSG} X @${ECHO_MSG} " Check if you need to adjust reconnect_* parameters" X @${ECHO_MSG} " WARNING: nss_ldapd will use ONLY rootbinddn to access LDAP data" X.else X @${ECHO_MSG} " LDAP configuration: ${PREFIX}/etc/nss_ldapd.conf" X @${ECHO_MSG} " Sample configuration: ${PREFIX}/etc/nss_ldapd.conf.sample" X @${ECHO_MSG} X.endif X.if !defined(WITHOUT_NSS) X @${ECHO_MSG} " WARNING: Be sure to set uid and gid configuration parameters" X @${ECHO_MSG} " WARNING: to make nslcd run under unprivileged user" X.endif X @${ECHO_MSG} X @${ECHO_MSG} ===================================================================== X @${ECHO_MSG} X X X.include <bsd.port.post.mk> END-of-nss_ldapd/Makefile echo x - nss_ldapd/distinfo sed 's/^X//' >nss_ldapd/distinfo << 'END-of-nss_ldapd/distinfo' XMD5 (nss-ldapd-0.6.11.tar.gz) = 8e5087f74a128f2c12f974c176803747 XSHA256 (nss-ldapd-0.6.11.tar.gz) = ac41292c8c7c2a4fb2e77ee9bc165ecefc84e8c33682f8c87ee69381830a8aff XSIZE (nss-ldapd-0.6.11.tar.gz) = 415271 END-of-nss_ldapd/distinfo echo x - nss_ldapd/pkg-descr sed 's/^X//' >nss_ldapd/pkg-descr << 'END-of-nss_ldapd/pkg-descr' Xnss_ldapd is a NSS module which provides an LDAP backend for C library Xfunctions such as getpwnam(3), getgrnam(3), and gethostbyname(3). It Xis compliant with RFC 2307, ``An Approach for Using LDAP as a Network XInformation Service''. X XKey differences from nss_ldap: X* lighter nss library (no ldap* dependings) X* server-side connection caching X X XWWW: http://arthurdejong.org/nss-ldapd/ END-of-nss_ldapd/pkg-descr echo x - nss_ldapd/pkg-plist sed 's/^X//' >nss_ldapd/pkg-plist << 'END-of-nss_ldapd/pkg-plist' Xetc/%%COMPAT%%.conf.sample X%%NSS%%lib/nss_ldap.so.1 X%%NSLCD%%sbin/nslcd END-of-nss_ldapd/pkg-plist exit >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908021115.n72BFG41039477>