Closed Bug 1853920 Opened 1 year ago Closed 1 year ago

Launcher fails to properly quote empty command arguments

Categories

(Firefox :: Launcher Process, defect, P3)

defect

Tracking

()

RESOLVED FIXED
121 Branch
Tracking Status
firefox121 --- fixed

People

(Reporter: saschanaz, Assigned: rkraesig)

References

Details

Attachments

(2 files)

Running firefox.exe --backgroundtask removeDirectory C:\Users\sasch\AppData\Local\Temp\firefox\xpcshellprofile "" "10", ".abc" somehow loses the argument "". Running this command opens two processes with different command line arguments in serial:

  1. "C:\Users\sasch\Documents\GitHub\gecko-dev\obj-x86_64-pc-windows-msvc\dist\bin\firefox.exe" --backgroundtask removeDirectory C:\Users\sasch\AppData\Local\Temp\firefox\xpcshellprofile "" 100 .abc
  2. C:\Users\sasch\Documents\GitHub\gecko-dev\obj-x86_64-pc-windows-msvc\dist\bin\firefox.exe --backgroundtask removeDirectory C:\Users\sasch\AppData\Local\Temp\firefox\xpcshellprofile 100 .abc (double spaces between the path and 100, somehow bugzilla ignores it)

This is not specific to background tasks, omitting --backgroundtask also does the same, although in that case the first process soon disappears and the one without the quote remains.

See Also: → 1853921
Severity: -- → S3
Priority: -- → P3

internal::ArgStrLen and internal::ArgToString must behave
identically. Merge them into a common implementation function to ensure
this.

Additionally, use size_t rather than int as an intermediate data
type where appropriate.

No functional changes.

Assignee: nobody → rkraesig
Status: NEW → ASSIGNED

Quote empty arguments in command lines. Add appropriate tests.

Depends on D191127

Pushed by rkraesig@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f07dd94abdef [1/2] cleanup: merge function implementations r=win-reviewers,mhowell https://hg.mozilla.org/integration/autoland/rev/dda67fb9ec0f [2/2] quote empty strings in Windows command lines r=win-reviewers,gstoll
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 121 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: