Page MenuHomePhabricator

Fix usage of fprintf() in `bin/drydock command`
ClosedPublic

Authored by epriestley on Mar 28 2018, 11:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 26, 10:10 PM
Unknown Object (File)
Oct 15 2024, 1:44 AM
Unknown Object (File)
Oct 2 2024, 3:41 AM
Unknown Object (File)
Sep 6 2024, 2:55 AM
Unknown Object (File)
Aug 25 2024, 11:54 AM
Unknown Object (File)
Aug 25 2024, 8:32 AM
Unknown Object (File)
Jul 30 2024, 4:50 PM
Unknown Object (File)
Jul 30 2024, 4:49 PM
Subscribers
Restricted Owners Package

Details

Summary

See PHI513. Ref T13114. fprintf() takes (thing, pattern, args, ...) but we aren't passing a pattern, so if the command returns a "%" in the output we get an error.

Test Plan
  • Installed bytes, a great useful program which prints all the bytes, on my HoaxOS(tm) system (see D19102).
epriestley@orbital ~/dev/phabricator $ ./bin/drydock command --lease 76287 -- bytes # Before patch.
[2018-03-29 02:09:08] ERROR 2: fprintf(): Too few arguments at [/Users/epriestley/dev/core/lib/phabricator/src/applications/drydock/management/DrydockManagementCommandWorkflow.php:60]
arcanist(head=experimental, ref.master=b8c9c385a7f5, ref.experimental=925c60e7b837), corgi(head=master, ref.master=6371578c9d32), instances(head=master, ref.master=d983b9517924), ledger(head=master, ref.master=4da4a24b8779), libcore(), phabricator(head=hoax1, ref.master=b586ee065a75, ref.hoax1=f8d7480bbdd1, custom=4), phutil(head=master, ref.master=1ad42491e44a), secure(head=master, ref.master=988cf9bd7958), services(head=master, ref.master=6b3fb8d8dd0a)
  #0 fprintf(resource, string) called at [<phabricator>/src/applications/drydock/management/DrydockManagementCommandWorkflow.php:60]
  #1 DrydockManagementCommandWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:441]
  #2 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:333]
  #3 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/scripts/drydock/drydock_control.php:21]
epriestley@orbital ~/dev/phabricator $ ./bin/drydock command --lease 76287 -- bytes # After patch.
	


!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Owners added a subscriber: Restricted Owners Package.Mar 28 2018, 11:12 PM
This revision was not accepted when it landed; it landed in state Needs Review.Mar 28 2018, 11:20 PM
This revision was automatically updated to reflect the committed changes.