Skip to content

Pawn: report missing legacy plugin file instead of misreporting it as a component - #1275

Open
berkleblebiciii wants to merge 1 commit into
openmultiplayer:masterfrom
berkleblebiciii:fix/1272-legacy-plugin-missing-file-error
Open

berkleblebiciii wants to merge 1 commit into
openmultiplayer:masterfrom
berkleblebiciii:fix/1272-legacy-plugin-missing-file-error

Conversation

@berkleblebiciii

Copy link
Copy Markdown

Description

If a legacy plugin listed in pawn.legacy_plugins does not exist in plugins/, the Linux server currently prints:

[Info] Loading plugin: streamer
[Info] This file is an open.mp component. Please move it to components/ folder.

which is misleading - the file is not an open.mp component, it simply does not exist. Windows correctly reports the missing file, so the two platforms behave differently.

Root cause

Spawn() discarded Canonicalise()'s return value and handed its output to the loader. On Linux Canonicalise() uses realpath(), which fails for a missing file and left the result empty, so dlopen("") ran - that resolves to the main program's handle, and dlsym("ComponentEntryPoint") on it matched the server's own exported $CAPI symbol, producing the component message. Windows was unaffected because PathCanonicalizeA() is purely lexical, so LoadLibraryA still ran and reported the OS error.

Fix

Check Canonicalise()'s return value in PawnPluginManager::Spawn() and, when it fails, print a file-not-found message and return before constructing the PawnPlugin.

After the fix, Linux prints:

[Info] Loading plugin: streamer
[Info] Unable to load plugin; file not found: streamer

Windows behaviour is unchanged: Canonicalise() still succeeds lexically, so the OS loader error is reported as before.

Fixes #1272

… a component

`Spawn()` discarded `Canonicalise()`'s return value.  On Linux
`Canonicalise()` uses `realpath()`, which fails for a missing file and
left the result empty, so `dlopen("")` ran.  That resolves to the main
program's handle, and `dlsym("ComponentEntryPoint")` on it matched the
exported symbol, producing the misleading "This file is an open.mp
component" message.  Check the return value and report that the plugin
file could not be found instead.

Fixes openmultiplayer#1272
@NexiusTailer

NexiusTailer commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

There's already this. Why making the same PRs for the already suggested solutions?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing legacy plugin on Linux reports "This file is an open.mp component" instead of a missing-file error

2 participants