From: David Laight <David.Laight@ACULAB.COM>
To: 'Kalesh Singh' <kaleshsingh@google.com>,
Stephen Brennan <stephen.s.brennan@oracle.com>
Cc: "Ioannis Ilkos" <ilkos@google.com>,
"T.J. Mercier" <tjmercier@google.com>,
"Suren Baghdasaryan" <surenb@google.com>,
"Cc: Android Kernel" <kernel-team@android.com>,
"Jonathan Corbet" <corbet@lwn.net>,
"Sumit Semwal" <sumit.semwal@linaro.org>,
"Christian König" <christian.koenig@amd.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
"David Hildenbrand" <david@redhat.com>,
"Christoph Anton Mitterer" <mail@christoph.anton.mitterer.name>,
"Johannes Weiner" <hannes@cmpxchg.org>,
"Colin Cross" <ccross@google.com>,
"Mike Rapoport" <rppt@kernel.org>,
"Paul Gortmaker" <paul.gortmaker@windriver.com>,
"Randy Dunlap" <rdunlap@infradead.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
"Linux Media Mailing List" <linux-media@vger.kernel.org>,
"DRI mailing list" <dri-devel@lists.freedesktop.org>,
"moderated list:DMA BUFFER SHARING FRAMEWORK"
<linaro-mm-sig@lists.linaro.org>
Subject: RE: [PATCH 2/2] procfs: Add 'path' to /proc/<pid>/fdinfo/
Date: Wed, 1 Jun 2022 15:40:31 +0000 [thread overview]
Message-ID: <959b0495a90e45b9816bb9f25d76a8f9@AcuMS.aculab.com> (raw)
In-Reply-To: <CAC_TJveDzDaYQKmuLSkGWpnuCW+gvrqdVJqq=wbzoTRjw4OoFw@mail.gmail.com>
From: Kalesh Singh
> Sent: 31 May 2022 23:30
...
> > File paths can contain fun characters like newlines or colons, which
> > could make parsing out filenames in this text file... fun. How would your
> > userspace parsing logic handle "/home/stephen/filename\nsize:\t4096"? The
> > readlink(2) API makes that easy already.
>
> I think since we have escaped the "\n" (seq_file_path(m, file, "\n")),
> then user space might parse this line like:
>
> if (strncmp(line, "path:\t", 6) == 0)
> char* path = line + 6;
The real annoyance is other things doing scans of the filesystem
that accidentally 'bump into' strange names.
While anything serious probably gets it right how many times
Do you run 'find' to quickly search for something?
Spaces in filenames (popularised by some other os) are a PITA.
Not to mention leading and trailing spaces!
Anyone using filenames that only contain spaces does need shooting.
Deliberately adding non-printables isn't really a good idea.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
prev parent reply other threads:[~2022-06-01 15:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-31 21:25 [PATCH 0/2] procfs: Add file path and size to /proc/<pid>/fdinfo Kalesh Singh
2022-05-31 21:25 ` [PATCH 1/2] procfs: Add 'size' to /proc/<pid>/fdinfo/ Kalesh Singh
2022-06-01 13:55 ` Christian König
2022-06-01 14:58 ` Kalesh Singh
2022-05-31 21:25 ` [PATCH 2/2] procfs: Add 'path' " Kalesh Singh
2022-05-31 22:07 ` Stephen Brennan
2022-05-31 22:30 ` Kalesh Singh
2022-05-31 22:48 ` Stephen Brennan
2022-06-01 15:02 ` [Linaro-mm-sig] " Christian König
2022-06-02 3:31 ` Kalesh Singh
2022-06-15 17:00 ` Kalesh Singh
2022-06-21 16:45 ` Kalesh Singh
2022-06-01 15:40 ` David Laight [this message]
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=959b0495a90e45b9816bb9f25d76a8f9@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=akpm@linux-foundation.org \
--cc=ccross@google.com \
--cc=christian.koenig@amd.com \
--cc=corbet@lwn.net \
--cc=david@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=hannes@cmpxchg.org \
--cc=ilkos@google.com \
--cc=kaleshsingh@google.com \
--cc=kernel-team@android.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mail@christoph.anton.mitterer.name \
--cc=paul.gortmaker@windriver.com \
--cc=rdunlap@infradead.org \
--cc=rppt@kernel.org \
--cc=stephen.s.brennan@oracle.com \
--cc=sumit.semwal@linaro.org \
--cc=surenb@google.com \
--cc=tjmercier@google.com \
/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;
as well as URLs for NNTP newsgroup(s).