Ensure no one but us writes to stdout
ClosedPublic

Authored by broulik on Jun 20 2019, 3:57 PM.

Details

Summary

I originally didn't consider this neccessary because we have a qMessageHandler, so every qDebug goes through the proper formatting. However, if an external application is launched, it might blatantly print to stdout.

Test Plan
  • Triggered Purpose menu from a website, chose "send via email" which triggered Thunderbird and then quit Thunderbird. Previously the host was killed by printing
*** UTM:SVC TimerManager:registerTimer called after profile-before-change notification. Ignoring timer registration for id: telemetry_modules_ping

on stdout. Now the host continues to run smoothly. Everything else is unaffected

Diff Detail

Repository
R856 Plasma Browser Integration
Lint
Lint Skipped
Unit
Unit Tests Skipped
broulik created this revision.Jun 20 2019, 3:57 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJun 20 2019, 3:57 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Jun 20 2019, 3:57 PM
fvogt requested changes to this revision.Jun 20 2019, 5:01 PM
fvogt added inline comments.
host/connection.cpp
39

I'd dup2(STDERR_FILENO, STDOUT_FILENO); instead to ensure that if something tries to write to it or query something, there aren't unexpected errors.

This revision now requires changes to proceed.Jun 20 2019, 5:01 PM
fvogt accepted this revision.Jun 21 2019, 5:03 PM
This revision is now accepted and ready to land.Jun 21 2019, 5:03 PM
This revision was automatically updated to reflect the committed changes.