From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=HTML_MESSAGE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 402 invoked from network); 16 Aug 2020 09:31:47 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 16 Aug 2020 09:31:47 -0000 Received: (qmail 30393 invoked by uid 550); 16 Aug 2020 09:31:44 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 30343 invoked from network); 16 Aug 2020 09:31:44 -0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CHPLSaWDZMFaxpOmTVtlw5ULo+27yvq3GrcgB/1eZT0De3nHp8CdRBrACos+Q6nz31dqIw0VF88B5pFR1BATwZ24EpFN9xT5yGjEUbK9wUtQREOB9cCiwDfUFiFd6mOnSBtxGdUuqy6qRZAtmIP2ZgkSFX20PgAbCRP2MKRS2ZOeiI+wYqzjTwPi3VaDpWn3/fzdqOmDFKf95c/Mj9Vlf+jnon8thXtjJGgvQ8ErjWIdpM0ekiHnTqyObxysACiJbYj8HwXhsPycF3MPpH/TjqIj1xTCixUf8BRbNOXEOlC/IU7UIM9gdfGLw14EbcIUTvqpFamK3SumCyuCTc4tJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=quuss5o+Ea0pzOMqUcq5iqkv043NS9kk7MN0x0USk4c=; b=ffZXh0CHouVV3nIatsY5tNl57GzlLlZy9vfoAQCdDmB6Wl5aSwG0ZCMXmOqZcHbPtPResKJygvDlchMTdudvCLiGnNYBgnoTyJFkLAcv7IN4kji5jhNFvnSxKzhyOoH9+ZwtZtg/8Z+cY5fnrDe8yEaM4zBipneQFjmfaoi9/CJ60J1d0fZ3fdRy5uPaVhFuAygT0zCfVQjJkN+Hujy2QGglxblgXZA82G8Sk7x6tNpcS6uXHfpO1AZ3nyXKlKGLrm8xWksQ03U8iz2H2Z1ABS9kPKozpTSPbAa4Kso9lOBv47RWcDg0SzD2lGr53iAwtPGhMvmQ+kLfTHZP1BrsdQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none From: "maksis ." To: "musl@lists.openwall.com " Thread-Topic: getmntent and unescaping special characters Thread-Index: AQHWc65SxitqZ19gIkqjucZ7qJY6Bw== Date: Sun, 16 Aug 2020 09:31:32 +0000 Message-ID: Accept-Language: en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:30014A9A002CCDCB1E3FCD5ACB1A2F2C7A863B57F9ADB3AB33B9D24B43E504D5;UpperCasedChecksum:91079BD26F6FAD15E43CC351A751582F8CE10C82C86B0DD7BC6F580B2746144C;SizeAsReceived:6675;Count:41 x-tmn: [tKfwVuo27+Mq7UBY0RRZfC0usF5yDuOr] x-ms-publictraffictype: Email x-incomingheadercount: 41 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: 4d033468-c665-4de2-b174-08d841c72959 x-ms-traffictypediagnostic: VI1EUR06HT188: x-microsoft-antispam: BCL:0; x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:HE1P192MB0010.EURP192.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:;DIR:OUT;SFP:1901; x-ms-exchange-transport-forked: True Content-Type: multipart/alternative; boundary="_000_HE1P192MB0010D60AAC4BA0F08F1A5644FB5E0HE1P192MB0010EURP_" MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-AuthSource: VI1EUR06FT028.eop-eur06.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 4d033468-c665-4de2-b174-08d841c72959 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Aug 2020 09:31:32.0346 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1EUR06HT188 Subject: [musl] getmntent and unescaping special characters --_000_HE1P192MB0010D60AAC4BA0F08F1A5644FB5E0HE1P192MB0010EURP_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, Looks like getmntent doesn't unescape certain special characters (such as w= hitespaces) in mount paths, which causes my application to behave incorrect= ly with such paths (and assumably there are also other applications that ar= e expecting the standard behavior). >From https://man7.org/linux/man-pages/man3/getmntent.3.html: Since fields in the mtab and fstab files are separated by whitespace= , octal escapes are used to represent the characters space (\040), tab (\011), newline (\012), and backslash (\\) in those files when they occur in one of the four strings in a mntent structure. The routine= s addmntent() and getmntent() will convert from string representation to escaped representation and back. When converting from escaped representation, the sequence \134 is also converted to a backslash. Is that something that could also be implemented in musl? --_000_HE1P192MB0010D60AAC4BA0F08F1A5644FB5E0HE1P192MB0010EURP_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi,

 

Looks like getmntent doesn't unescape certain specia= l characters (such as whitespaces) in mount paths, which causes my applicat= ion to behave incorrectly with such paths (and assumably there are also oth= er applications that are expecting the standard behavior).

 

From https://man7.org/linux/man-pages/man3/getmntent.3.html:

 

       Since fields in= the mtab and fstab files are separated by whitespace,

       octal escapes a= re used to represent the characters space (\040), tab

       (\011), newline= (\012), and backslash (\\) in those files when they

       occur in one of= the four strings in a mntent structure.  The routines

       addmntent() and= getmntent() will convert from string representation

       to escaped repr= esentation and back.  When converting from escaped

       representation,= the sequence \134 is also converted to a backslash.

 

Is that something that could also be implemented in = musl?

--_000_HE1P192MB0010D60AAC4BA0F08F1A5644FB5E0HE1P192MB0010EURP_--