lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 29 Mar 2019 08:15:59 +0000
From:   Changbin Du <changbin.du@...il.com>
To:     Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc:     Changbin Du <changbin.du@...il.com>,
        Sam Ravnborg <sam@...nborg.org>,
        Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] kconfig/[mn]conf: handle backspace (^H) key

On Fri, Mar 29, 2019 at 04:50:18PM +0900, Masahiro Yamada wrote:
> On Tue, Mar 26, 2019 at 12:16 AM Changbin Du <changbin.du@...il.com> wrote:
> >
> > Backspace is not working on some terminal emulators which do not send the
> > key code defined by terminfo. Terminals either send '^H' (8) or '^?' (127).
> > But currently only '$?' is handled.
> 
> 
> 
> Shall I fix '$?' to '^?'
> if it is a typo?
>
yes, please. It is a typo, sorry.

> 
> 
> 
> > Let's also handle '^H' for those
> > terminals.
> >
> > Signed-off-by: Changbin Du <changbin.du@...il.com>
> > ---
> >  scripts/kconfig/lxdialog/inputbox.c | 3 ++-
> >  scripts/kconfig/nconf.c             | 2 +-
> >  scripts/kconfig/nconf.gui.c         | 3 ++-
> >  3 files changed, 5 insertions(+), 3 deletions(-)
> >
> > diff --git a/scripts/kconfig/lxdialog/inputbox.c b/scripts/kconfig/lxdialog/inputbox.c
> > index 611945611bf8..1dcfb288ee63 100644
> > --- a/scripts/kconfig/lxdialog/inputbox.c
> > +++ b/scripts/kconfig/lxdialog/inputbox.c
> > @@ -113,7 +113,8 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width
> >                         case KEY_DOWN:
> >                                 break;
> >                         case KEY_BACKSPACE:
> > -                       case 127:
> > +                       case 8:   /* ^H */
> > +                       case 127: /* ^? */
> >                                 if (pos) {
> >                                         wattrset(dialog, dlg.inputbox.atr);
> >                                         if (input_x == 0) {
> > diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c
> > index a4670f4e825a..ac92c0ded6c5 100644
> > --- a/scripts/kconfig/nconf.c
> > +++ b/scripts/kconfig/nconf.c
> > @@ -1048,7 +1048,7 @@ static int do_match(int key, struct match_state *state, int *ans)
> >                 state->match_direction = FIND_NEXT_MATCH_UP;
> >                 *ans = get_mext_match(state->pattern,
> >                                 state->match_direction);
> > -       } else if (key == KEY_BACKSPACE || key == 127) {
> > +       } else if (key == KEY_BACKSPACE || key == 8 || key == 127) {
> >                 state->pattern[strlen(state->pattern)-1] = '\0';
> >                 adj_match_dir(&state->match_direction);
> >         } else
> > diff --git a/scripts/kconfig/nconf.gui.c b/scripts/kconfig/nconf.gui.c
> > index 7be620a1fcdb..77f525a8617c 100644
> > --- a/scripts/kconfig/nconf.gui.c
> > +++ b/scripts/kconfig/nconf.gui.c
> > @@ -439,7 +439,8 @@ int dialog_inputbox(WINDOW *main_window,
> >                 case KEY_F(F_EXIT):
> >                 case KEY_F(F_BACK):
> >                         break;
> > -               case 127:
> > +               case 8:   /* ^H */
> > +               case 127: /* ^? */
> >                 case KEY_BACKSPACE:
> >                         if (cursor_position > 0) {
> >                                 memmove(&result[cursor_position-1],
> > --
> > 2.17.1
> >
> 
> 
> -- 
> Best Regards
> Masahiro Yamada

-- 
Cheers,
Changbin Du

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ