nvda
b4c8693c - Propagate CLI arguments when updating (#16937)

Commit
2 years ago
Propagate CLI arguments when updating (#16937) Summary of the issue: When updating NVDA, command line arguments are not passed from the running copy to the temporary copy. This may have security implications for arguments such as -c or --disable-addons. Description of user facing changes The -c/--config-path and --disable-addons arguments are now propagated to the temporary copy of NVDA when an update is started from within NVDA. Description of development approach Refactored updateCheck._executeUpdate to use a helper function to generate the parameters to call the launcher with. In addition to the parameters that were already passed, the following parameters are now passed: If globalVars.appArgs.disableAddons is True, the --disable-addons flag is passed. The --config-path argument is passed with the current configuration directory. We do not directly pass the path that NVDA was called with because: If -c wasn't specified at the CLI, it will be the default config path, which is what NVDA would have defaulted to anyway. If it was specified at the CLI, it will be what was specified there, as the only change we make to it is to absolutise it. Sniffing sys.argv to find -c or --config-path adds a performance overhead (and code complexity) for no benefit, because anyone fiddling around to change globalVars.appArgs.configPath or NVDAState.WritePaths.ConfigDir can change sys.argv too.
Author
Parents
Loading