Skip to content

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

Closed

Description

@dockfries

Description

If a legacy plugin listed in config.json (pawn.legacy_plugins) does not exist in
plugins/, the Linux server prints a misleading error telling the user to move the file
to components/, instead of reporting that the file is missing. Windows reports the
missing file correctly, so the two platforms behave differently.

Steps to reproduce

  1. In config.json, list a plugin that is not present:
    "pawn": {
        "legacy_plugins": [ "streamer" ]
    }
  2. Make sure plugins/streamer.so does not exist.
  3. Start the server.

Actual behaviour (Linux)

[2026-09-14T16:31:19+0800] [Info] Loading plugin: streamer
[2026-09-14T16:31:19+0800] [Info] This file is an open.mp component. Please move it to components/ folder.

The second line is wrong: streamer is not an open.mp component, the file simply is not there.

Expected behaviour

A message stating that the plugin file could not be found.

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 $CAPI's exported symbol, producing the
component message. Windows was unaffected because PathCanonicalizeA() is purely lexical,
so LoadLibraryA still ran and reported the OS error.

Commit hash in master

91a3885

Additional context
I've already run one actions, so if anyone needs to test?
https://github.com/dockfries/open.mp/actions/runs/34826417260

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

Metadata

Metadata

Assignees

Labels

bugnightly

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions