Skip to content

PyGhidra modifies locked project #7536

Open
@matthewpruett

Description

Describe the bug
pyghidra.open_program does not raise an exception when a locked project is specified, which causes a file save error if an open Ghidra GUI attempts to save a file in the locked project.

To Reproduce
Steps to reproduce the behavior:

  1. Open a project in the GUI (at this point a .lock file will be created)
  2. Open a program in the code browser
  3. Make a change such as setting a background color
  4. In a separate Python terminal, run pyghidra.open_program with the name of the program opened in the code browser, the path to the project, and the name of the project. (at this point the lock file will be removed)
  5. Save changes in the GUI

Expected behavior
PyGhidra should raise an exception when attempting to open an existing project that is locked

Environment (please complete the following information):

  • OS: Ubuntu 20.04.6
  • Java Version: 21.0.6
  • Ghidra Version: 11.3.1
  • Ghidra Origin: official GitHub distro

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions