Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • TortoiseGit TortoiseGit
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 380
    • Issues 380
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 16
    • Merge requests 16
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • TortoiseGitTortoiseGit
  • TortoiseGitTortoiseGit
  • Issues
  • #3413
Closed
Open
Issue created Jul 29, 2019 by Matt Bigelow@bigelowms

Putty Agent (pageant) unable to start when file "C:\Program" exists

What steps will reproduce the problem?

  1. Create a file in C:\ (or whatever drive the Program Files folder is located) named Program (no extension)
  2. Attempt to do anything with TortoiseGit that involves the Putty Agent (pageant)

What is the expected output? What do you see instead?

It is expected that pageant is launched and the operation requiring it continues normally. Instead a message box appears that says "Could not start the Putty Agent (pageant)." and when cleared, user is prompted for credentials (if pageant wasn't run previously).

What version of TortoiseGit and Git are you using? On what operating system?

TortoiseGit 2.8.0.0

Windows 10.0.17134 (x64)

Please provide any additional information below.

This issue is believed to be caused by the fact that double-quotes do not surround the full path to pageant.exe in CAppUtils::LaunchPAgent. Since TortoiseGit is typically installed in C:\Program Files, the call to LaunchApplication, and later CreateProcess, first looks for an executable called "C:\Program", fails, and then eventually finds pageant.exe in the TortoiseGit folder in the Program Files folder. From the documentation on CreateProcess (https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessa):

The lpApplicationName parameter can be NULL. In that case, the module name must be the first white space–delimited token in the lpCommandLine string. If you are using a long file name that contains a space, use quoted strings to indicate where the file name ends and the arguments begin; otherwise, the file name is ambiguous. For example, consider the string "c:\program files\sub dir\program name". This string can be interpreted in a number of ways. The system tries to interpret the possibilities in the following order:

c:\program.exe c:\program files\sub.exe c:\program files\sub dir\program.exe c:\program files\sub dir\program name.exe

Note that there may be additional instances of this issue throughout the TortoiseGit code.

Edited Jul 30, 2019 by Yue Lin Ho
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking