Bug 102388

Summary: Please use fd 2 instead of /dev/stderr
Product: plymouth Reporter: Laurent Bigonville <bigon>
Component: generalAssignee: Ray Strode [halfline] <rstrode>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: rstrode
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: 0002-stderr.patch
0001-scripts-Use-fd-for-stdout-instead-of-device-since-th.patch

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.