lkml.org 
[lkml]   [2022]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] vfs: escape hash as well
On Fri, Jun 17, 2022 at 01:09:09PM +0800, Ian Kent wrote:
> From: Siddhesh Poyarekar <siddhesh@gotplt.org>
>
> When a filesystem is mounted with a name that starts with a #:
>
> # mount '#name' /mnt/bad -t tmpfs
>
> this will cause the entry to look like this (leading space added so
> that git does not strip it out):
>
> #name /mnt/bad tmpfs rw,seclabel,relatime,inode64 0 0
>
> This breaks getmntent and any code that aims to parse fstab as well as
> /proc/mounts with the same logic since they need to strip leading spaces
> or skip over comment lines, due to which they report incorrect output or
> skip over the line respectively.
>
> Solve this by translating the hash character into its octal encoding
> equivalent so that applications can decode the name correctly.
>
> Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
> Signed-off-by: Ian Kent <raven@themaw.net>
> ---

Reviewed-by: Christian Brauner (Microsoft) <brauner@kernel.org>

\
 
 \ /
  Last update: 2022-06-28 15:05    [W:0.048 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site