From nobody Thu Jul 14 13:04:41 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4LkF7t1qS4z1Hxcc; Thu, 14 Jul 2022 13:04:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LkF7t1GPZz3v2c; Thu, 14 Jul 2022 13:04:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657803882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AfVclMSiUYux46R4eWNCeQTTiTDh7RtaOHpXvla/W6k=; b=DB+mCS8vEKJlV3clTMHWOtyyKofXac3j03hhfw4Kincse0XfpQZdQtEfFwSom9BZ4YT/kB TNBCo+V429FfuJt2fLqwkGoBDh4hUETHKnGLWqySYKEpQEDraoyPXzVbHnjCc9+NZuTIuh eA997CtNTI5BUuoP69c+XNh4vfc+Dn/YGJ81LHzBY1jDorXTMQRFLL/uibka2///Wn6anB Fboeve9reO9MD62jNXnRFE5DJIFP3WN/nE0QC3/aHQKc+JsC75jqFjUI/tBPHrmaaLlyWi Wcc4g45t7iO00Viy7rZqMl7KG/VbDOMFT0Qhn0znXkW8gb4c0hfQh1iV3wfMOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4LkF7t03C7z13wN; Thu, 14 Jul 2022 13:04:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26ED4fvr005613; Thu, 14 Jul 2022 13:04:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26ED4f2w005612; Thu, 14 Jul 2022 13:04:41 GMT (envelope-from git) Date: Thu, 14 Jul 2022 13:04:41 GMT Message-Id: <202207141304.26ED4f2w005612@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: "Sergey A. Osokin" Subject: git: 0019e69cb98d - main - www/nginx-devel: fix segfaults in the third-party spnego module List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osa X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0019e69cb98de8981a18d5ec1222ebedec3df8cd Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657803882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AfVclMSiUYux46R4eWNCeQTTiTDh7RtaOHpXvla/W6k=; b=Mln/SpILShDwsDyDMk6fQb0/KRVsJj1DKw95AUldHo9394mLSL988DRwbverLRPns9oHMW KZo092wtYAqMvLtCyR4nX6JVv2RmUPQjwRgS96C1e7BGX7/pZ+qgH6E7juKls8tiNgzp8u 6b5aW/t1501ZduDaVvUTrzlisVIdh0f1N72KBKolZ64BTvcgTL8QFOYad9jC+DdJAYgvLp d6WXD9vRzvj+3SX5fpQ+BfUszWBhpcZCD2FkI0QyCJJazlL+rLZjUyfHzfDOFKfGBiXEAV epkWNRTdyhS/mIQuyT92ku4L6G7eS2VUdLVb9CQcqKYeA1W+DUI3+SYkO+N06g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657803882; a=rsa-sha256; cv=none; b=gDe7QG2TVOxACYi1HQBZJa0p8GNRE5aeZByTSfcIq0WhDH0b9ZFAXU+a5SqHX51QmaMfRe C424wkcHv30dce7/+IqdyqMMdmNWI3jX4gVaIyzpkotS26bUR9SaIhYDCsVBW9aLdp+lRc /ZC1A7g72dwUYugqlMy1f5KlNrfJqSZ5L7b+H5BdBfWtXj/0YW3FloKZ2yFSzJyihHNuUP 4zVjhpBcFODT0Q03vz7TyIQEm0ddAvEd2qtttiW+DwUcxolkoQbTKz8blnuM16L78o8KGL b09QYpRpKn4AvNFxHLI0MiauyhFMK/82nt10s3edtTz7RtC1C1ZQUcJZh5F8jg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by osa: URL: https://cgit.FreeBSD.org/ports/commit/?id=0019e69cb98de8981a18d5ec1222ebedec3df8cd commit 0019e69cb98de8981a18d5ec1222ebedec3df8cd Author: Sergey A. Osokin AuthorDate: 2022-07-14 12:41:20 +0000 Commit: Sergey A. Osokin CommitDate: 2022-07-14 13:04:34 +0000 www/nginx-devel: fix segfaults in the third-party spnego module Reported by: pluknet Patch from: pluknet Bump PORTREVISION. --- www/nginx-devel/Makefile | 2 +- www/nginx-devel/Makefile.extmod | 3 +- .../extra-patch-ngx_http_auth_spnego_module.c | 52 ++++++++++++++++++++++ 3 files changed, 55 insertions(+), 2 deletions(-) diff --git a/www/nginx-devel/Makefile b/www/nginx-devel/Makefile index 97ffd75d3384..5d983be2c571 100644 --- a/www/nginx-devel/Makefile +++ b/www/nginx-devel/Makefile @@ -2,7 +2,7 @@ PORTNAME?= nginx PORTVERSION= 1.23.0 -PORTREVISION= 13 +PORTREVISION= 14 CATEGORIES= www MASTER_SITES= https://nginx.org/download/ \ LOCAL/osa diff --git a/www/nginx-devel/Makefile.extmod b/www/nginx-devel/Makefile.extmod index 1fb464d17cbf..6cd2533559f6 100644 --- a/www/nginx-devel/Makefile.extmod +++ b/www/nginx-devel/Makefile.extmod @@ -93,7 +93,8 @@ HTTP_AUTH_DIGEST_VARS= DSO_EXTMODS+=auth_digest HTTP_AUTH_KRB5_GH_TUPLE= stnoonan:spnego-http-auth-nginx-module:c626163:auth_krb5 HTTP_AUTH_KRB5_VARS= DSO_EXTMODS+=auth_krb5 -HTTP_AUTH_KRB5_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-spnego-http-auth-nginx-module-config +HTTP_AUTH_KRB5_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-spnego-http-auth-nginx-module-config \ + ${PATCHDIR}/extra-patch-ngx_http_auth_spnego_module.c HTTP_AUTH_KRB5_USES= gssapi:mit HTTP_AUTH_LDAP_GH_TUPLE= kvspb:nginx-auth-ldap:83c059b:http_auth_ldap diff --git a/www/nginx-devel/files/extra-patch-ngx_http_auth_spnego_module.c b/www/nginx-devel/files/extra-patch-ngx_http_auth_spnego_module.c new file mode 100644 index 000000000000..40aea7e6e875 --- /dev/null +++ b/www/nginx-devel/files/extra-patch-ngx_http_auth_spnego_module.c @@ -0,0 +1,52 @@ +--- ../spnego-http-auth-nginx-module-c626163/ngx_http_auth_spnego_module.c.orig ++++ ../spnego-http-auth-nginx-module-c626163/ngx_http_auth_spnego_module.c +@@ -502,6 +502,7 @@ ngx_http_auth_spnego_headers_basic_only(ngx_http_request_t *r, + } + + r->headers_out.www_authenticate->hash = 1; ++ r->headers_out.www_authenticate->next = NULL; + r->headers_out.www_authenticate->key.len = sizeof("WWW-Authenticate") - 1; + r->headers_out.www_authenticate->key.data = (u_char *)"WWW-Authenticate"; + r->headers_out.www_authenticate->value.len = value.len; +@@ -538,6 +539,7 @@ ngx_http_auth_spnego_headers(ngx_http_request_t *r, + } + + r->headers_out.www_authenticate->hash = 1; ++ r->headers_out.www_authenticate->next = NULL; + r->headers_out.www_authenticate->key.len = sizeof("WWW-Authenticate") - 1; + r->headers_out.www_authenticate->key.data = (u_char *)"WWW-Authenticate"; + r->headers_out.www_authenticate->value.len = value.len; +@@ -559,6 +561,7 @@ ngx_http_auth_spnego_headers(ngx_http_request_t *r, + } + + r->headers_out.www_authenticate->hash = 2; ++ r->headers_out.www_authenticate->next = NULL; + r->headers_out.www_authenticate->key.len = + sizeof("WWW-Authenticate") - 1; + r->headers_out.www_authenticate->key.data = +@@ -758,6 +761,12 @@ ngx_http_auth_spnego_store_delegated_creds(ngx_http_request_t *r, + char *ccname = NULL; + char *escaped = NULL; + ++ if ((kerr = krb5_init_context(&kcontext))) { ++ spnego_log_error("Kerberos error: Cannot initialize kerberos context"); ++ spnego_log_krb5_error(kcontext, kerr); ++ goto done; ++ } ++ + if (!delegated_creds.data) { + spnego_log_error( + "ngx_http_auth_spnego_store_delegated_creds() NULL credentials"); +@@ -766,12 +775,6 @@ ngx_http_auth_spnego_store_delegated_creds(ngx_http_request_t *r, + goto done; + } + +- if ((kerr = krb5_init_context(&kcontext))) { +- spnego_log_error("Kerberos error: Cannot initialize kerberos context"); +- spnego_log_krb5_error(kcontext, kerr); +- goto done; +- } +- + if ((kerr = krb5_parse_name(kcontext, (char *)principal_name->data, + &principal))) { + spnego_log_error("Kerberos error: Cannot parse principal %s",