Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-4021

mysql lets me login even if i press CTRL-C

Details

    • Bug
    • Status: Closed (View Workflow)
    • Trivial
    • Resolution: Fixed
    • 10.0.0, 5.5.28a, 5.3.11
    • 5.5.30
    • None
    • 5.5, windows xp

    Description

      1) I invoke mysql with an ampty -p parameter
      2) I write the password, but I DONT press enter
      3) I press ctrl-c
      4) I'm logged in, as if I pressed enter

      This does not happen always - it depends how I invoke mysql. However, using the default Icon in the Win's start menu, this happens.

      Example:

      C:\Programmi\MariaDB 5.5\bin>mysql "--defaults-file=C:\Programmi\MariaDB 5.5\dat
      a\my.ini" -uroot -p
      Enter password: *****
      Welcome to the MariaDB monitor. Commands end with ; or \g.
      Your MariaDB connection id is 7
      Server version: 5.5.25-MariaDB mariadb.org binary distribution

      This software comes with ABSOLUTELY NO WARRANTY. This is free software,
      and you are welcome to modify and redistribute it under the GPL v2 license

      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

      MariaDB [(none)]>

      Attachments

        Activity

          Hi Sergei,

          While the described problem doesn't sound like a big deal, I just found out that I don't know any way out of the "Enter password" line once I pressed enter in mysql ... -p command line – neither on Windows nor on Linux. On Windows Ctrl-C works like 'Enter' (as Federico described), on Linux it's simply ignored; all the same, to quit it you have to send a request to the server which might be not what you want. So, before sending this report as a Windows oddity to Wlad, I wanted to check whether you have any comments or opinion on the matter.

          (note: probably affects previous versions too, but I didn't check 5.1 or 5.2).

          elenst Elena Stepanova added a comment - Hi Sergei, While the described problem doesn't sound like a big deal, I just found out that I don't know any way out of the "Enter password" line once I pressed enter in mysql ... -p command line – neither on Windows nor on Linux. On Windows Ctrl-C works like 'Enter' (as Federico described), on Linux it's simply ignored; all the same, to quit it you have to send a request to the server which might be not what you want. So, before sending this report as a Windows oddity to Wlad, I wanted to check whether you have any comments or opinion on the matter. (note: probably affects previous versions too, but I didn't check 5.1 or 5.2).

          On Linux we cannot do much. That's how getpass() behaves. Quoting "man getpass"
          "
          While reading the password, signal generation (SIGINT, SIGQUIT, SIGSTOP, SIGTSTP) is disabled and the corresponding characters (usually control-C, control-\, control-Z and control-Y) are transmitted as part of the password
          "
          While we can implement our own password-reading function, I think we should stick to the behavior, standard on this platform.

          On Windows, on the other hand, we have our own password-reading function, and we can treat Ctrl-C specially.

          serg Sergei Golubchik added a comment - On Linux we cannot do much. That's how getpass() behaves. Quoting "man getpass" " While reading the password, signal generation (SIGINT, SIGQUIT, SIGSTOP, SIGTSTP) is disabled and the corresponding characters (usually control-C, control-\, control-Z and control-Y) are transmitted as part of the password " While we can implement our own password-reading function, I think we should stick to the behavior, standard on this platform. On Windows, on the other hand, we have our own password-reading function, and we can treat Ctrl-C specially.

          I suppose if it's easy it would make sense to fix it (with the given priority) – let at least Windows users off the hook.

          elenst Elena Stepanova added a comment - I suppose if it's easy it would make sense to fix it (with the given priority) – let at least Windows users off the hook.

          People

            wlad Vladislav Vaintroub
            f_razzoli Federico Razzoli
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.