public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Tom spot Callaway <spotaws@amazon.com>
To: git-commits@fedoraproject.org
Subject: [rpms/log4net] f43: 3.5.0
Date: Wed, 07 Oct 2026 18:27:22 GMT	[thread overview]
Message-ID: <179139764240.1.16259566729078223225.rpms-log4net-6adc8e2ea8c4@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/log4net
Branch : f43
Commit : 6adc8e2ea8c4bd3869ef5e871e6985a2d10a6de6
Author : Tom spot Callaway <spotaws@amazon.com>
Date   : 2026-10-07T12:53:19-04:00
Stats  : +105/-61 in 6 file(s)
URL    : https://src.fedoraproject.org/rpms/log4net/c/6adc8e2ea8c4bd3869ef5e871e6985a2d10a6de6?branch=f43

Log:
3.5.0

---
diff --git a/.gitignore b/.gitignore
index dcb95a6..b096d49 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ incubating-log4net-1.2.10.zip
 /log4net-1.2.15-src.zip
 /log4net-2.0.7-src.zip
 /log4net-2.0.8-src.zip
+/apache-log4net-source-3.5.0.zip

diff --git a/RollingFileAppender-count-assignment.patch b/RollingFileAppender-count-assignment.patch
new file mode 100644
index 0000000..bb8b6c9
--- /dev/null
+++ b/RollingFileAppender-count-assignment.patch
@@ -0,0 +1,20 @@
+Fix invalid null-conditional assignment in RollingFileAppender.OpenFile
+
+The null-conditional operator (?.) cannot appear on the left-hand side of
+an assignment (CS0131), so this line could never compile. Replace it with a
+null-safe pattern-match assignment that preserves the original intent.
+
+--- a/src/log4net/Appender/RollingFileAppender.cs
++++ b/src/log4net/Appender/RollingFileAppender.cs
+@@ -665,7 +665,10 @@
+       }
+ 
+       // Set the file size onto the counting writer. A refused lock leaves none.
+-      (QuietWriter as CountingQuietTextWriter)?.Count = currentCount;
++      if (QuietWriter is CountingQuietTextWriter countingQuietTextWriter)
++      {
++        countingQuietTextWriter.Count = currentCount;
++      }
+     }
+   }
+ 

diff --git a/log4net-2.0.8-xmlconfigurator.patch b/log4net-2.0.8-xmlconfigurator.patch
deleted file mode 100644
index bc74002..0000000
--- a/log4net-2.0.8-xmlconfigurator.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From d0b4b0157d4af36b23c24a23739c47925c3bd8d7 Mon Sep 17 00:00:00 2001
-From: Dominik Psenner <dpsenner@apache.org>
-Date: Tue, 12 Sep 2017 09:15:08 +0200
-Subject: [PATCH] XmlConfigurator: do longer allow dtd processing across all
- platforms (LOG4NET-575)
-
-This patch fixes a security vulnerabiliy reported by Karthik Balasundaram. The security
-vulnerability was found in the way how log4net parses xml configuration files where it
-allowed to process XML External Entity Processing. An attacker could use this as an
-attack vector if he could modify the XML configuration file.
----
- src/Config/XmlConfigurator.cs | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/Config/XmlConfigurator.cs b/src/Config/XmlConfigurator.cs
-index 5b11d98d..0051377c 100644
---- a/src/Config/XmlConfigurator.cs
-+++ b/src/Config/XmlConfigurator.cs
-@@ -736,9 +736,9 @@ static private void InternalConfigure(ILoggerRepository repository, Stream confi
- #if NETSTANDARD1_3 // TODO DtdProcessing.Parse not yet available (https://github.com/dotnet/corefx/issues/4376)
- 					settings.DtdProcessing = DtdProcessing.Ignore;
- #elif !NET_4_0 && !MONO_4_0
--					settings.ProhibitDtd = false;
-+					settings.ProhibitDtd = true;
- #else
--					settings.DtdProcessing = DtdProcessing.Parse;
-+					settings.DtdProcessing = DtdProcessing.Ignore;
- #endif
- 
- 					// Create a reader over the input stream

diff --git a/log4net-remove-build-only-deps.patch b/log4net-remove-build-only-deps.patch
new file mode 100644
index 0000000..627a6c0
--- /dev/null
+++ b/log4net-remove-build-only-deps.patch
@@ -0,0 +1,21 @@
+Remove build-only NuGet dependencies for offline distro builds
+
+Microsoft.SourceLink.GitHub and Microsoft.CodeAnalysis.NetAnalyzers are
+build-time-only packages (PrivateAssets=All): SourceLink embeds repository
+metadata and the analyzers run code-style/quality checks. Neither affects the
+produced log4net.dll. Removing them lets a net462-only build restore entirely
+offline from just the .NET Framework reference assemblies.
+
+--- a/src/log4net/log4net.csproj
++++ b/src/log4net/log4net.csproj
+@@ -97,10 +97,6 @@
+       <Link>package-icon.png</Link>
+     </Content>
+   </ItemGroup>
+-  <ItemGroup>
+-    <PackageReference Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkGitHubPackageVersion)" PrivateAssets="All" />
+-    <PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="$(MicrosoftNetAnalyzersPackageVersion)" PrivateAssets="All" IncludeAssets="All" />
+-  </ItemGroup>
+   <Target Name="_ResolveCopyLocalNuGetPackagePdbsAndXml" Condition="$(CopyLocalLockFileAssemblies) == true" AfterTargets="ResolveReferences">
+     <!-- "Workaround" for missing '.pdb'-Files from NuGet Packages -->
+     <!-- https://github.com/dotnet/sdk/issues/1458#issuecomment-420456386 -->

diff --git a/log4net.spec b/log4net.spec
index a5c03d1..c25f1c4 100644
--- a/log4net.spec
+++ b/log4net.spec
@@ -4,26 +4,28 @@
 %global _monogacdir %{_monodir}/gac
 %endif
 
+# This is a mono package
+%define debug_package %{nil}
+
 Name:	 	log4net
 URL:		http://logging.apache.org/log4net/
-# Automatically converted from old format: ASL 2.0 - review is highly recommended.
 License:	Apache-2.0
-Version:	2.0.8
-Release:	25%{?dist}
+Version:	3.5.0
+Release:	1%{?dist}
 Summary:	A .NET framework for logging
-Source:		http://mirror.reverse.net/pub/apache/logging/log4net/source/%{name}-%{version}-src.zip
-Patch0:		log4net-2.0.8-xmlconfigurator.patch
-
-BuildRequires:	dos2unix
+Source:		https://downloads.apache.org/logging/log4net/%{version}/apache-log4net-source-%{version}.zip
+Patch0:		RollingFileAppender-count-assignment.patch
+# Remove build-only NuGet dependencies (SourceLink + analyzers) so a net462-only
+# build restores offline against Mono's reference assemblies only.
+Patch1:		log4net-remove-build-only-deps.patch
+BuildRequires:	dotnet-host, dotnet-sdk-10.0
 BuildRequires:	mono-data-sqlite
 BuildRequires:	mono-devel
 
+
 # Mono only available on these:
 ExclusiveArch: %mono_arches
 
-# %define debug_package %{nil}
-# This is a mono package
-
 %description
 log4net is a tool to help the programmer output log statements to a
 variety of output targets. log4net is a port of the excellent log4j
@@ -40,30 +42,51 @@ variety of output targets. log4net is a port of the excellent log4j
 framework to the .NET runtime
 
 %prep
-%setup -q
-dos2unix src/Config/XmlConfigurator.cs
+%setup -q -c
 %patch -P0 -p1
+%patch -P1 -p1
+# Force a fully offline NuGet restore: no package sources are permitted, so the
+# build cannot reach the network. Reference assemblies come from Mono (see %%build),
+# not from NuGet, so no packages need to be restored at all.
+cat > nuget.config <<'EOF'
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <config>
+    <add key="globalPackagesFolder" value="packages-cache" />
+  </config>
+  <packageSources>
+    <clear />
+  </packageSources>
+</configuration>
+EOF
 sed -i 's/\r//' NOTICE
-sed -i 's/\r//' README.txt
+sed -i 's/\r//' README.md
 sed -i 's/\r//' LICENSE
 # Remove prebuilt dll files
 rm -rf bin/
 
-# mv src/Layout/XMLLayout.cs src/Layout/XmlLayout.cs
-# mv src/Layout/XMLLayoutBase.cs src/Layout/XmlLayoutBase.cs
-
-# Fix for mono 4
-find . -name "*.sln" -print -exec sed -i 's/Format Version 10.00/Format Version 11.00/g' {} \;
-find . -name "*.csproj" -print -exec sed -i 's#ToolsVersion="3.5"#ToolsVersion="4.0"#g; s#<TargetFrameworkVersion>.*</TargetFrameworkVersion>##g; s#<PropertyGroup>#<PropertyGroup><TargetFrameworkVersion>v4.5</TargetFrameworkVersion>#g' {} \;
-
-# Use system mono.snk key
-sed -i -e 's!"..\\..\\..\\log4net.snk")]!"/etc/pki/mono/mono.snk")]!' src/AssemblyInfo.cs
-sed -i -e 's!|| SSCLI)!|| SSCLI || MONO)!' src/AssemblyInfo.cs
-
-
 %build
-# ASF recommend using nant to build log4net
-xbuild /property:Configuration=Debug /property:DefineConstants=DEBUG,MONO,STRONG src/log4net.vs2010.csproj
+export DOTNET_CLI_TELEMETRY_OPTOUT=1
+export DOTNET_NOLOGO=1
+# Build net462 only (the assembly that is installed into the Mono GAC).
+#  - TargetFrameworks=net462 (plural) collapses the restore graph to the single
+#    target, avoiding the netstandard2.0 NuGet chain.
+#  - AutomaticallyUseReferenceAssemblyPackages=false stops the SDK from trying to
+#    restore the proprietary Microsoft.NETFramework.ReferenceAssemblies package.
+#  - FrameworkPathOverride points the compiler at Mono's (FOSS) reference
+#    assemblies shipped by mono-devel.
+#  - GeneratePackageOnBuild=false: we want the DLL, not a .nupkg.
+#  - PublicSign=true: embed the strong-name public key (preserving the assembly
+#    identity / public key token) WITHOUT computing the RSA strong-name signature.
+#    Real strong-name signing uses SHA-1 RSA via OpenSSL, which fails under the
+#    FIPS/crypto-policy restrictions of the mock build root
+#    ("error:03000098 ... invalid digest"). Public signing avoids that crypto call.
+dotnet build src/log4net/log4net.csproj -c Release \
+    -p:TargetFrameworks=net462 \
+    -p:AutomaticallyUseReferenceAssemblyPackages=false \
+    -p:FrameworkPathOverride=/usr/lib/mono/4.7.1-api \
+    -p:GeneratePackageOnBuild=false \
+    -p:PublicSign=true
 
 %install
 # install pkgconfig file
@@ -78,19 +101,28 @@ mkdir -p $RPM_BUILD_ROOT/%{_libdir}/pkgconfig
 cp %{name}.pc $RPM_BUILD_ROOT/%{_libdir}/pkgconfig
 mkdir -p $RPM_BUILD_ROOT/%{_monogacdir}
 
-#gacutil -i bin/mono/*/release/log4net.dll -f -package log4net -root ${RPM_BUILD_ROOT}/%{_prefix}/lib
-gacutil -i build/bin/net/*/debug/log4net.dll -f -package log4net -root ${RPM_BUILD_ROOT}/%{_prefix}/lib
+# The assembly was public-signed during %%build (the Roslyn SHA-1 RSA strong-name
+# signing fails under the mock crypto policy). Complete the strong name here with
+# Mono's own sn tool, which does not use the restricted OpenSSL path. gacutil
+# refuses to install a delay/public-signed assembly ("Strong name cannot be
+# verified for delay-signed assembly"); after this it verifies and installs.
+sn -R build/Release/net462/log4net.dll log4net.snk
+
+gacutil -i build/Release/net462/log4net.dll -f -package log4net -root ${RPM_BUILD_ROOT}/%{_prefix}/lib
 
 %files
 %{_monogacdir}/log4net
 %{_monodir}/log4net
-%doc NOTICE README.txt
+%doc NOTICE README.md
 %license LICENSE
 
 %files devel
 %{_libdir}/pkgconfig/log4net.pc
 
 %changelog
+* Wed Oct  7 2026 Tom Callaway <spot@fedoraproject.org> 3.5.0-1
+- update to 3.5.0
+
 * Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.8-25
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
 

diff --git a/sources b/sources
index 724ca84..7cd1ad4 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (log4net-2.0.8-src.zip) = 5599464d628f9f23eb69e693dcf478686139d63f30a840f6da8d6e877545cf2b04a2e44983c5f7fb40debbe90d1ac9ea5ab5674f299c9b309f3fc4996cb6c68c
+SHA512 (apache-log4net-source-3.5.0.zip) = 0892927e4bc3df91b1347f0f17bc2d3efa2c2df930661679314acd6fb64a0f2a5bdc27db25ddfbc4395821f18231990de78420c13de4cc44b0682d8b2b1f2ffc

                 reply	other threads:[~2026-10-07 18:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179139764240.1.16259566729078223225.rpms-log4net-6adc8e2ea8c4@fedoraproject.org \
    --to=spotaws@amazon.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox