Your message dated Fri, 26 Apr 2024 09:24:46 +0000 with message-id <e1s0hp0-006gj4...@fasolo.debian.org> and subject line Bug#1068490: fixed in netperf 2.7.0-0.3 has caused the Debian Bug report #1068490, regarding netperf: Netserver remove /dev/null in some cases, breaking many things to be marked as done.
This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the Bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact ow...@bugs.debian.org immediately.) -- 1068490: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1068490 Debian Bug Tracking System Contact ow...@bugs.debian.org with problems
--- Begin Message ---Package: netperf Version: 2.7.0-0.2 Severity: critical Tags: patch upstream Justification: breaks unrelated software X-Debbugs-Cc: tourrilhes....@gmail.com This bug is hard to reproduce, as the condition that lead to Netserver deleting /dev/null are quite mysterious. I was getting my /dev/null removed over the years at very rare occurences, until I managed to track it down to Netserver. The issue is not present in the tarball for version 2.7.0. It was introduced in patch : 02018-02-07T17:21:57-08:00~5380b1f.patch In particular, this line : + FileName = NETPERF_NULL; This patch is part of the Netperf GitHub, which is why I added the upstream tag. I will report this bug upstream, unfortunately I don't expect much action :-( A quick look at the source code show that the code is wrong in very obvious way. The fix is quite simple and obvious, and I provide a patch (included below). Note that my patch replace 11_no_change_perms_on_dev-null.patch, so please remove that patch before applying mine. Thanks in advance ! Jean -- System Information: Debian Release: 11.9 APT prefers oldstable-security APT policy: (500, 'oldstable-security'), (500, 'oldstable-proposed-updates'), (500, 'oldstable') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 5.10.0-28-amd64 (SMP w/12 CPU threads) Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_FIRMWARE_WORKAROUND, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages netperf depends on: ii libc6 2.31-13+deb11u8 netperf recommends no packages. netperf suggests no packages. -- no debconf information diff --git a/src/netserver.c b/src/netserver.c index 2e6b567..ae4ad61 100644 --- a/src/netserver.c +++ b/src/netserver.c @@ -220,7 +220,7 @@ unlink_empty_debug_file() { #if !defined(WIN32) struct stat buf; - if (stat(FileName,&buf)== 0) { + if ( (! suppress_debug) && (stat(FileName,&buf)== 0) ) { if (buf.st_size == 0) unlink(FileName); @@ -239,6 +239,7 @@ open_debug_file() if (where != NULL) fflush(where); if (suppress_debug) { strncpy(FileName, NETPERF_NULL, sizeof(FileName)); + FileName[sizeof(FileName) - 1] = '\0'; where = fopen(FileName, "w"); } else { int fd; @@ -260,7 +261,8 @@ open_debug_file() #if !defined(WIN32) - chmod(FileName,0644); + if (! suppress_debug) + chmod(FileName,0644); /* redirect stdin to "/dev/null" */ rd_null_fp = fopen(NETPERF_NULL,"r");diff --git a/src/netserver.c b/src/netserver.c index 2e6b567..ae4ad61 100644 --- a/src/netserver.c +++ b/src/netserver.c @@ -220,7 +220,7 @@ unlink_empty_debug_file() { #if !defined(WIN32) struct stat buf; - if (stat(FileName,&buf)== 0) { + if ( (! suppress_debug) && (stat(FileName,&buf)== 0) ) { if (buf.st_size == 0) unlink(FileName); @@ -239,6 +239,7 @@ open_debug_file() if (where != NULL) fflush(where); if (suppress_debug) { strncpy(FileName, NETPERF_NULL, sizeof(FileName)); + FileName[sizeof(FileName) - 1] = '\0'; where = fopen(FileName, "w"); } else { int fd; @@ -260,7 +261,8 @@ open_debug_file() #if !defined(WIN32) - chmod(FileName,0644); + if (! suppress_debug) + chmod(FileName,0644); /* redirect stdin to "/dev/null" */ rd_null_fp = fopen(NETPERF_NULL,"r");diff --git a/src/netserver.c b/src/netserver.c index 2e6b567..ae4ad61 100644 --- a/src/netserver.c +++ b/src/netserver.c @@ -220,7 +220,7 @@ unlink_empty_debug_file() { #if !defined(WIN32) struct stat buf; - if (stat(FileName,&buf)== 0) { + if ( (! suppress_debug) && (stat(FileName,&buf)== 0) ) { if (buf.st_size == 0) unlink(FileName); @@ -239,6 +239,7 @@ open_debug_file() if (where != NULL) fflush(where); if (suppress_debug) { strncpy(FileName, NETPERF_NULL, sizeof(FileName)); + FileName[sizeof(FileName) - 1] = '\0'; where = fopen(FileName, "w"); } else { int fd; @@ -260,7 +261,8 @@ open_debug_file() #if !defined(WIN32) - chmod(FileName,0644); + if (! suppress_debug) + chmod(FileName,0644); /* redirect stdin to "/dev/null" */ rd_null_fp = fopen(NETPERF_NULL,"r");
--- End Message ---
--- Begin Message ---Source: netperf Source-Version: 2.7.0-0.3 Done: Andreas Beckmann <a...@debian.org> We believe that the bug you reported is fixed in the latest version of netperf, which is due to be installed in the Debian FTP archive. A summary of the changes between this version and the previous one is attached. Thank you for reporting the bug, which will now be closed. If you have further comments please address them to 1068...@bugs.debian.org, and the maintainer will reopen the bug report if appropriate. Debian distribution maintenance software pp. Andreas Beckmann <a...@debian.org> (supplier of updated netperf package) (This message was generated automatically at their request; if you believe that there is a problem with it please contact the archive administrators by mailing ftpmas...@ftp-master.debian.org) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Format: 1.8 Date: Fri, 26 Apr 2024 11:05:37 +0200 Source: netperf Architecture: source Version: 2.7.0-0.3 Distribution: unstable Urgency: medium Maintainer: Erik Wenzel <e...@debian.org> Changed-By: Andreas Beckmann <a...@debian.org> Closes: 732056 1068490 Changes: netperf (2.7.0-0.3) unstable; urgency=medium . [ Andreas Beckmann ] * Non-maintainer upload. * Declare Rules-Requires-Root: no. . [ Simon Guinot ] * Fix NETSERVER_ENABLE check in init.d script. (Closes: #732056) . [ Jean Tourrilhes ] * Fix netserver removing /dev/null in some cases. (Closes: #1068490) Checksums-Sha1: 1528ebd93d42ca3b7e608f2b31ae6b24b62c57db 1904 netperf_2.7.0-0.3.dsc a1d34443dafb00ab2e1e75663822e2ac8235d32c 19508 netperf_2.7.0-0.3.debian.tar.xz a49ee558d0038e2ad4edebd67d81125fcaa26767 7343 netperf_2.7.0-0.3_source.buildinfo Checksums-Sha256: 8a4fc3857ec7153a9589f8ec7227c391ad1ff5ac12161f76c201913bf277680f 1904 netperf_2.7.0-0.3.dsc 93e7e025e6f2f3737deaa6513a7aed3a53f927f1422e34412c333319794ffcad 19508 netperf_2.7.0-0.3.debian.tar.xz 709b6a9bb5c7eaf3911d8900dd5d907672a04eb9a201d6af65d0cea1cb920890 7343 netperf_2.7.0-0.3_source.buildinfo Files: 00cfb9259067af598b40b5e47d9a478c 1904 non-free/net optional netperf_2.7.0-0.3.dsc 613a1665251c81e5207de501ffb0a842 19508 non-free/net optional netperf_2.7.0-0.3.debian.tar.xz 6bc9250207a52d04561bf1830069130a 7343 non-free/net optional netperf_2.7.0-0.3_source.buildinfo -----BEGIN PGP SIGNATURE----- iQJEBAEBCAAuFiEE6/MKMKjZxjvaRMaUX7M/k1np7QgFAmYrbuUQHGFuYmVAZGVi aWFuLm9yZwAKCRBfsz+TWentCJwZD/4wzLLI8ykN4CnCYerSxLrIXRso2isv6sca N7tidaefCQDU3pxFgj5xDiiPyOzuv8hc0g4/SWRSEUnVP5bdJrOz5odcbl+q1hQg 28s+rJWdmBUP8Vj+JWN4c2bArqtX7+uThfL69KWaIVe00C+gszkltIBd1WDorBhw 5H2HgO78ybqYnnRh3dLGbsQdVTOuF6WucGsn0feZrHZjgraGmtC42KWoj6J2j0DY 0XaZFp5eN3ySCpA60hlYT6nQz3lJmoCOKsygCW2TZ2wZyet/N3oQBEUXD2eMBiNd w+cQN/VGLmX6EpU9TwqBJv0WG/U58PL52DnEQxYA7NDZAKwNf98r5wcsHWwEGxKN sz1inr4POYB0XV3sWbEOgr5B8Ng2JUcvADp2hCWKTDF8m/4RoebvxiwwxwR+UtN8 aUWEeEOYGRrmF5mgO2xmNF6FZGSz40HRmq7UOu+OCghhZ/Jx1CFtedes6EJ0ePuq UCzzXkDlJCZAA15aPpl4zrgqhgbu+iIfu8DEeJ1WgStH7A+xVKn3ltvJZeSkT3Ya VqVrTbW7wj+A4RkgYFWsW5YrSYOm2q4geKz4gGL6WVdw0Jk45x76GXYHQLqmmP6G sskIu1a2059jnqnWKAmkCEvMMNKLfWVKXRnQw1K1+/nEvCK7CWoTFXYEWZg2PNrs SMP7AxVY4Q== =+lQ3 -----END PGP SIGNATURE-----pgpQr3GL9jrHg.pgp
Description: PGP signature
--- End Message ---