Skip to content

Invalid/incoherent behaviours with the global auth_user option #391

Closed

Description

@pinaraf

Hello

When the global auth_user option was introduced in commit 4ea2306, it seems a lot of cases were not handled properly.

  1. The option works only if it is defined before the databases
  2. If the option is defined twice (for instance if it is defined in the main file and later in an included file), the value used will be the last one preceding the databases definitions, but the value displayed in show config will be the second one
  3. When calling SET auth_user = marcel, the newly-set value is not applied unless you reload and did not define it in your configuration before the databases
  4. If you change the option in the configuration and issue a RELOAD, the value applied will, again, depend on the location in the configuration file : if it is after the databases, a second RELOAD will be required to apply the change.

I suggest completely removing the current application of the config auth_user in parse_database in loader.c, and instead, in each code path that tries to use db->auth_user, add a second if branch to use the cf_auth_user instead. If these changes would be fine for you, I can implement them and submit a PR.

Regards

Activity

  1. added a commit that references this issue on Oct 14, 2020
    898d714
  2. added a commit that references this issue on Apr 25, 2024
    383af56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething is broken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions