Bug 102388 - Please use fd 2 instead of /dev/stderr
Summary: Please use fd 2 instead of /dev/stderr
Status: RESOLVED FIXED
Alias: None
Product: plymouth
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Ray Strode [halfline]
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-24 14:22 UTC by Laurent Bigonville
Modified: 2017-08-25 21:48 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
0002-stderr.patch (5.46 KB, patch)
2017-08-24 14:22 UTC, Laurent Bigonville
Details | Splinter Review
0001-scripts-Use-fd-for-stdout-instead-of-device-since-th.patch (6.15 KB, patch)
2017-08-24 15:14 UTC, Laurent Bigonville
Details | Splinter Review

Description Laurent Bigonville 2017-08-24 14:22:46 UTC
Created attachment 133748 [details] [review]
0002-stderr.patch

Hi,

Are there any reasons why plymouth-populate-initrd and plymouth-set-default-theme are using "/dev/stderr" to redirect to stderr instead of >&2 ?

Apparently that can cause some issues to some person trying to run these scripts in a chroot, see: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=581649

In debian we have the attached patch for quite some times already
Comment 1 Ray Strode [halfline] 2017-08-24 14:56:55 UTC
sure, can you attach it as a git format-patch formatted patch though?
Comment 2 Laurent Bigonville 2017-08-24 15:14:13 UTC
Created attachment 133753 [details] [review]
0001-scripts-Use-fd-for-stdout-instead-of-device-since-th.patch
Comment 3 Ray Strode [halfline] 2017-08-24 15:44:02 UTC
Thanks pushed with a minor fix to the usage function

To ssh://git.freedesktop.org/git/plymouth
   e12b5ee..f942597  master -> master
Comment 4 Laurent Bigonville 2017-08-24 15:57:11 UTC
Shouldn't

-    local output="/proc/self/fd/1"
+    local output="/dev/stdout"


Be

-    local output="/proc/self/fd/1"
+    local output=">&1"


?
Comment 5 Ray Strode [halfline] 2017-08-25 21:48:07 UTC
no, i don't think so.  the line that follows does

echo "usage: plymouth [ --verbose | -v ] { --targetdir | -t } <initrd_directory>" > $output

so that would put usage information in a file named '>&1'


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.