Received: (at 35137) by debbugs.gnu.org; 19 Apr 2019 08:57:18 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 19 04:57:18 2019 Received: from localhost ([127.0.0.1]:43420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hHPKf-0007TN-Qt for submit <at> debbugs.gnu.org; Fri, 19 Apr 2019 04:57:18 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:59883) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1hHPKd-0007T7-Ob for 35137 <at> debbugs.gnu.org; Fri, 19 Apr 2019 04:57:16 -0400 Received: from [192.168.101.10] ([91.1.223.60]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MC2wN-1h7Fn34ATV-00CTER; Fri, 19 Apr 2019 10:56:57 +0200 Subject: Re: bug#35137: [df] incorrect parsing of /proc/self/mountinfo with \r in mount path From: Bernhard Voelker <mail@HIDDEN> To: Paul Eggert <eggert@HIDDEN>, =?UTF-8?Q?Zbigniew_J=c4=99drzejewski-Szmek?= <zbyszek@HIDDEN>, 35137 <at> debbugs.gnu.org References: <20190404075225.GH9027@HIDDEN> <163a6328-9d18-7e4d-2f5b-284223b8772b@HIDDEN> <af9cd9dd-baef-f6fc-814e-538ecccdff73@HIDDEN> <b83d3b10-bddf-397c-ae79-05a002b25cbe@HIDDEN> <e36e4c17-ec0d-ffa4-be71-ea8a758711d3@HIDDEN> <aa9c1174-5da9-9d8c-b4dd-dfba971f1a70@HIDDEN> Openpgp: preference=signencrypt Autocrypt: addr=mail@HIDDEN; prefer-encrypt=mutual; keydata= mQENBFPirzMBCACyzYldTjQ4ufFOkByY5Nn5USb5GFoL48nWBwNHjd9KUbtRRNlQiPNKd6hK Gvd3BGi5aoFKA4ytfRk6jbAbW3jVb3R8wYaV08mOy4KVEKxqN4bxsXlMjNChXVR+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AAkFAlPi rzMCGwwACgkQRlAu95aRcZWVPwgAqZT6iTXkoP37wYb41323RzhBcJ8JSk4cyBDBUXX0lMrM 3qhiClKG7phpxVdu817Gwc6Hsecg7FfjQAV8MHQ0ZFeEFdk3b2rKBqfsStc+h49/xF3Fb+if CzR9qeQF82fMSxkg18++7hMcHCMO/hPZ/Q0xRi+lrSr2QKDJQuLzSyVU14TxrCkevZjEhtma VNvcJlJzCbiBXee9Fpc5jITUXPFG8E8dxqo1n+duOyIMgozrAnzP7X5V/Ob/Ozf/aGGX9+Jd inyfCX18nWcHALKMU/36Eua/ylalf/2c2YkBp9KCLVmGgPkUgW52EeRPgroIsiwu+rwCSV6Z UyCJ+OymCg== Message-ID: <1469797d-4a20-f447-9145-fe5f503fbe7c@HIDDEN> Date: Fri, 19 Apr 2019 10:56:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <aa9c1174-5da9-9d8c-b4dd-dfba971f1a70@HIDDEN> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:R/C8ygfugeFRo2fz4WLNZpnLWybEZih/pIMzwtd7PkekVqa/eID BrbciTtfLs0q3dv6XSOD7zg9RgD4Kzwq2pFQ9mHaXbMOJpyAlexx5JUfiiNm+8buSP3t0P/ hzqgt3c+pin3fqQOMjHLaD3fFYGBJMZ2xFWLsOlc5lFjFdfzz9EriCaAb7Egim9zVYLdPaj 6u8dJr15/2TBVMiaLb4LA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:sQq5KUrxdwI=:+HXdfuNKCV++A91UUbqJvW 7ecxvzHVGzij/eTeNu/qT6yU3UxErCimq5WBtIIr/YL73TEzeeCc2M8hhQ2hpOgt4oKLDB+/I 6KMEngSmlaD708sA40Co9jgR+sAn9em3TFW3zh2ETrW4KDcDR0dE4f8d5ANj3eJgnj/deDXps sY6dNOasx/v9QAnT13dE2h9+bcw7UWqHDowLzAXRpv7k7avClcGFNuGQw5yq4gUHgwY6q0xr/ ajogPD0DZdN82/NjJpnc4aNNcBqlyDyGarJIxBgoxJ9yJ4n49X1VJ4pp/r0rRD2uYQoUrwLyH 35a4nOX/oSic70OhrUXsRthGhKav5ySQYZiKzwpF8YaKAwuQgYjfcW3xvivpk4f/RcFzbeYQi 5fCme/WdBFl/NkShgOOlC0Lt8Z64WKXUFq6ZvKkzHZUbpNCfCceuTfKwkSpKBbnPH7Xt/iFjI EMbn1+cLkIhWW087Aygv97QcNnKMBKL+cv5VV4qCPU8OvsYirxsqdj7cV6eNigDeaRNGHz12O fUEqc3Rv/1aiyWsZyQLt+XPn7OcbiAuDDr0maHr+NwWjb9nzeT/fI5uHw/wdPzW2q/zg7LUlp 9QU5l95FH6nP3AtVV2UsWabQKZEMhuAmeXpgzqfr6SKHGNhi6YsA4+76Lmk6gnDR5uXFZ13d7 aE2/oYRfSqKdVT1WH9h6ZkQi6wziYmhAHYpTWS5PY9V2YnHY2TmV9NvTS+Ey82E9rNGhauR0O jHS2unI7v1lAekrjF4fxX4wCJph8/mKBQZbqymhEX2JXAW9ckhPbP5lH+xA3yoRmHeupsQqiY 22VVjgC X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35137 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) On 4/18/19 8:19 AM, Bernhard Voelker wrote: > [...] Meanwhile, I intend to just pull in the gnulib change with > a NEWS entry - patch attached. I had to include another later gnulib commit: https://git.sv.gnu.org/cgit/gnulib.git/commit/?id=22b911f63ca1 Pushed for coreutils at: https://git.sv.gnu.org/cgit/coreutils.git/commit/?id=7d8adb20f6bb Have a nice day, Berny
bug-coreutils@HIDDEN
:bug#35137
; Package coreutils
.
Full text available.Received: (at 35137) by debbugs.gnu.org; 18 Apr 2019 06:19:26 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 18 02:19:26 2019 Received: from localhost ([127.0.0.1]:41395 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hH0OM-00013A-AJ for submit <at> debbugs.gnu.org; Thu, 18 Apr 2019 02:19:26 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:34569) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1hH0OJ-00012w-Rn for 35137 <at> debbugs.gnu.org; Thu, 18 Apr 2019 02:19:25 -0400 Received: from [192.168.101.10] ([91.1.223.60]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M1HmG-1hFMUT1B7q-002mMv; Thu, 18 Apr 2019 08:19:07 +0200 Subject: Re: bug#35137: [df] incorrect parsing of /proc/self/mountinfo with \r in mount path From: Bernhard Voelker <mail@HIDDEN> To: Paul Eggert <eggert@HIDDEN>, =?UTF-8?Q?Zbigniew_J=c4=99drzejewski-Szmek?= <zbyszek@HIDDEN>, 35137 <at> debbugs.gnu.org References: <20190404075225.GH9027@HIDDEN> <163a6328-9d18-7e4d-2f5b-284223b8772b@HIDDEN> <af9cd9dd-baef-f6fc-814e-538ecccdff73@HIDDEN> <b83d3b10-bddf-397c-ae79-05a002b25cbe@HIDDEN> <e36e4c17-ec0d-ffa4-be71-ea8a758711d3@HIDDEN> Openpgp: preference=signencrypt Autocrypt: addr=mail@HIDDEN; prefer-encrypt=mutual; keydata= mQENBFPirzMBCACyzYldTjQ4ufFOkByY5Nn5USb5GFoL48nWBwNHjd9KUbtRRNlQiPNKd6hK Gvd3BGi5aoFKA4ytfRk6jbAbW3jVb3R8wYaV08mOy4KVEKxqN4bxsXlMjNChXVR+rtKDmfI+ oPTL+cPH2X6gW4W02IRbVw0uUhNm6zEedC/gNrY/mTlf1enZ46jxZ7BTUZaG+kx38UMISIMB zSzLRtdkwgmHj4jS3p1fF2cwRqLclIfMjKGpbNFPEXeXKWrCLcqHw78795eAR9q0YvrDkfIn GdDBwfb3VM4NdulwIFzvYZMSXvSbbyPLB5YkHU5aAWQHUse4WlfT5ccDpbzUYldRAvF9ABEB AAG0K0Jlcm5oYXJkIFZvZWxrZXIgPG1haWxAYmVybmhhcmQtdm9lbGtlci5kZT6JATkEEwEC ACMFAlPirzMCGwMHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRBGUC73lpFxle5wCACC dbs0QaJ0vR3Sff2cKdTk41rUq3YfWngsR///IOU0C5DdkePmCnJE/lUsUy0LRTxcUDLxQR+x QHU8ssRT0JUO9726dI3miy36UdsgmBYaOtLvQcidGmW1R7o0PYYf04+TFtyqKgngOUBPpMgR 6o4UsQxy/OD4bN1WDqOgIjL+D/qJpkKmgp6L6+hhaBCpiOFKRmmV7YyQ3SqVlfQNiHs5ZtkR nXpIjgZARV+GllKucI17bO0CGmTJZ1tstVy0+W3DQT1lbBkTTc++5LONM99D3jjn23l1ocOp folR53F7I4cb2RNfT23v1I59RH37lB9wMOqrKj0UjYAC2YoPGQ3BuQENBFPirzMBCADXLWWp QihBldY6reca8ZKdc3T9qXEOa3akE3DWKztIBmNJhtYOjmpLYajQTkGa7UoJTnbmZE2Rn6ZE oNnvb0gcFNAIcY95KOI+bjOR8HEgh4cx2REXh6L6olIgyXqt/KFusE4wtVZAFxZl+30HzN6n D+1HvrjXxPJRX6MsIYOYyyX9/6OofwJK6QHODYGp8WL2olHDnmsXg4AT6Wlr7qKpKrQELlcF R4xkvdmgL/Ghw/tK0yJTxMIcewCCZWLPOXRmFRbvAadZWPAgVsJ63siNyUlVnVMSzDgTJl+s l/DMabXpqrJQx3/1Yy6mTaDs3XZT/wmBKaTLXx/LByaPxQQ7ABEBAAGJAR8EGAECAAkFAlPi rzMCGwwACgkQRlAu95aRcZWVPwgAqZT6iTXkoP37wYb41323RzhBcJ8JSk4cyBDBUXX0lMrM 3qhiClKG7phpxVdu817Gwc6Hsecg7FfjQAV8MHQ0ZFeEFdk3b2rKBqfsStc+h49/xF3Fb+if CzR9qeQF82fMSxkg18++7hMcHCMO/hPZ/Q0xRi+lrSr2QKDJQuLzSyVU14TxrCkevZjEhtma VNvcJlJzCbiBXee9Fpc5jITUXPFG8E8dxqo1n+duOyIMgozrAnzP7X5V/Ob/Ozf/aGGX9+Jd inyfCX18nWcHALKMU/36Eua/ylalf/2c2YkBp9KCLVmGgPkUgW52EeRPgroIsiwu+rwCSV6Z UyCJ+OymCg== Message-ID: <aa9c1174-5da9-9d8c-b4dd-dfba971f1a70@HIDDEN> Date: Thu, 18 Apr 2019 08:19:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <e36e4c17-ec0d-ffa4-be71-ea8a758711d3@HIDDEN> Content-Type: multipart/mixed; boundary="------------93DAEDE389506FB75480CFAB" Content-Language: en-US X-Provags-ID: V03:K1:zBqdsLYSkOPLgcBQK48yFQ4RQrg93vsDnW2KhXK6DK1tuD+x7ov hbx04uYUiSEBJnfHPvz6gGuR3ySUiEwq5Ugn83Wnn42mRtp2BrZ0ZKfg2efMs45xgy6iXxB RR6L4p4OCcaRAjuUtwCkgQIhsIXfhfvz0gJBPTZJm0rOz28eigh+AWeSBXx8KN0AJrPUvVJ 37eVGbz6TeQ/fq5VffvQQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:24M9VRq73k0=:jWs7UlERIFvLmCgIT7swDP wndJui5Shi0d9cQWxEIgRdcX6t1QA5pF0HSVf5s4Jn5txzdbgb2GaiPJv3vcfuJMTywzyRZg7 FtvbOGP3XysS4bJR2PSKudQZli4rwkNkVawuGDKRPlDDQSTLpfLxIXPMB6Aq1QX2+NKg3uysJ gVYB98Ctj4Ewhv5fvGejgSDp04MAl+EiJDwgKIdIXtFF5vVwaQsXHunhqlHrlgjYNlit8PF7j NnICZB24bORt+vk0fruf003SV9xMtjpzvsFLrsNsdJcYM1gJtWyrFhM/8/SbVSGivQnBl4nz2 4afPHNYpN0zUDfVpRumqV4whlvZJDGHv+Yg4iZ4sFS9kPk2VDkT1s5+eXAY1qnck8uxGgQZY2 h1vsvVoyF/WSua9eK1kGOga89wsvE6VwHH7+9IGsztUGmbIKBwLcWxDW15LfbyjSyfzz9EKUw Z1abedvAwfOrhq749YZSAbp/Vi85b95tAY35U/oKCMj5/BF/yInFyFLHw7VAFgJz8Boqwn3TC wh6fLpqlYm1K6xKwKyAl/raCj+oCqDO/SF2cfWnLitwLoU1Dc6Ak/WYtc4ApRsWKvKkif+zEK 2m0wWFnRcRPucYVcHfiFpC+jr9aEBUXhkwOmvgEk4CBayJc8BgnplEFFlAO3ntKZ78NK9d/LQ uQkaX6UVgVRukO1lcR4CQwbV7gxKk8i8HlsKeiQfo1pO2r1NHBqbcDjBGhvc1Yb01k2qUqsXT gFX6DTR5xIV5+/6b1MKSmZZ9RurR1s5z3nJdr2Ju2EvmUH4MTJhYt+AXJCE= X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35137 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------93DAEDE389506FB75480CFAB Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit [removing bug-gnulib] On 4/10/19 9:23 AM, Bernhard Voelker wrote: > Pushed with all these changes at: > https://git.sv.gnu.org/cgit/gnulib.git/commit/?id=eb8278fefa > > For coreutils, I'll push the (attached) gnulib update with a NEWS entry soon, > and then work on tests. The tests are probably best done as a new root-test, and therefore need extra caution. Meanwhile, I intend to just pull in the gnulib change with a NEWS entry - patch attached. Have a nice day, Berny --------------93DAEDE389506FB75480CFAB Content-Type: text/x-patch; name="0001-gnulib-update-to-the-latest.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-gnulib-update-to-the-latest.patch" From 774c9e14611be3690471b251ad889c82db632a0d Mon Sep 17 00:00:00 2001 From: Bernhard Voelker <mail@HIDDEN> Date: Wed, 10 Apr 2019 09:13:27 +0200 Subject: [PATCH] gnulib: update to the latest * gnulib: Update to latest, mainly for: > mountlist: make parsing /proc/self/mountinfo more robust * NEWS: Mention the fix. Fixes https://bugs.gnu.org/33468 --- NEWS | 7 +++++++ gnulib | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 6844228be..12c864dcc 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,13 @@ GNU coreutils NEWS -*- outline -*- ** Bug fixes + df now correctly parses the /proc/self/mountinfo file for unusual entries + like ones with '\r' in a field value ("mount -t tmpfs tmpfs /foo$'\r'bar"), + when the source field is empty ('mount -t tmpfs "" /mnt'), and when the + filesystem type contains characters like a blank which need escaping. + [bugs introduced in coreutils-8.24 with the introduction of reading + the /proc/self/mountinfo file] + factor again outputs immediately when stdout is a tty but stdin is not. [bug introduced in coreutils-8.24] diff --git a/gnulib b/gnulib index 188d87b05..eb8278fef 160000 --- a/gnulib +++ b/gnulib @@ -1 +1 @@ -Subproject commit 188d87b05190690d6f8b0577ec65ef221a711d08 +Subproject commit eb8278fefa0bbf2a53b706bffb2c99ccfe5d7bd4 -- 2.21.0 --------------93DAEDE389506FB75480CFAB--
bug-coreutils@HIDDEN
:bug#35137
; Package coreutils
.
Full text available.Received: (at 35137) by debbugs.gnu.org; 10 Apr 2019 07:24:42 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 10 03:24:42 2019 Received: from localhost ([127.0.0.1]:52350 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hE7b8-0001Oj-BI for submit <at> debbugs.gnu.org; Wed, 10 Apr 2019 03:24:42 -0400 Received: from kawka.in.waw.pl ([178.62.225.244]:57318) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <zbyszek@HIDDEN>) id 1hE7b7-0001OY-50 for 35137 <at> debbugs.gnu.org; Wed, 10 Apr 2019 03:24:41 -0400 Received: from zbyszek by kawka.in.waw.pl with local (Exim 4.80) (envelope-from <zbyszek@HIDDEN>) id 1hE7b4-0001JA-DQ; Wed, 10 Apr 2019 07:24:38 +0000 Date: Wed, 10 Apr 2019 07:24:38 +0000 From: Zbigniew =?utf-8?Q?J=C4=99drzejewski-Szmek?= <zbyszek@HIDDEN> To: Paul Eggert <eggert@HIDDEN> Subject: Re: bug#35137: [df] incorrect parsing of /proc/self/mountinfo with \r in mount path Message-ID: <20190410072438.GH10527@HIDDEN> References: <20190404075225.GH9027@HIDDEN> <163a6328-9d18-7e4d-2f5b-284223b8772b@HIDDEN> <af9cd9dd-baef-f6fc-814e-538ecccdff73@HIDDEN> <b83d3b10-bddf-397c-ae79-05a002b25cbe@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <b83d3b10-bddf-397c-ae79-05a002b25cbe@HIDDEN> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35137 Cc: bug-gnulib <bug-gnulib@HIDDEN>, Bernhard Voelker <mail@HIDDEN>, 35137 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hi, I don't know this codebase, so can't comment on the patch, but the same bug in util-linux was solved by ditching scanf. https://github.com/karelzak/util-linux/commit/e902609400a861dbdb47d5c3eb98b951530bf01d https://github.com/karelzak/util-linux/commit/e3782bf6776dcef329b09f4324e1be680f690f3c Zbyszek On Tue, Apr 09, 2019 at 07:15:04PM -0700, Paul Eggert wrote: > Bernhard Voelker wrote: > > +/* Find the next white space in STR, terminate the string there in place, > + and return that position. Otherwise return NULL. */ > + > +static char * > +terminate_at_blank (char const *str) > +{ > + char *s = NULL; > + if ((s = strchr (str, ' ')) != NULL) > + *s = '\0'; > + return s; > +} > > Since the function modifies its argument, the argument type should > be char *, not char const *. Also, the code has an assignment in an > 'if' conditional and the comment is not quite right. Better is: > > /* Find the next space in STR, terminate the string there in place, > and return that position. Otherwise return NULL. */ > > static char * > terminate_at_blank (char *str) > { > char *s = strchr (str, ' '); > if (s) > *s = '\0'; > return s; > } > > >+ if (! (blank = terminate_at_blank (mntroot))) > >+ continue; > > Avoid assignments in 'if' conditionals. Better is: > > blank = terminate_at_blank (target); > if (! blank) > continue; > > + if (*source == ' ') > + { > + /* The source is an empty string, which is e.g. allowed for > + tmpfs: "mount -t tmpfs '' /mnt". */ > + *source = '\0'; > + } > + else > + { > + if (! (blank = terminate_at_blank (source))) > + continue; > + } > > Since 'blank' is not used later, surely these 11 lines of code can > be simplified to 2 lines: > > if (! terminate_at_blank (source)) > continue; > > >+ int mntroot_s; > >+ char *mntroot, *blank, *target, *dash, *fstype, *source; > > I suggest using C99-style declaration-after-statement style rather > than this old-fashioned C89-style declarations-at-start-of-block > style, just for the changed part of the code anyway. >
bug-coreutils@HIDDEN
:bug#35137
; Package coreutils
.
Full text available.Received: (at 35137) by debbugs.gnu.org; 10 Apr 2019 07:24:24 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 10 03:24:24 2019 Received: from localhost ([127.0.0.1]:52344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hE7ap-0001Nw-TT for submit <at> debbugs.gnu.org; Wed, 10 Apr 2019 03:24:24 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:59019) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1hE7an-0001Ng-S1 for 35137 <at> debbugs.gnu.org; Wed, 10 Apr 2019 03:24:22 -0400 Received: from [192.168.101.10] ([91.1.223.60]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mx0VH-1gyu1C46zT-00yUcT; Wed, 10 Apr 2019 09:24:02 +0200 Subject: Re: bug#35137: [df] incorrect parsing of /proc/self/mountinfo with \r in mount path To: Paul Eggert <eggert@HIDDEN>, =?UTF-8?Q?Zbigniew_J=c4=99drzejewski-Szmek?= <zbyszek@HIDDEN>, 35137 <at> debbugs.gnu.org, bug-gnulib <bug-gnulib@HIDDEN> References: <20190404075225.GH9027@HIDDEN> <163a6328-9d18-7e4d-2f5b-284223b8772b@HIDDEN> <af9cd9dd-baef-f6fc-814e-538ecccdff73@HIDDEN> <b83d3b10-bddf-397c-ae79-05a002b25cbe@HIDDEN> From: Bernhard Voelker <mail@HIDDEN> Openpgp: preference=signencrypt Autocrypt: addr=mail@HIDDEN; prefer-encrypt=mutual; keydata= mQENBFPirzMBCACyzYldTjQ4ufFOkByY5Nn5USb5GFoL48nWBwNHjd9KUbtRRNlQiPNKd6hK Gvd3BGi5aoFKA4ytfRk6jbAbW3jVb3R8wYaV08mOy4KVEKxqN4bxsXlMjNChXVR+rtKDmfI+ oPTL+cPH2X6gW4W02IRbVw0uUhNm6zEedC/gNrY/mTlf1enZ46jxZ7BTUZaG+kx38UMISIMB zSzLRtdkwgmHj4jS3p1fF2cwRqLclIfMjKGpbNFPEXeXKWrCLcqHw78795eAR9q0YvrDkfIn GdDBwfb3VM4NdulwIFzvYZMSXvSbbyPLB5YkHU5aAWQHUse4WlfT5ccDpbzUYldRAvF9ABEB AAG0K0Jlcm5oYXJkIFZvZWxrZXIgPG1haWxAYmVybmhhcmQtdm9lbGtlci5kZT6JATkEEwEC ACMFAlPirzMCGwMHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRBGUC73lpFxle5wCACC dbs0QaJ0vR3Sff2cKdTk41rUq3YfWngsR///IOU0C5DdkePmCnJE/lUsUy0L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: Wed, 10 Apr 2019 09:23:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <b83d3b10-bddf-397c-ae79-05a002b25cbe@HIDDEN> Content-Type: multipart/mixed; boundary="------------830BC8B7149A07191466F391" Content-Language: en-US X-Provags-ID: V03:K1:RzEYdwPmZtCPE7MJo8LwpvVB4rpaSEl8RwCpFpdGPdO9JSFajWG hTuoCot/zed8GZYQJ2590hjD2QHs9P1dX6PXfZThB6hoUF43CaOJwI8s6uuMonSfz1kndJl ijVtCDpCFPPCumO8cbFAkHK945+QhM40RtJiZ1srst0a9bPyx+OVBXIJZR5+Kgg9wS13xYm BgW5LJu2fEpJJdQripC5A== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:vcfJbcv8JEU=:RdozhuiAfDv16+vQyoocUI Q84Etntxayjhewsi/3u8/DSQQpGuML7LP3ZTP5s16lUdlJkmeWKyiAC1X5o5fkkSGzHfl89UW hQAndwklbz7KJ+m7Vio133vjyRAI2t7Riz0MeiXp903zJK3WvPlEfo1dfdlsf25uW1vu+2lIB +ZQ5oEqIypOQFIHKoBS8N/IewSDSX+TzPXLXGLerAz8kfojN3aBIwU2sNBapheAPu7z2pniD9 CLlQrGBTCkOACAyGIoAmPu9M58BiVXuVumTU9PHQDaWtAl95UIDZouEtwlvRZPKRkuddQOxMF hlpdUY+Xi+QTHvZKYlmoyj/gc8kSxpVOQJ2eujnTO7JKF5Pfe3sTjKuwOVwvKwfe52OJnVsLF e8i5wF/K2Locgt9yJYTnGfpdNKpFqIUskhZzzBKh6fT22LPhPFO397keo7El+VXC1h9BxFEft 0Mnn8YztyC8gUr8sJSR+kXawSTMYhefEBJ8tf0uQccJXjg2FeR8G0sqrc00v2WKNFgTPItqDY bz7xdUYNk8XsbhmvW+oiw5N0lQlmype6JCoCLMLqzwofGQbUjOszRdsOLTV09F7wPEzmtvnVh eIALhwEtiSDrbggTzdmXF8vngLutBQ+6UZeXXTy4Bx7wHraNGxWo8V7mNs3qtrXhHM8wh24Yk EvRQlb+Q/WxUSMvL+wXz7xPiKwYb3DlsDL4Sqfa0Ni33c2KtgLZjhtLXUppWLMrf7dOyQthND Lbj/nRiYOlH73zZ/iRRZIaj7d6Y5UuDe26crc3x4xKrijGYpAUCofwI8TrI= X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35137 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------830BC8B7149A07191466F391 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 4/10/19 4:15 AM, Paul Eggert wrote: > Bernhard Voelker wrote: > > +/* Find the next white space in STR, terminate the string there in place, > + and return that position. Otherwise return NULL. */ > + > +static char * > +terminate_at_blank (char const *str) > +{ > + char *s = NULL; > + if ((s = strchr (str, ' ')) != NULL) > + *s = '\0'; > + return s; > +} > > Since the function modifies its argument, the argument type should be char *, > not char const *. Also, the code has an assignment in an 'if' conditional and > the comment is not quite right. Better is: > > /* Find the next space in STR, terminate the string there in place, > and return that position. Otherwise return NULL. */ > > static char * > terminate_at_blank (char *str) > { > char *s = strchr (str, ' '); > if (s) > *s = '\0'; > return s; > } > >> + if (! (blank = terminate_at_blank (mntroot))) >> + continue; > > Avoid assignments in 'if' conditionals. Better is: > > blank = terminate_at_blank (target); > if (! blank) > continue; > > + if (*source == ' ') > + { > + /* The source is an empty string, which is e.g. allowed for > + tmpfs: "mount -t tmpfs '' /mnt". */ > + *source = '\0'; > + } > + else > + { > + if (! (blank = terminate_at_blank (source))) > + continue; > + } > > Since 'blank' is not used later, surely these 11 lines of code can be simplified > to 2 lines: > > if (! terminate_at_blank (source)) > continue; > >> + int mntroot_s; >> + char *mntroot, *blank, *target, *dash, *fstype, *source; > > I suggest using C99-style declaration-after-statement style rather than this > old-fashioned C89-style declarations-at-start-of-block style, just for the > changed part of the code anyway. Thanks for the review. Pushed with all these changes at: https://git.sv.gnu.org/cgit/gnulib.git/commit/?id=eb8278fefa For coreutils, I'll push the (attached) gnulib update with a NEWS entry soon, and then work on tests. Have a nice day, Berny --------------830BC8B7149A07191466F391 Content-Type: text/x-patch; name="0001-gnulib-update-to-the-latest.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-gnulib-update-to-the-latest.patch" From b938a1badf672f8168daf71fd751e947877c9fc7 Mon Sep 17 00:00:00 2001 From: Bernhard Voelker <mail@HIDDEN> Date: Wed, 10 Apr 2019 09:13:27 +0200 Subject: [PATCH] gnulib: update to the latest * gnulib: Update to latest, mainly for: > mountlist: make parsing /proc/self/mountinfo more robust * NEWS: Mention the fix. Fixes https://bugs.gnu.org/33468 --- NEWS | 7 +++++++ gnulib | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 6844228be..132f2a0f3 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,13 @@ GNU coreutils NEWS -*- outline -*- ** Bug fixes + df now correctly parses the /proc/self/mountinfo file for unusual entries + with '\r' in a field value ("mount -t tmpfs tmpfs /foo$'\r'bar"), + when the source field is empty ('mount -t tmpfs "" /mnt'), and when the + filesystem type contains characters like blank which need escaping. + [bugs introduced in coreutils-8.24 with the introduction of reading + the /proc/self/mountinfo file] + factor again outputs immediately when stdout is a tty but stdin is not. [bug introduced in coreutils-8.24] diff --git a/gnulib b/gnulib index 188d87b05..eb8278fef 160000 --- a/gnulib +++ b/gnulib @@ -1 +1 @@ -Subproject commit 188d87b05190690d6f8b0577ec65ef221a711d08 +Subproject commit eb8278fefa0bbf2a53b706bffb2c99ccfe5d7bd4 -- 2.21.0 --------------830BC8B7149A07191466F391--
bug-coreutils@HIDDEN
:bug#35137
; Package coreutils
.
Full text available.Received: (at 35137) by debbugs.gnu.org; 10 Apr 2019 02:15:15 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 09 22:15:15 2019 Received: from localhost ([127.0.0.1]:52263 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hE2ld-0001zp-GZ for submit <at> debbugs.gnu.org; Tue, 09 Apr 2019 22:15:13 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:39408) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eggert@HIDDEN>) id 1hE2lb-0001zb-Qe for 35137 <at> debbugs.gnu.org; Tue, 09 Apr 2019 22:15:12 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 25A54161627; Tue, 9 Apr 2019 19:15:06 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id qCFsiZOHmRBT; Tue, 9 Apr 2019 19:15:05 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 4F9FE161608; Tue, 9 Apr 2019 19:15:05 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id CA9N29iKq340; Tue, 9 Apr 2019 19:15:05 -0700 (PDT) Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 2074616161D; Tue, 9 Apr 2019 19:15:05 -0700 (PDT) Subject: Re: bug#35137: [df] incorrect parsing of /proc/self/mountinfo with \r in mount path To: Bernhard Voelker <mail@HIDDEN>, =?UTF-8?Q?Zbigniew_J=c4=99drzejewski-Szmek?= <zbyszek@HIDDEN>, 35137 <at> debbugs.gnu.org, bug-gnulib <bug-gnulib@HIDDEN> References: <20190404075225.GH9027@HIDDEN> <163a6328-9d18-7e4d-2f5b-284223b8772b@HIDDEN> <af9cd9dd-baef-f6fc-814e-538ecccdff73@HIDDEN> From: Paul Eggert <eggert@HIDDEN> Organization: UCLA Computer Science Department Message-ID: <b83d3b10-bddf-397c-ae79-05a002b25cbe@HIDDEN> Date: Tue, 9 Apr 2019 19:15:04 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <af9cd9dd-baef-f6fc-814e-538ecccdff73@HIDDEN> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 35137 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Bernhard Voelker wrote: +/* Find the next white space in STR, terminate the string there in place, + and return that position. Otherwise return NULL. */ + +static char * +terminate_at_blank (char const *str) +{ + char *s = NULL; + if ((s = strchr (str, ' ')) != NULL) + *s = '\0'; + return s; +} Since the function modifies its argument, the argument type should be char *, not char const *. Also, the code has an assignment in an 'if' conditional and the comment is not quite right. Better is: /* Find the next space in STR, terminate the string there in place, and return that position. Otherwise return NULL. */ static char * terminate_at_blank (char *str) { char *s = strchr (str, ' '); if (s) *s = '\0'; return s; } > + if (! (blank = terminate_at_blank (mntroot))) > + continue; Avoid assignments in 'if' conditionals. Better is: blank = terminate_at_blank (target); if (! blank) continue; + if (*source == ' ') + { + /* The source is an empty string, which is e.g. allowed for + tmpfs: "mount -t tmpfs '' /mnt". */ + *source = '\0'; + } + else + { + if (! (blank = terminate_at_blank (source))) + continue; + } Since 'blank' is not used later, surely these 11 lines of code can be simplified to 2 lines: if (! terminate_at_blank (source)) continue; > + int mntroot_s; > + char *mntroot, *blank, *target, *dash, *fstype, *source; I suggest using C99-style declaration-after-statement style rather than this old-fashioned C89-style declarations-at-start-of-block style, just for the changed part of the code anyway.
bug-coreutils@HIDDEN
:bug#35137
; Package coreutils
.
Full text available.Received: (at 35137) by debbugs.gnu.org; 9 Apr 2019 22:31:45 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 09 18:31:45 2019 Received: from localhost ([127.0.0.1]:52120 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hDzHM-0000rE-N0 for submit <at> debbugs.gnu.org; Tue, 09 Apr 2019 18:31:45 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:44853) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1hDzHL-0000qz-0f for 35137 <at> debbugs.gnu.org; Tue, 09 Apr 2019 18:31:44 -0400 Received: from [192.168.101.10] ([91.1.223.60]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M6H7o-1hGA4W2ReC-006ezs; Wed, 10 Apr 2019 00:31:36 +0200 Subject: Re: bug#35137: [df] incorrect parsing of /proc/self/mountinfo with \r in mount path From: Bernhard Voelker <mail@HIDDEN> To: =?UTF-8?Q?Zbigniew_J=c4=99drzejewski-Szmek?= <zbyszek@HIDDEN>, 35137 <at> debbugs.gnu.org, bug-gnulib <bug-gnulib@HIDDEN> References: <20190404075225.GH9027@HIDDEN> <163a6328-9d18-7e4d-2f5b-284223b8772b@HIDDEN> Openpgp: preference=signencrypt Autocrypt: addr=mail@HIDDEN; prefer-encrypt=mutual; keydata= mQENBFPirzMBCACyzYldTjQ4ufFOkByY5Nn5USb5GFoL48nWBwNHjd9KUbtRRNlQiPNKd6hK Gvd3BGi5aoFKA4ytfRk6jbAbW3jVb3R8wYaV08mOy4KVEKxqN4bxsXlMjNChXVR+rtKDmfI+ oPTL+cPH2X6gW4W02IRbVw0uUhNm6zEedC/gNrY/mTlf1enZ46jxZ7BTUZaG+kx38UMISIMB zSzLRtdkwgmHj4jS3p1fF2cwRqLclIfMjKGpbNFPEXeXKWrCLcqHw78795eAR9q0YvrDkfIn GdDBwfb3VM4NdulwIFzvYZMSXvSbbyPLB5YkHU5aAWQHUse4WlfT5ccDpbzUYldRAvF9ABEB AAG0K0Jlcm5oYXJkIFZvZWxrZXIgPG1haWxAYmVybmhhcmQtdm9lbGtlci5kZT6JATkEEwEC ACMFAlPirzMCGwMHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRBGUC73lpFxle5wCACC dbs0QaJ0vR3Sff2cKdTk41rUq3YfW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f6fc-814e-538ecccdff73@HIDDEN> Date: Wed, 10 Apr 2019 00:31:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <163a6328-9d18-7e4d-2f5b-284223b8772b@HIDDEN> Content-Type: multipart/mixed; boundary="------------77D276E7C0BC72F0D25CFBCC" Content-Language: en-US X-Provags-ID: V03:K1:qcixeu7anXOgr5n1WE0yVPHGc8IK3MuTklyui+SMQNbFNv/acdA woJQRH2j5WcspkflqoTuN3teN6yIJL4zCIadV7+9KN9Jw+JgsxaE2wFPs2Q7m1EgBQnygMT U6nSiGTCoOZL5zKGxjL2dTjXAtVtPYU45VRyt82BlBWorfAGU5lJAOcwLuGNvt4+Qr4xg3D 7R/TfUhfcSIkPsWomzytA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:wsT7ChodVCc=:NSac0UWjAnV1RlQIe7GYy6 BwKZ6wUwO0wwhNt0kAUM7FWJVj5gSQhFexpPfx+g0jV49G7qcXE15IYbd6qlZEnuB9UCnix0w Ma1k4geeSd8Q8n22OX+y86VXQQjfePfARwwjF+1TWAzDTaBNfpXPkvsHtfg3Fir8Uzcsc2vze KckNqtv4jLE1XmoPwFUxL99XKGfpqweY6S4EXi3EipIxkrobVnuV0C5kGf4wTiTfSOfCnOVx8 UzJyyVrwA08UEuY9sE9l0T+Z9CtTa7TQUmYuX4G1S+OCHjV2u5Pqx7CswAlx9TCyhamBTvAcU yIBzSChD5ocDAsuRa+eCCglVJ5CGpz6qp0N/fDSfErerhdSIPPROQdwxrlXfn2Ysoxy5s5M20 VVQJtn96/8PfbA3O75erIb8zivReZLR4Qn3MJOAfs5UYbTjrPvHFjx4YnsEtlUOqUlzRh4KZ5 FrCWiEqfYe5kqfmB9z3yhJ/ddY8ChVunj9t7ZL1GJFyv0n2us4Iu2AbIQF9203MOzh03asooI /G0Jsi66MMbS5mdWTC5KyGkVA+evhHiniFfnN7cLcnv+FpCJdtDx1QEWqEYdHsPAlM20g8z/N uy70ehRkk8qccn1NmkeeaeSYZlL/vBDAN2mpHJr7tOSqvHo5HJXLGtFEsj0QQs2ociT78tiWr ZbQ7LrCfgCtcpUgvMMcrJnwNC7dc7iAX261swo5Qageb/vXJ7PzehinCj/1d0x6xjYlXMp8iV 4PbvpCOgsYknSFpH4FKhsRC6EamqfXDxInH02MQbNjZdW0cz2HsCeggdV/0= X-Spam-Score: -0.3 (/) X-Debbugs-Envelope-To: 35137 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.3 (-) This is a multi-part message in MIME format. --------------77D276E7C0BC72F0D25CFBCC Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit [adding gnulib, coming from https://bugs.gnu.org/35137] On 4/5/19 9:01 AM, Bernhard Voelker wrote: > On 4/4/19 9:52 AM, Zbigniew Jędrzejewski-Szmek wrote: >> See https://github.com/systemd/systemd/issues/12018 and >> https://github.com/karelzak/util-linux/issues/780 for additional context. >> >> $ mkdir "$(echo -e foo\\rbar)" >> $ sudo mount -t tmpfs tmpfs foo^Mbar/ >> $ cat -v /proc/self/mountinfo|grep foo >> 865 39 0:59 / /tmp/foo^Mbar rw,relatime shared:462 - tmpfs tmpfs rw,seclabel >> $ df -h | grep foo >> $ df -h /tmp/foo$'\r'bar >> Filesystem Size Used Avail Use% Mounted on >> - 3.9G 0 3.9G 0% /tmp/foo?bar >> >> When asked to show all filesystems, the mount point is not shown at all. >> When asked to show just that one, df parses the mount point correctly, >> but it gets the filesystem type wrong. > > Thanks for the report. > > I see the issue is not yet solved in util-linux as well. > For coreutils, the fix is in gnulib. Parsing the line is starting > to get ugly ... dirty patch attached. > > This also caters for the issue that df(1) totally skips a file system > if the source is an empty string which is allowed for e.g. tmpfs: > > $ mount -t tmpfs '' /mnt > $ df -h | grep mnt The attached is a patch for gnulib to fix the reported and two other issues when parsing /proc/self/mountinfo. Any objections? Meanwhile, I'm working a test for coreutils' df. FWIW: Karel fixed this issue in util-linux yesterday: https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/commit/?id=86673b3a46 Have a nice day, Berny --------------77D276E7C0BC72F0D25CFBCC Content-Type: text/x-patch; name="0001-mountlist-make-parsing-proc-self-mountinfo-more-robu.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename*0="0001-mountlist-make-parsing-proc-self-mountinfo-more-robu.pa"; filename*1="tch" From 15be8e6bcb6203fdb91d4a01fb65c2d4ef76995e Mon Sep 17 00:00:00 2001 From: Bernhard Voelker <mail@HIDDEN> Date: Tue, 9 Apr 2019 22:30:16 +0200 Subject: [PATCH] mountlist: make parsing /proc/self/mountinfo more robust MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cater for the following issues with mountinfo parsing (the first one was reported by Zbigniew Jędrzejewski-Szmek <zbyszek@HIDDEN> in <https://bugs.gnu.org/35137>). 1. The fields source, target, mntroot and fstype may contain characters like '\r'; sscanf(3) fails to read such values with the %s format specifier because it would stop at such characters. Example: "mount -t tmpfs tmpfs /foo^Mbar". The only true separator in that file is the ' ' character. 2. The source field may be an empty string, which happens e.g. with "mount -t tmpfs '' /target". 3. The fstype field may contain mangled characters as well which need unescaping. * lib/mountlist.c (terminate_at_blank): Add utility function. (read_file_system_list): In the block trying to read the mountinfo file, avoid using sscanf(3) with %s format; instead, parse the above fields separated by white spaces one by one. Handle the case when the source field is an empty string. Unescape the fstype field. --- ChangeLog | 22 +++++++++++++ lib/mountlist.c | 83 +++++++++++++++++++++++++++++++------------------ 2 files changed, 74 insertions(+), 31 deletions(-) diff --git a/ChangeLog b/ChangeLog index 87d95ed99..e049e81a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2019-04-09 Bernhard Voelker <mail@HIDDEN> + + mountlist: make parsing /proc/self/mountinfo more robust + Cater for the following issues with mountinfo parsing (the first + one was reported by Zbigniew Jędrzejewski-Szmek <zbyszek@HIDDEN> + in <https://bugs.gnu.org/35137>). + 1. The fields source, target, mntroot and fstype may contain characters + like '\r'; sscanf(3) fails to read such values with the %s format + specifier because it would stop at such characters. + Example: "mount -t tmpfs tmpfs /foo^Mbar". + The only true separator in that file is the ' ' character. + 2. The source field may be an empty string, which happens e.g. with + "mount -t tmpfs '' /target". + 3. The fstype field may contain mangled characters as well which need + unescaping. + * lib/mountlist.c (terminate_at_blank): Add utility function. + (read_file_system_list): In the block trying to read the mountinfo file, + avoid using sscanf(3) with %s format; instead, parse the above fields + separated by white spaces one by one. + Handle the case when the source field is an empty string. + Unescape the fstype field. + 2019-04-09 Bruno Haible <bruno@HIDDEN> openmp: Add workaround for 32-bit programs on AIX. diff --git a/lib/mountlist.c b/lib/mountlist.c index 9b54a2cf7..9e01d13f4 100644 --- a/lib/mountlist.c +++ b/lib/mountlist.c @@ -418,6 +418,18 @@ unescape_tab (char *str) str[j++] = str[i]; } } + +/* Find the next white space in STR, terminate the string there in place, + and return that position. Otherwise return NULL. */ + +static char * +terminate_at_blank (char const *str) +{ + char *s = NULL; + if ((s = strchr (str, ' ')) != NULL) + *s = '\0'; + return s; +} #endif /* Return a list of the currently mounted file systems, or NULL on error. @@ -453,56 +465,65 @@ read_file_system_list (bool need_fs_type) while (getline (&line, &buf_size, fp) != -1) { unsigned int devmaj, devmin; - int target_s, target_e, type_s, type_e; - int source_s, source_e, mntroot_s, mntroot_e; - char test; - char *dash; + int mntroot_s; + char *mntroot, *blank, *target, *dash, *fstype, *source; int rc; rc = sscanf(line, "%*u " /* id - discarded */ "%*u " /* parent - discarded */ "%u:%u " /* dev major:minor */ - "%n%*s%n " /* mountroot */ - "%n%*s%n" /* target, start and end */ - "%c", /* more data... */ + "%n", /* mountroot */ &devmaj, &devmin, - &mntroot_s, &mntroot_e, - &target_s, &target_e, - &test); + &mntroot_s); + + if (rc != 2 && rc != 3) /* 3 if %n included in count. */ + continue; - if (rc != 3 && rc != 7) /* 7 if %n included in count. */ + /* find end of MNTROOT. */ + mntroot = line + mntroot_s; + if (! (blank = terminate_at_blank (mntroot))) + continue; + + /* find end of TARGET. */ + target = blank + 1; + if (! (blank = terminate_at_blank (target))) continue; /* skip optional fields, terminated by " - " */ - dash = strstr (line + target_e, " - "); + dash = strstr (blank + 1, " - "); if (! dash) continue; - rc = sscanf(dash, " - " - "%n%*s%n " /* FS type, start and end */ - "%n%*s%n " /* source, start and end */ - "%c", /* more data... */ - &type_s, &type_e, - &source_s, &source_e, - &test); - if (rc != 1 && rc != 5) /* 5 if %n included in count. */ + /* advance past the " - " separator. */ + fstype = dash + 3; + if (! (blank = terminate_at_blank (fstype))) continue; + source = blank + 1; + if (*source == ' ') + { + /* The source is an empty string, which is e.g. allowed for + tmpfs: "mount -t tmpfs '' /mnt". */ + *source = '\0'; + } + else + { + if (! (blank = terminate_at_blank (source))) + continue; + } + /* manipulate the sub-strings in place. */ - line[mntroot_e] = '\0'; - line[target_e] = '\0'; - dash[type_e] = '\0'; - dash[source_e] = '\0'; - unescape_tab (dash + source_s); - unescape_tab (line + target_s); - unescape_tab (line + mntroot_s); + unescape_tab (source); + unescape_tab (target); + unescape_tab (mntroot); + unescape_tab (fstype); me = xmalloc (sizeof *me); - me->me_devname = xstrdup (dash + source_s); - me->me_mountdir = xstrdup (line + target_s); - me->me_mntroot = xstrdup (line + mntroot_s); - me->me_type = xstrdup (dash + type_s); + me->me_devname = xstrdup (source); + me->me_mountdir = xstrdup (target); + me->me_mntroot = xstrdup (mntroot); + me->me_type = xstrdup (fstype); me->me_type_malloced = 1; me->me_dev = makedev (devmaj, devmin); /* we pass "false" for the "Bind" option as that's only -- 2.21.0 --------------77D276E7C0BC72F0D25CFBCC--
bug-coreutils@HIDDEN
:bug#35137
; Package coreutils
.
Full text available.Received: (at 35137) by debbugs.gnu.org; 5 Apr 2019 07:01:12 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 05 03:01:12 2019 Received: from localhost ([127.0.0.1]:45013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hCIqe-000734-CZ for submit <at> debbugs.gnu.org; Fri, 05 Apr 2019 03:01:12 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:35711) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1hCIqb-00072q-AR for 35137 <at> debbugs.gnu.org; Fri, 05 Apr 2019 03:01:10 -0400 Received: from [192.168.101.10] ([91.1.223.60]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MDeAZ-1h25hC1ZJ9-00Aj9E; Fri, 05 Apr 2019 09:01:01 +0200 Subject: Re: bug#35137: [df] incorrect parsing of /proc/self/mountinfo with \r in mount path To: =?UTF-8?Q?Zbigniew_J=c4=99drzejewski-Szmek?= <zbyszek@HIDDEN>, 35137 <at> debbugs.gnu.org References: <20190404075225.GH9027@HIDDEN> From: Bernhard Voelker <mail@HIDDEN> Openpgp: preference=signencrypt Autocrypt: addr=mail@HIDDEN; prefer-encrypt=mutual; keydata= mQENBFPirzMBCACyzYldTjQ4ufFOkByY5Nn5USb5GFoL48nWBwNHjd9KUbtRRNlQ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zDgTJl+s l/DMabXpqrJQx3/1Yy6mTaDs3XZT/wmBKaTLXx/LByaPxQQ7ABEBAAGJAR8EGAECAAkFAlPi rzMCGwwACgkQRlAu95aRcZWVPwgAqZT6iTXkoP37wYb41323RzhBcJ8JSk4cyBDBUXX0lMrM 3qhiClKG7phpxVdu817Gwc6Hsecg7FfjQAV8MHQ0ZFeEFdk3b2rKBqfsStc+h49/xF3Fb+if CzR9qeQF82fMSxkg18++7hMcHCMO/hPZ/Q0xRi+lrSr2QKDJQuLzSyVU14TxrCkevZjEhtma VNvcJlJzCbiBXee9Fpc5jITUXPFG8E8dxqo1n+duOyIMgozrAnzP7X5V/Ob/Ozf/aGGX9+Jd inyfCX18nWcHALKMU/36Eua/ylalf/2c2YkBp9KCLVmGgPkUgW52EeRPgroIsiwu+rwCSV6Z UyCJ+OymCg== Message-ID: <163a6328-9d18-7e4d-2f5b-284223b8772b@HIDDEN> Date: Fri, 5 Apr 2019 09:01:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190404075225.GH9027@HIDDEN> Content-Type: multipart/mixed; boundary="------------57ACEB4F94A09935F5EFFF75" Content-Language: en-US X-Provags-ID: V03:K1:U4UFL3VRl0n2PWQWS/pGET7P73GtB+xX2PpGBZCY0PBYa+wBsWS aGnCAioeDTn1IGaZmao+hbrgPj2Y7j7q+H9sexyTNYfRNnDIPpX5kUIpQEC0fE0VLhJC3qv lDtAoL8ule5Cyi7CiK6RjedeRq1j+vkoO2IHE8FrnTt56+Y4uz1KP6U0IODgVCdFIuhwwyi 6mYSvMZOl04wDwZrYzcGQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:uy/tooqxDus=:79twaupNEVi6s0MUzGBOaB dAXRi/XKyE1+yT2J2vvGHTWHMaNVgOeWq5nc7dHfkuDuWkRzV8NolkRBQQg34wnGaR41SGrxe t2YWWbzQylngz3RUp2hKQIWuRVkwn8cY2bQl5SxFHZ8yDZGamplrE6k2PbjrYCc5XJ6mUTB99 anToN4bADAL9kxBEOTAlyZsOWjMyDDb3pwd1JlDOhMnmM9xH007QGgAOPD1VCMN0txOsb+LUk nOBqxgqzTfoAY/Tg8e7JOLM5F8E8lXu7rC9MmkMQXR1fHsZQGpNsTzNSR5gW3315VGLIeyWcC Gqj+vHWzhJG9aiSJx3Gy13c/mg+QHcTTlKZ0IjGeyFvqT3rCYZBORv3zipszcy7YTgXcuzdm2 0ntID0UAibBrZOQQQdOULTWKPu1ys6HE8JNjq00wMU3TFdq3UR4Hr0l03uPJbwCT/+gZ9cqV2 pjKIvkya8srohQd+LMOo3BZFPUsUwyW/SQCgTZtSmGXBbjWTbiASONYn7ImpKXzPlgn4bN4c7 iy6u6FWdUDAh7jDxrwJm8Y+E6lp1PH0Rm/36TnJX0FLL50KGbP3zaBtORI9R9AlWRaySZ/YL1 ZWIYkjPdueyHUN8DZib+iqraNPPdT7LRo0FO/8UpNYZQt/oLfMR8QaCuvf3UjPB9aAYJR68j3 X+4SYL3HHDdIu7pg6oAKmO38aoQYwHORGKCI9uEc/0E+ewzWlWy+iGhasTE8pF3v8S6jpN+ES /2syBTpj9fJjCSPj5HfR8zME+4ga3EAVv9pnAYAvkpIwIpzXRxdH5eoBrl0= X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 35137 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------57ACEB4F94A09935F5EFFF75 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit On 4/4/19 9:52 AM, Zbigniew Jędrzejewski-Szmek wrote: > See https://github.com/systemd/systemd/issues/12018 and > https://github.com/karelzak/util-linux/issues/780 for additional context. > > $ mkdir "$(echo -e foo\\rbar)" > $ sudo mount -t tmpfs tmpfs foo^Mbar/ > $ cat -v /proc/self/mountinfo|grep foo > 865 39 0:59 / /tmp/foo^Mbar rw,relatime shared:462 - tmpfs tmpfs rw,seclabel > $ df -h | grep foo > $ df -h /tmp/foo$'\r'bar > Filesystem Size Used Avail Use% Mounted on > - 3.9G 0 3.9G 0% /tmp/foo?bar > > When asked to show all filesystems, the mount point is not shown at all. > When asked to show just that one, df parses the mount point correctly, > but it gets the filesystem type wrong. Thanks for the report. I see the issue is not yet solved in util-linux as well. For coreutils, the fix is in gnulib. Parsing the line is starting to get ugly ... dirty patch attached. This also caters for the issue that df(1) totally skips a file system if the source is an empty string which is allowed for e.g. tmpfs: $ mount -t tmpfs '' /mnt $ df -h | grep mnt At least util-linux' findmnt has already worked around that case, see https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/commit/?id=18a52a5094f8 Finally, other users of gnulib/lib/mountlist.c are also affected. Have a nice day, Berny --------------57ACEB4F94A09935F5EFFF75 Content-Type: text/x-patch; name="mountlist.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="mountlist.diff" diff --git a/lib/mountlist.c b/lib/mountlist.c index 9b54a2cf7..75a195ea1 100644 --- a/lib/mountlist.c +++ b/lib/mountlist.c @@ -456,7 +456,7 @@ read_file_system_list (bool need_fs_type) int target_s, target_e, type_s, type_e; int source_s, source_e, mntroot_s, mntroot_e; char test; - char *dash; + char *dash, *source; int rc; rc = sscanf(line, "%*u " /* id - discarded */ @@ -470,6 +470,12 @@ read_file_system_list (bool need_fs_type) &target_s, &target_e, &test); + /* Cater for unusual target names where %*s stopped too early, + e.g. "mount -t tmpfs tmpfs foo$'\r'bar". */ + if (test != ' ') + while (*(line + target_e) && *(line + target_e) != ' ') + target_e++; + if (rc != 3 && rc != 7) /* 7 if %n included in count. */ continue; @@ -480,26 +486,42 @@ read_file_system_list (bool need_fs_type) rc = sscanf(dash, " - " "%n%*s%n " /* FS type, start and end */ - "%n%*s%n " /* source, start and end */ "%c", /* more data... */ &type_s, &type_e, - &source_s, &source_e, &test); - if (rc != 1 && rc != 5) /* 5 if %n included in count. */ + if (rc != 1 && rc != 3) /* 3 if %n included in count. */ continue; + source = dash + type_e + 1; + if (*source == ' ') + { + /* The source is an empty string, which is e.g. allowed for + tmpfs: "mount -t tmpfs '' /mnt". */ + source_e = 0; + } + else + { + rc = sscanf(source, " " + "%n%*s%n " /* source, start and end */ + "%c", /* more data... */ + &source_s, &source_e, + &test); + if (rc != 1 && rc != 3) /* 3 if %n included in count. */ + continue; + } + /* manipulate the sub-strings in place. */ line[mntroot_e] = '\0'; line[target_e] = '\0'; dash[type_e] = '\0'; - dash[source_e] = '\0'; + source[source_e] = '\0'; unescape_tab (dash + source_s); unescape_tab (line + target_s); unescape_tab (line + mntroot_s); me = xmalloc (sizeof *me); - me->me_devname = xstrdup (dash + source_s); + me->me_devname = xstrdup (source); me->me_mountdir = xstrdup (line + target_s); me->me_mntroot = xstrdup (line + mntroot_s); me->me_type = xstrdup (dash + type_s); --------------57ACEB4F94A09935F5EFFF75--
bug-coreutils@HIDDEN
:bug#35137
; Package coreutils
.
Full text available.Received: (at submit) by debbugs.gnu.org; 4 Apr 2019 07:53:46 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 04 03:53:46 2019 Received: from localhost ([127.0.0.1]:43642 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hBxBy-0006Ir-5z for submit <at> debbugs.gnu.org; Thu, 04 Apr 2019 03:53:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33590) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <zbyszek@HIDDEN>) id 1hBxBw-0006If-K6 for submit <at> debbugs.gnu.org; Thu, 04 Apr 2019 03:53:45 -0400 Received: from lists.gnu.org ([209.51.188.17]:35744) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <zbyszek@HIDDEN>) id 1hBxBr-00074p-3b for submit <at> debbugs.gnu.org; Thu, 04 Apr 2019 03:53:39 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <zbyszek@HIDDEN>) id 1hBxBq-0002pi-2t for bug-coreutils@HIDDEN; Thu, 04 Apr 2019 03:53:38 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,RCVD_IN_DNSWL_NONE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <zbyszek@HIDDEN>) id 1hBxBp-00072W-56 for bug-coreutils@HIDDEN; Thu, 04 Apr 2019 03:53:38 -0400 Received: from kawka.in.waw.pl ([178.62.225.244]:39986) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <zbyszek@HIDDEN>) id 1hBxBo-0006ps-Rb for bug-coreutils@HIDDEN; Thu, 04 Apr 2019 03:53:37 -0400 Received: from zbyszek by kawka.in.waw.pl with local (Exim 4.80) (envelope-from <zbyszek@HIDDEN>) id 1hBxAf-0006WF-MJ for bug-coreutils@HIDDEN; Thu, 04 Apr 2019 07:52:25 +0000 Date: Thu, 4 Apr 2019 07:52:25 +0000 From: Zbigniew =?utf-8?Q?J=C4=99drzejewski-Szmek?= <zbyszek@HIDDEN> To: bug-coreutils@HIDDEN Subject: [df] incorrect parsing of /proc/self/mountinfo with \r in mount path Message-ID: <20190404075225.GH9027@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 178.62.225.244 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) See https://github.com/systemd/systemd/issues/12018 and https://github.com/karelzak/util-linux/issues/780 for additional context. $ mkdir "$(echo -e foo\\rbar)" $ sudo mount -t tmpfs tmpfs foo^Mbar/ $ cat -v /proc/self/mountinfo|grep foo 865 39 0:59 / /tmp/foo^Mbar rw,relatime shared:462 - tmpfs tmpfs rw,seclabel $ df -h | grep foo $ df -h /tmp/foo$'\r'bar Filesystem Size Used Avail Use% Mounted on - 3.9G 0 3.9G 0% /tmp/foo?bar When asked to show all filesystems, the mount point is not shown at all. When asked to show just that one, df parses the mount point correctly, but it gets the filesystem type wrong. Zbyszek
Zbigniew Jędrzejewski-Szmek <zbyszek@HIDDEN>
:bug-coreutils@HIDDEN
.
Full text available.bug-coreutils@HIDDEN
:bug#35137
; Package coreutils
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.