Module Name:    src
Committed By:   christos
Date:           Sat Aug 14 16:17:57 UTC 2021

Modified Files:
        src/crypto/external/bsd/openssh/bin/sshd: Makefile
        src/crypto/external/bsd/openssh/dist: ldapauth.c ldapauth.h sshd.c
        src/external/bsd/am-utils/bin/amd: Makefile
        src/external/ibm-public/postfix: Makefile.inc

Log Message:
Adjust for new OpenLDAP
- use centralized library variables
- ldap_connect -> ldap_xconnect


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/crypto/external/bsd/openssh/bin/sshd/Makefile
cvs rdiff -u -r1.7 -r1.8 src/crypto/external/bsd/openssh/dist/ldapauth.c
cvs rdiff -u -r1.5 -r1.6 src/crypto/external/bsd/openssh/dist/ldapauth.h
cvs rdiff -u -r1.42 -r1.43 src/crypto/external/bsd/openssh/dist/sshd.c
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/am-utils/bin/amd/Makefile
cvs rdiff -u -r1.27 -r1.28 src/external/ibm-public/postfix/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/external/bsd/openssh/bin/sshd/Makefile
diff -u src/crypto/external/bsd/openssh/bin/sshd/Makefile:1.23 src/crypto/external/bsd/openssh/bin/sshd/Makefile:1.24
--- src/crypto/external/bsd/openssh/bin/sshd/Makefile:1.23	Fri Mar  5 12:47:15 2021
+++ src/crypto/external/bsd/openssh/bin/sshd/Makefile	Sat Aug 14 12:17:57 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.23 2021/03/05 17:47:15 christos Exp $
+#	$NetBSD: Makefile,v 1.24 2021/08/14 16:17:57 christos Exp $
 
 .include <bsd.own.mk>
 
@@ -54,8 +54,8 @@ DPADD+= ${LIBKRB5_DPADD}
 
 .if (${USE_LDAP} != "no")
 SRCS+=	ldapauth.c
-LDADD+=	-lldap -lssl -llber
-DPADD+=	${LIBLDAP} ${LIBSSL} ${LIBLBER}
+LDADD+=	${LIBLDAP_LDADD}
+DPADD+=	${LIBLDAP_DPADD}
 .endif
 
 LDADD+=	-lcrypt -lutil

Index: src/crypto/external/bsd/openssh/dist/ldapauth.c
diff -u src/crypto/external/bsd/openssh/dist/ldapauth.c:1.7 src/crypto/external/bsd/openssh/dist/ldapauth.c:1.8
--- src/crypto/external/bsd/openssh/dist/ldapauth.c:1.7	Tue Apr 18 14:41:46 2017
+++ src/crypto/external/bsd/openssh/dist/ldapauth.c	Sat Aug 14 12:17:57 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldapauth.c,v 1.7 2017/04/18 18:41:46 christos Exp $	*/
+/*	$NetBSD: ldapauth.c,v 1.8 2021/08/14 16:17:57 christos Exp $	*/
 
 /*
  *
@@ -21,7 +21,7 @@
  *
  */
 #include "includes.h"
-__RCSID("$NetBSD: ldapauth.c,v 1.7 2017/04/18 18:41:46 christos Exp $");
+__RCSID("$NetBSD: ldapauth.c,v 1.8 2021/08/14 16:17:57 christos Exp $");
 
 #ifdef WITH_LDAP_PUBKEY
 #include <stdarg.h>
@@ -124,7 +124,7 @@ void ldap_close(ldap_opt_t * ldap) {
 }
 
 /* init && bind */
-int ldap_connect(ldap_opt_t * ldap) {
+int ldap_xconnect(ldap_opt_t * ldap) {
     int version = LDAP_VERSION3;
 
     if (!ldap->servers)
@@ -154,7 +154,7 @@ int ldap_connect(ldap_opt_t * ldap) {
     if ( (ldap->tls == -1) || (ldap->tls == 1) ) {
         if (ldap_start_tls_s(ldap->ld, NULL, NULL ) != LDAP_SUCCESS) {
             /* failed then reinit the initial connect */
-            ldap_perror(ldap->ld, "ldap_connect: (TLS) ldap_start_tls()");
+            ldap_perror(ldap->ld, "ldap_xconnect: (TLS) ldap_start_tls()");
             if (ldap->tls == 1)
                 return FAILURE;
 
@@ -378,7 +378,7 @@ ldap_key_t * ldap_getuserkey(ldap_opt_t 
     /* XXX TODO: setup some conf value for retrying */
     if (!(l->flags & FLAG_CONNECTED))
         for (i = 0 ; i < 2 ; i++)
-            if (ldap_connect(l) == 0)
+            if (ldap_xconnect(l) == 0)
                 break;
 
     /* quick check for attempts to be evil */
@@ -445,7 +445,7 @@ int ldap_ismember(ldap_opt_t * l, const 
     /* XXX TODO: setup some conf value for retrying */
     if (!(l->flags & FLAG_CONNECTED)) 
         for (i = 0 ; i < 2 ; i++)
-            if (ldap_connect(l) == 0)
+            if (ldap_xconnect(l) == 0)
                  break;
 
     /* quick check for attempts to be evil */

Index: src/crypto/external/bsd/openssh/dist/ldapauth.h
diff -u src/crypto/external/bsd/openssh/dist/ldapauth.h:1.5 src/crypto/external/bsd/openssh/dist/ldapauth.h:1.6
--- src/crypto/external/bsd/openssh/dist/ldapauth.h:1.5	Tue Apr 18 14:41:46 2017
+++ src/crypto/external/bsd/openssh/dist/ldapauth.h	Sat Aug 14 12:17:57 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldapauth.h,v 1.5 2017/04/18 18:41:46 christos Exp $	*/
+/*	$NetBSD: ldapauth.h,v 1.6 2021/08/14 16:17:57 christos Exp $	*/
 
 /*
  *
@@ -112,7 +112,7 @@ typedef struct ldap_keys {
 
 /* function headers */
 void ldap_close(ldap_opt_t *);
-int ldap_connect(ldap_opt_t *);
+int ldap_xconnect(ldap_opt_t *);
 char * ldap_parse_groups(const char *);
 char * ldap_parse_servers(const char *);
 void ldap_options_print(ldap_opt_t *);

Index: src/crypto/external/bsd/openssh/dist/sshd.c
diff -u src/crypto/external/bsd/openssh/dist/sshd.c:1.42 src/crypto/external/bsd/openssh/dist/sshd.c:1.43
--- src/crypto/external/bsd/openssh/dist/sshd.c:1.42	Mon Apr 19 10:40:15 2021
+++ src/crypto/external/bsd/openssh/dist/sshd.c	Sat Aug 14 12:17:57 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: sshd.c,v 1.42 2021/04/19 14:40:15 christos Exp $	*/
+/*	$NetBSD: sshd.c,v 1.43 2021/08/14 16:17:57 christos Exp $	*/
 /* $OpenBSD: sshd.c,v 1.572 2021/04/03 06:18:41 djm Exp $ */
 
 /*
@@ -45,7 +45,7 @@
  */
 
 #include "includes.h"
-__RCSID("$NetBSD: sshd.c,v 1.42 2021/04/19 14:40:15 christos Exp $");
+__RCSID("$NetBSD: sshd.c,v 1.43 2021/08/14 16:17:57 christos Exp $");
 #include <sys/types.h>
 #include <sys/param.h>
 #include <sys/ioctl.h>
@@ -1713,7 +1713,7 @@ main(int ac, char **av)
 	if (options.lpk.on) {
 	    if (options.lpk.l_conf && (ldap_parse_lconf(&options.lpk) < 0) )
 		error("[LDAP] could not parse %s", options.lpk.l_conf);
-	    if (ldap_connect(&options.lpk) < 0)
+	    if (ldap_xconnect(&options.lpk) < 0)
 		error("[LDAP] could not initialize ldap connection");
 	}
 #endif

Index: src/external/bsd/am-utils/bin/amd/Makefile
diff -u src/external/bsd/am-utils/bin/amd/Makefile:1.13 src/external/bsd/am-utils/bin/amd/Makefile:1.14
--- src/external/bsd/am-utils/bin/amd/Makefile:1.13	Sun Oct 13 03:28:05 2019
+++ src/external/bsd/am-utils/bin/amd/Makefile	Sat Aug 14 12:17:57 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.13 2019/10/13 07:28:05 mrg Exp $
+#	$NetBSD: Makefile,v 1.14 2021/08/14 16:17:57 christos Exp $
 
 .include "${.CURDIR}/../Makefile.inc"
 
@@ -28,14 +28,8 @@ SRCS+=	info_hesiod.c
 .if (${USE_LDAP} != "no")
 SRCS+=	info_ldap.c
 
-LDADD+=	-lldap
-DPADD+=	${LIBLDAP}
-.if (${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != ""))
-LDADD+=	-llber
-DPADD+=	${LIBLBER}
-DPADD+=	${LIBSSL} ${LIBCRYPTO}
-LDADD+=	-lssl -lcrypto
-.endif
+LDADD+=	${LIBLDAP_LDADD}
+DPADD+=	${LIBLDAP_DPADD}
 .endif
 
 .if (${USE_YP} != "no")

Index: src/external/ibm-public/postfix/Makefile.inc
diff -u src/external/ibm-public/postfix/Makefile.inc:1.27 src/external/ibm-public/postfix/Makefile.inc:1.28
--- src/external/ibm-public/postfix/Makefile.inc:1.27	Sun Apr 11 23:57:06 2021
+++ src/external/ibm-public/postfix/Makefile.inc	Sat Aug 14 12:17:57 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.27 2021/04/12 03:57:06 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.28 2021/08/14 16:17:57 christos Exp $
 
 .include <bsd.own.mk>
 
@@ -58,12 +58,8 @@ CPPFLAGS+=	-DHAS_LDAP
 
 # Automatically link in libldap for a program.
 . if defined(PROG)
-LDADD+=		-lldap -llber
-DPADD+=		${LIBLDAP} ${LIBLBER}
-.  if (${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != ""))
-DPADD+=		${LIBSSL} ${LIBCRYPTO}
-LDADD+=		-lssl -lcrypto
-.  endif
+LDADD+=		${LIBLDAP_LDADD}
+DPADD+=		${LIBLDAP_DPADD}
 . endif
 .endif # USE_LDAP != no
 

Reply via email to