From: David Laight <David.Laight-ZS65k/vG3HxXrIkS9f7CXA@public.gmane.org>
To: 'Joe Perches' <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>,
Denis Efremov <efremov-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>,
LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Greg Kroah-Hartman
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
"Rafael J. Wysocki"
<rafael-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Kees Cook <keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
"Gustavo A . R . Silva"
<gustavoars-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Julia Lawall <julia.lawall-MZpvjPyXg2s@public.gmane.org>,
Alex Dewar <alex.dewar90-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: York Sun <york.sun-3arQi8VN3Tc@public.gmane.org>,
Borislav Petkov <bp-Gina5bIWoIWzQB+pC5nmwQ@public.gmane.org>,
Mauro Carvalho Chehab
<mchehab-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Tony Luck <tony.luck-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
James Morse <james.morse-5wv7dgnIgG8@public.gmane.org>,
Robert Richter <rric-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Michal Simek
<michal.simek-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>,
Boris Brezillon
<bbrezillon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Maxim Levitsky
<maximlevitsky-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Alex Dubov <oakad-/E1597aS9LQAvxtiuMwx3w@public.gmane.org>,
Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Tomas Winkler
<tomas.winkler-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
Madalin Bucur <madalin.bucur-3arQi8VN3Tc@public.gmane.org>,
"David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
Jakub Kicinski <kuba-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Douglas Miller <dougmill-tEXmvtCZX7AybS5Ee8rs3A@public.gmane.org>,
Stanislav Yakovlev
<stas.yakovlev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Kalle Valo <kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
Darren Hart <dvhart-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
Subject: RE: sysfs output without newlines
Date: Tue, 1 Sep 2020 09:07:42 +0000 [thread overview]
Message-ID: <5f0b48e0291b4b54bc1caeb8b5715c65@AcuMS.aculab.com> (raw)
In-Reply-To: <b64a4cb0ee68fee01973616e5ef0f299ac191f6d.camel-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
From: Joe Perches
> Sent: 29 August 2020 21:34
...
> > On 8/29/20 9:23 PM, Joe Perches wrote:
> > > While doing an investigation for a possible treewide conversion of
> > > sysfs output using sprintf/snprintf/scnprintf, I discovered
> > > several instances of sysfs output without terminating newlines.
> > >
> > > It seems likely all of these should have newline terminations
> > > or have the \n\r termination changed to a single newline.
> >
> > I think that it could break badly written scripts in rare cases.
>
> Maybe.
>
> Is sysfs output a nominally unchangeable api like seq_?
> Dunno. seq_ output is extended all the time.
>
> I think whitespace isn't generally considered part of
> sscanf type input content awareness.
The shell will remove trailing '\n' (but not '\r') from:
foo=$(cat bar)
So shell scripts are unlikely to be affected.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2020-09-01 9:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-29 18:23 sysfs output without newlines Joe Perches
[not found] ` <0f837bfb394ac632241eaac3e349b2ba806bce09.camel-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
2020-08-29 20:23 ` Denis Efremov
2020-08-29 20:33 ` Joe Perches
[not found] ` <b64a4cb0ee68fee01973616e5ef0f299ac191f6d.camel-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
2020-09-01 9:07 ` David Laight [this message]
2020-09-01 22:22 ` Pete Zaitcev
2020-09-02 7:57 ` Andy Shevchenko
2020-08-30 9:11 ` Greg Kroah-Hartman
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=5f0b48e0291b4b54bc1caeb8b5715c65@AcuMS.aculab.com \
--to=david.laight-zs65k/vg3hxxriks9f7cxa@public.gmane.org \
--cc=alex.dewar90-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=bbrezillon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=bp-Gina5bIWoIWzQB+pC5nmwQ@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=dougmill-tEXmvtCZX7AybS5Ee8rs3A@public.gmane.org \
--cc=dvhart-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=efremov-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=gustavoars-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=james.morse-5wv7dgnIgG8@public.gmane.org \
--cc=joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org \
--cc=julia.lawall-MZpvjPyXg2s@public.gmane.org \
--cc=keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=kuba-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=madalin.bucur-3arQi8VN3Tc@public.gmane.org \
--cc=maximlevitsky-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=mchehab-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=michal.simek-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org \
--cc=oakad-/E1597aS9LQAvxtiuMwx3w@public.gmane.org \
--cc=rafael-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=rric-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=stas.yakovlev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=tomas.winkler-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=tony.luck-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=york.sun-3arQi8VN3Tc@public.gmane.org \
/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