Skip to content

Unable to audit the database if database password contains a bracket #4927

@bmfmancini

Description

@bmfmancini

When running the audit_database.php script the script will appear to run however the MySQL commands actually fails and the audit schema does not load

tested on other installs it works just fine but if there is a } in the cacti password it fails
If I remove

-p from the below block and enter the db password when prompted it works just fine
when I test the login at the cli I need to wrap the password in single quotes

                if (file_exists($config['base_path'] . '/docs/audit_schema.sql')) {
                        exec('mysql' .
                                ' -u' . $database_username .
                                ' -p' . $database_password .
                                ' -h' . $database_hostname .
                                ' -P' . $database_port .
                                ' ' . $database_default .
                                ' < ' . $config['base_path'] . '/docs/audit_schema.sql', $output, $

sh: -c: line 0: syntax error near unexpected token )' sh: -c: line 0: mysql -ucacti -p -hlocalhost -P3306 cacti < /var/www/html/cacti/docs/audit_schema.sql'
FATAL: Failed Load the Audit Schema

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUndesired behaviourconfirmedBug is confirm by dev teamresolvedA fixed issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions