Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 235416 - app-backup/flexbackup inadvertently writes some normal status to stderr
Summary: app-backup/flexbackup inadvertently writes some normal status to stderr
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor
Assignee: Hans de Graaff
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-22 00:58 UTC by John R. Graham
Modified: 2008-08-27 18:06 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to redirect one specific message from stderr to stdout. (flexbackup-1.2.1-quieten.patch,418 bytes, patch)
2008-08-22 01:01 UTC, John R. Graham
Details | Diff
New ebuild applies the above patch. (flexbackup-1.2.1-r8.ebuild,2.44 KB, text/plain)
2008-08-23 13:15 UTC, John R. Graham
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John R. Graham gentoo-dev 2008-08-22 00:58:23 UTC
This minor bug was reported upstream and seems worthy of inclusion here.  Patch and new ebuild are mine.  Upstream bug text reproduced below.  - JRG

Anyone who uses flexbackup in a cron job surely gets the "syntax OK"
message mailed to them each time the job runs, which is rather annoying
when it runs properly.

The fix is simple: "Syntax OK" is not an error, it's a regular message, and
therefore it belongs in STDOUT and not STDERR.

Thus, this modification:
Line 2418 goes from:
system("perl -c \"$configfile\"");
to:
system("perl -c \"$configfile\" 2>&1");
Comment 1 John R. Graham gentoo-dev 2008-08-22 01:01:02 UTC
Created attachment 163527 [details, diff]
Patch to redirect one specific message from stderr to stdout.
Comment 2 Arthur Hagen 2008-08-22 05:40:02 UTC
Won't this "fix" also direct real errors to stdout?  From what I can tell, it redirects ALL stderr to stdout, which is not a good thing if there ARE errors.

Remember, a missed warning about a backup not running will trigger the need for said backup, as much as forgetting your umbrella will trigger rain.

Perhaps something like:

system("/usr/bin/perl -c \"$configfile\" 2>/dev/null || /usr/bin/perl -c \"$configfile\"");

It's inelegant, as it runs twice when there are problems, but won't incur any penalty as long as everything is OK, yet still report problems.  (Oh, and it's immune to $PATH poisoning too)
Comment 3 John R. Graham gentoo-dev 2008-08-22 13:46:22 UTC
Not in any meaningful way, no.  The only place this redirection affects is a syntax check of the flexbackup.conf configuration file.  In the event of a non-zero return code on the check, flexbackup correctly reports issues on stderr.
Comment 4 John R. Graham gentoo-dev 2008-08-23 13:15:48 UTC
Created attachment 163615 [details]
New ebuild applies the above patch.
Comment 5 Hans de Graaff gentoo-dev Security 2008-08-27 18:06:20 UTC
Fixed in CVS

Thanks for providing the patches, John.