Debian Bug report logs - #547079
agetty: Should preserve the iutf8 tty c_iflag set by kernel

version graph

Package: util-linux; Maintainer for util-linux is LaMont Jones <lamont@debian.org>; Source for util-linux is src:util-linux.

Reported by: Samuel Thibault <sthibault@debian.org>

Date: Thu, 17 Sep 2009 00:39:01 UTC

Severity: normal

Tags: fixed-upstream

Fixed in version 2.20.1-1

Done: Samuel Thibault <sthibault@debian.org>

Bug is archived. No further changes may be made.

Forwarded to util-linux-ng@vger.kernel.org

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>:
Bug#547079; Package login. (Thu, 17 Sep 2009 00:39:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Samuel Thibault <sthibault@debian.org>:
New Bug report received and forwarded. Copy sent to Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>. (Thu, 17 Sep 2009 00:39:05 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Samuel Thibault <sthibault@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: login: Should set the iutf8 tty c_iflag if the locale is utf8
Date: Thu, 17 Sep 2009 02:25:57 +0200
Package: login
Version: 1:4.1.4.2-1
Severity: normal

Hello,

ATM, if one runs cat from a VT with a UTF-8 locale, type a non-ascii
character, backspace, enter, the first byte of the utf-8 encoding
non-ascii will remain in the stream.  This is because the iutf8 flag is
not set. getty clears it because it is not supposed to know anything
beyond ascii. login, however, is responsible for loading the initial
environment through the pam_env.so PAM module, and then knows which
locale is configured on the system. There should be a PAM module (could
be named pam_tty for instance) which basically does

struct termios tty;
tcgetattr(STDIN_FILENO, &tty);
if (utf8_locale)
	tty.c_iflag |= IUTF8;
else
	tty.c_iflag &= ~IUTF8;
tcsetattr(STDIN_FILENO, &tty);

in order to properly set the iutf8 flag according to whether the
configured locale is utf8 or not.

Samuel

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.31 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages login depends on:
ii  libc6                         2.9-25     GNU C Library: Shared libraries
ii  libpam-modules                1.0.1-10   Pluggable Authentication Modules f
ii  libpam-runtime                1.0.1-10   Runtime support for the PAM librar
ii  libpam0g                      1.0.1-10   Pluggable Authentication Modules l

login recommends no packages.

login suggests no packages.

-- no debconf information

-- 
Samuel Thibault <samuel.thibault@fnac.net>
* c is away : cuisine; bouffe
<y> oh, moi je fais plut�t cuisine & bouffe en fait :)
<c> oui c'est vrai, certains font cuisine && bouffe (juste au cas o�... ;-))
<y> ( cuisine && bouffe ) || restau
<N> voire ((cuisine && bouffe) || restau) & ap�ritif
 -+- #ens-mim -+-




Information forwarded to debian-bugs-dist@lists.debian.org, Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>:
Bug#547079; Package login. (Thu, 17 Sep 2009 02:09:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mike Frysinger <vapier@gentoo.org>:
Extra info received and forwarded to list. Copy sent to Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>. (Thu, 17 Sep 2009 02:09:03 GMT) Full text and rfc822 format available.

Message #10 received at 547079@bugs.debian.org (full text, mbox):

From: Mike Frysinger <vapier@gentoo.org>
To: pkg-shadow-devel@lists.alioth.debian.org, Samuel Thibault <sthibault@debian.org>, 547079@bugs.debian.org
Subject: Re: [Pkg-shadow-devel] Bug#547079: login: Should set the iutf8 tty c_iflag if the locale is utf8
Date: Wed, 16 Sep 2009 22:05:59 -0400
[Message part 1 (text/plain, inline)]
On Wednesday 16 September 2009 20:25:57 Samuel Thibault wrote:
> ATM, if one runs cat from a VT with a UTF-8 locale, type a non-ascii
> character, backspace, enter, the first byte of the utf-8 encoding
> non-ascii will remain in the stream.  This is because the iutf8 flag is
> not set. getty clears it because it is not supposed to know anything
> beyond ascii. login, however, is responsible for loading the initial
> environment through the pam_env.so PAM module, and then knows which
> locale is configured on the system.  There should be a PAM module (could
> be named pam_tty for instance) which basically does

except that the locale is rarely configured through pam_env, and this doesnt 
work with a non-pam environment.  and throwing another pam module into the mix 
sounds like throwing crap onto the pile rather than addressing it at the right 
place.

this is why the `unicode_start` and `unicode_stop` programs exist -- for 
people to dynamically change the console input mode.  and why the 
keyboard/console font init scripts exist -- to set the defaults.  and why the 
kernel now defaults all consoles to iutf8 on by default.

perhaps you meant to file a bug about agetty not preserving the IUTF8 flag.  
certainly nothing needs to be changed in the shadow package.
-mike
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>:
Bug#547079; Package login. (Thu, 17 Sep 2009 08:06:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Samuel Thibault <sthibault@debian.org>:
Extra info received and forwarded to list. Copy sent to Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>. (Thu, 17 Sep 2009 08:06:06 GMT) Full text and rfc822 format available.

Message #15 received at 547079@bugs.debian.org (full text, mbox):

From: Samuel Thibault <sthibault@debian.org>
To: Mike Frysinger <vapier@gentoo.org>
Cc: pkg-shadow-devel@lists.alioth.debian.org, 547079@bugs.debian.org
Subject: Re: [Pkg-shadow-devel] Bug#547079: login: Should set the iutf8 tty c_iflag if the locale is utf8
Date: Thu, 17 Sep 2009 09:55:58 +0200
Mike Frysinger, le Wed 16 Sep 2009 22:05:59 -0400, a écrit :
> this is why the `unicode_start` and `unicode_stop` programs exist -- for 
> people to dynamically change the console input mode.

Normal users shouldn't have to know they have to start it.

> and why the keyboard/console font init scripts exist -- to set the
> defaults. and why the kernel now defaults all consoles to iutf8 on by
> default.

Except that getty drops the flag.

> perhaps you meant to file a bug about agetty not preserving the IUTF8 flag.  

As I said in my bug report, getty has always been clearing all tty flags
to restart the termios settings from scratch.  We can try, but I fear
they won't accept it.

Also, think about a serial console. Should the kernel also default tty
parameters with iutf8 there?  It doesn't know how the terminal plugged
to it is configured.  Getty run on it doesn't know which locale will be
used so can't set it.  Only login has some chance to know which locale
is being configured on the system.

Samuel




Information forwarded to debian-bugs-dist@lists.debian.org, Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>:
Bug#547079; Package login. (Thu, 17 Sep 2009 17:48:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mike Frysinger <vapier@gentoo.org>:
Extra info received and forwarded to list. Copy sent to Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>. (Thu, 17 Sep 2009 17:48:09 GMT) Full text and rfc822 format available.

Message #20 received at 547079@bugs.debian.org (full text, mbox):

From: Mike Frysinger <vapier@gentoo.org>
To: Samuel Thibault <sthibault@debian.org>
Cc: pkg-shadow-devel@lists.alioth.debian.org, 547079@bugs.debian.org
Subject: Re: [Pkg-shadow-devel] Bug#547079: login: Should set the iutf8 tty c_iflag if the locale is utf8
Date: Thu, 17 Sep 2009 13:38:08 -0400
[Message part 1 (text/plain, inline)]
On Thursday 17 September 2009 03:55:58 Samuel Thibault wrote:
> Mike Frysinger, le Wed 16 Sep 2009 22:05:59 -0400, a écrit :
> > this is why the `unicode_start` and `unicode_stop` programs exist -- for
> > people to dynamically change the console input mode.
> 
> Normal users shouldn't have to know they have to start it.

i was giving you background information on the problem and the current 
"standard".  and how to change things dynamically.

> > and why the keyboard/console font init scripts exist -- to set the
> > defaults. and why the kernel now defaults all consoles to iutf8 on by
> > default.
> 
> Except that getty drops the flag.

so here's a crazy idea: fix getty instead of throwing hacks around packages 
that have no business mucking with these things.  login/pam are there to do 
authentication only, not screw with the terminal.

> > perhaps you meant to file a bug about agetty not preserving the IUTF8
> > flag.
> 
> As I said in my bug report, getty has always been clearing all tty flags
> to restart the termios settings from scratch.  We can try, but I fear
> they won't accept it.

why ?  getty is wrong and should be fixed.  i doubt the util-linux guys would 
reject a patch that preserved the UTF8 bit.  i dont know why you think it's ok 
to throw fragile hacks into unrelated packages instead of fixing the real 
source of the problem.

> Also, think about a serial console. Should the kernel also default tty
> parameters with iutf8 there?  It doesn't know how the terminal plugged
> to it is configured.  Getty run on it doesn't know which locale will be
> used so can't set it.  Only login has some chance to know which locale
> is being configured on the system.

that is the problem of the kernel serial layer and/or init scripts and/or 
shell login scripts.  i dont know what the kernel defaults serial tty's to, 
just that they've recently changed the vt default (maybe it was a global 
default).  if the defaults arent appropriate, then configure your system's kbd 
scripts appropriately.  if you want to handle a system where unicode and non-
unicode people will be operating, then you can tweak the login scripts to run 
the appropriate dynamic scripts (like unicode_start/unicode_stop), or request 
those packages be updated to do this automatically based on the locale.
-mike
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>:
Bug#547079; Package login. (Thu, 17 Sep 2009 18:21:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to Samuel Thibault <sthibault@debian.org>:
Extra info received and forwarded to list. Copy sent to Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>. (Thu, 17 Sep 2009 18:21:09 GMT) Full text and rfc822 format available.

Message #25 received at 547079@bugs.debian.org (full text, mbox):

From: Samuel Thibault <sthibault@debian.org>
To: Mike Frysinger <vapier@gentoo.org>
Cc: pkg-shadow-devel@lists.alioth.debian.org, 547079@bugs.debian.org, util-linux@packages.debian.org
Subject: Re: [Pkg-shadow-devel] Bug#547079: login: Should set the iutf8 tty c_iflag if the locale is utf8
Date: Thu, 17 Sep 2009 20:17:33 +0200
(Cc-ing util-linux maintainer)

Mike Frysinger, le Thu 17 Sep 2009 13:38:08 -0400, a écrit :
> > > and why the keyboard/console font init scripts exist -- to set the
> > > defaults. and why the kernel now defaults all consoles to iutf8 on by
> > > default.
> > 
> > Except that getty drops the flag.
> 
> so here's a crazy idea: fix getty instead of throwing hacks around packages 
> that have no business mucking with these things.

No need to be sarcastic, that never helps discussion.

My concern is that getty used to not keep any flag at all.  Keeping
_some_ flags contrary to none is not just a "fix", it's a change of
behavior.  Think for instance about a situation where a user clears the
tty's iutf8.  The next user to log in will have a bogus terminal since
getty would leave it cleared and nothing else will set it.  This is
the same for all the flags, getty could just keep the kernel's current
state, but it doesn't.

> login/pam are there to do authentication only, not screw with the
> terminal.

Login already does screw with the terminal in setup_tty(), and with
pam they already screw with a lot of various things about the session:
sid, limits, initial environment variables (like MAIL_DIR), home
automount, ...

> > > perhaps you meant to file a bug about agetty not preserving the IUTF8
> > > flag.
> > 
> > As I said in my bug report, getty has always been clearing all tty flags
> > to restart the termios settings from scratch.  We can try, but I fear
> > they won't accept it.
> 
> why ? getty is wrong and should be fixed. i doubt the util-linux guys
> would reject a patch that preserved the UTF8 bit.

See my concern above.  Letting a user break another user's environment
is wrong too.

> i dont know why you think it's ok to throw fragile hacks into
> unrelated packages instead of fixing the real source of the problem.

The real source of the problem is probably that getty doesn't know
whether the terminal should be set up for utf8 or not.  That could be an
option given from /etc/inittab, but that would not be synchronized with
console-setup's CHARMAP parameter and whether the default locale is utf8
or not.

What do getty people think?

Samuel




Information forwarded to debian-bugs-dist@lists.debian.org, Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>:
Bug#547079; Package login. (Thu, 17 Sep 2009 23:33:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mike Frysinger <vapier@gentoo.org>:
Extra info received and forwarded to list. Copy sent to Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>. (Thu, 17 Sep 2009 23:33:03 GMT) Full text and rfc822 format available.

Message #30 received at 547079@bugs.debian.org (full text, mbox):

From: Mike Frysinger <vapier@gentoo.org>
To: Samuel Thibault <sthibault@debian.org>
Cc: pkg-shadow-devel@lists.alioth.debian.org, 547079@bugs.debian.org, util-linux@packages.debian.org
Subject: Re: [Pkg-shadow-devel] Bug#547079: login: Should set the iutf8 tty c_iflag if the locale is utf8
Date: Thu, 17 Sep 2009 19:30:02 -0400
[Message part 1 (text/plain, inline)]
On Thursday 17 September 2009 14:17:33 Samuel Thibault wrote:
> Mike Frysinger, le Thu 17 Sep 2009 13:38:08 -0400, a écrit :
> > > > and why the keyboard/console font init scripts exist -- to set the
> > > > defaults. and why the kernel now defaults all consoles to iutf8 on by
> > > > default.
> > >
> > > Except that getty drops the flag.
> >
> > so here's a crazy idea: fix getty instead of throwing hacks around
> > packages that have no business mucking with these things.
> 
> My concern is that getty used to not keep any flag at all.  Keeping
> _some_ flags contrary to none is not just a "fix", it's a change of
> behavior.  Think for instance about a situation where a user clears the
> tty's iutf8.  The next user to log in will have a bogus terminal since
> getty would leave it cleared and nothing else will set it.  This is
> the same for all the flags, getty could just keep the kernel's current
> state, but it doesn't.

that's a good point.  however, there's more to having a proper unicode console 
than just setting the iutf8 bit on the tty.  this is why unicode_{start,stop} 
exist in the first place.

> > login/pam are there to do authentication only, not screw with the
> > terminal.
> 
> Login already does screw with the terminal in setup_tty(),

presumably enough to prevent echoing of the password, but that's about it (for 
obvious security reasons).  the point of running agetty is to make sure the 
tty is in a sane state.

> and with pam they already screw with a lot of various things about the
> session: sid, limits, initial environment variables (like MAIL_DIR), home
> automount, ...

any solution that requires pam is no solution at all.  the things you mention 
here really are part of login configuring things, not pam.

> > > > perhaps you meant to file a bug about agetty not preserving the IUTF8
> > > > flag.
> > >
> > > As I said in my bug report, getty has always been clearing all tty
> > > flags to restart the termios settings from scratch.  We can try, but I
> > > fear they won't accept it.
> >
> > why ? getty is wrong and should be fixed. i doubt the util-linux guys
> > would reject a patch that preserved the UTF8 bit.
> 
> See my concern above.  Letting a user break another user's environment
> is wrong too.
> 
> > i dont know why you think it's ok to throw fragile hacks into
> > unrelated packages instead of fixing the real source of the problem.
> 
> The real source of the problem is probably that getty doesn't know
> whether the terminal should be set up for utf8 or not.  That could be an
> option given from /etc/inittab, but that would not be synchronized with
> console-setup's CHARMAP parameter and whether the default locale is utf8
> or not.

i guess unless the whole chain can be addressed, there isnt much point in 
changing just one.  i dont have a fedora box myself, but from talking to a 
friend, things "just work" in the default setup.  or at least it defaults 
everything to unicode.
-mike
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>:
Bug#547079; Package login. (Fri, 18 Sep 2009 00:06:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Samuel Thibault <sthibault@debian.org>:
Extra info received and forwarded to list. Copy sent to Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>. (Fri, 18 Sep 2009 00:06:03 GMT) Full text and rfc822 format available.

Message #35 received at 547079@bugs.debian.org (full text, mbox):

From: Samuel Thibault <sthibault@debian.org>
To: Mike Frysinger <vapier@gentoo.org>
Cc: pkg-shadow-devel@lists.alioth.debian.org, 547079@bugs.debian.org, util-linux@packages.debian.org
Subject: Re: [Pkg-shadow-devel] Bug#547079: login: Should set the iutf8 tty c_iflag if the locale is utf8
Date: Fri, 18 Sep 2009 01:59:14 +0200
Mike Frysinger, le Thu 17 Sep 2009 19:30:02 -0400, a écrit :
> > > login/pam are there to do authentication only, not screw with the
> > > terminal.
> > 
> > Login already does screw with the terminal in setup_tty(),
> 
> presumably enough to prevent echoing of the password, but that's about it (for 
> obvious security reasons).

Have you looked at the code before saying that?

		/*
		 * Add your favorite terminal modes here ...
		 */
		termio.c_lflag |= ISIG | ICANON | ECHO | ECHOE;
		termio.c_iflag |= ICRNL;

etc...

> > and with pam they already screw with a lot of various things about the
> > session: sid, limits, initial environment variables (like MAIL_DIR), home
> > automount, ...
> 
> any solution that requires pam is no solution at all.  the things you mention 
> here really are part of login configuring things, not pam.

Then be it login itself.

> i dont have a fedora box myself, but from talking to a friend, things
> "just work" in the default setup. or at least it defaults everything
> to unicode.

Did he check whether stty -a properly shows iutf8?  Things work very
fine even without it, one of the very few effects of iutf8 left cleared
is the bug I mentioned in my report: canonical mode's treatment of
backspace.  People rarely notice it.

Samuel




Information forwarded to debian-bugs-dist@lists.debian.org, Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>:
Bug#547079; Package login. (Fri, 18 Sep 2009 00:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mike Frysinger <vapier@gentoo.org>:
Extra info received and forwarded to list. Copy sent to Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>. (Fri, 18 Sep 2009 00:45:03 GMT) Full text and rfc822 format available.

Message #40 received at 547079@bugs.debian.org (full text, mbox):

From: Mike Frysinger <vapier@gentoo.org>
To: Samuel Thibault <sthibault@debian.org>
Cc: pkg-shadow-devel@lists.alioth.debian.org, 547079@bugs.debian.org, util-linux@packages.debian.org
Subject: Re: [Pkg-shadow-devel] Bug#547079: login: Should set the iutf8 tty c_iflag if the locale is utf8
Date: Thu, 17 Sep 2009 20:35:16 -0400
[Message part 1 (text/plain, inline)]
On Thursday 17 September 2009 19:59:14 Samuel Thibault wrote:
> Mike Frysinger, le Thu 17 Sep 2009 19:30:02 -0400, a écrit :
> > > > login/pam are there to do authentication only, not screw with the
> > > > terminal.
> > >
> > > Login already does screw with the terminal in setup_tty(),
> >
> > presumably enough to prevent echoing of the password, but that's about it
> > (for obvious security reasons).
> 
> Have you looked at the code before saying that?
> 
> 		/*
> 		 * Add your favorite terminal modes here ...
> 		 */
> 		termio.c_lflag |= ISIG | ICANON | ECHO | ECHOE;
> 		termio.c_iflag |= ICRNL;
> 
> etc...

looks like a lot of stuff login shouldnt be doing, but historically has been 
so no one complained because "it worked".  extending poor behavior because 
it's already there isnt really a good line of reasoning.

> > i dont have a fedora box myself, but from talking to a friend, things
> > "just work" in the default setup. or at least it defaults everything
> > to unicode.
> 
> Did he check whether stty -a properly shows iutf8?  Things work very
> fine even without it, one of the very few effects of iutf8 left cleared
> is the bug I mentioned in my report: canonical mode's treatment of
> backspace.  People rarely notice it.

i didnt ask him "hey does your keyboard work", i asked him what his settings 
were after he logged in.  so of course i validated the stty output.

i'm not suggesting everything is great and nothing needs to be changed.  i'm 
saying that login/pam is not really part of the solution.
-mike
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>:
Bug#547079; Package login. (Tue, 23 Mar 2010 14:15:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nicolas François <nicolas.francois@centraliens.net>:
Extra info received and forwarded to list. Copy sent to Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>. (Tue, 23 Mar 2010 14:15:03 GMT) Full text and rfc822 format available.

Message #45 received at 547079@bugs.debian.org (full text, mbox):

From: Nicolas François <nicolas.francois@centraliens.net>
To: debian-devel@lists.deiban.org, 547079@bugs.debian.org
Cc: Samuel Thibault <sthibault@debian.org>, Mike Frysinger <vapier@gentoo.org>, util-linux@packages.debian.org
Subject: Re: Bug#547079: login: Should set the iutf8 tty c_iflag if the locale is utf8
Date: Tue, 23 Mar 2010 15:09:51 +0100
tags #539354 help
thanks

Hello,

As I have no clue about TTY setup, let see if I can get some other
opinions on debian-devel.

The question raised on http://bugs.debian.org/547079 is who shall be
responsible for setting up the user's tty (e.g. regarding UTF-8 handling).

Some defaults are in the kernel.
getty makes some changes, login also, and the end user may also do so in a
user profile script.

The kernel, getty, or login do not really know if the user wants a UTF-8
locale, so my preference would be to move the setup of the iutf8 tty
c_iflag to the user's configuration.  For example the user could use
unicode_start / unicode_stop.

(This also has the advantage for me not to require any change in login)


The bug discusses also these alternatives:
 2 iutf8 tty c_iflag forced by getty (maybe based on an option in inittab)
   (currently getty always drop this flag)
 3 iutf8 tty c_iflag forced by login
   (I did not really understand how login shall guess when this shall be
   done, maybe an option in /etc/login.defs)
 4 iutf8 tty c_iflag forced by a PAM module

Do you have any opinion on how this should be done?

Thanks in advance,
-- 
Nekral

On Thu, Sep 17, 2009 at 08:35:16PM -0400, Mike Frysinger wrote:
> On Thursday 17 September 2009 19:59:14 Samuel Thibault wrote:
> > Mike Frysinger, le Thu 17 Sep 2009 19:30:02 -0400, a écrit :
> > > > > login/pam are there to do authentication only, not screw with the
> > > > > terminal.
> > > >
> > > > Login already does screw with the terminal in setup_tty(),
> > >
> > > presumably enough to prevent echoing of the password, but that's about it
> > > (for obvious security reasons).
> > 
> > Have you looked at the code before saying that?
> > 
> > 		/*
> > 		 * Add your favorite terminal modes here ...
> > 		 */
> > 		termio.c_lflag |= ISIG | ICANON | ECHO | ECHOE;
> > 		termio.c_iflag |= ICRNL;
> > 
> > etc...
> 
> looks like a lot of stuff login shouldnt be doing, but historically has been 
> so no one complained because "it worked".  extending poor behavior because 
> it's already there isnt really a good line of reasoning.
> 
> > > i dont have a fedora box myself, but from talking to a friend, things
> > > "just work" in the default setup. or at least it defaults everything
> > > to unicode.
> > 
> > Did he check whether stty -a properly shows iutf8?  Things work very
> > fine even without it, one of the very few effects of iutf8 left cleared
> > is the bug I mentioned in my report: canonical mode's treatment of
> > backspace.  People rarely notice it.
> 
> i didnt ask him "hey does your keyboard work", i asked him what his settings 
> were after he logged in.  so of course i validated the stty output.
> 
> i'm not suggesting everything is great and nothing needs to be changed.  i'm 
> saying that login/pam is not really part of the solution.
> -mike






Information forwarded to debian-bugs-dist@lists.debian.org, Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>:
Bug#547079; Package login. (Tue, 23 Mar 2010 14:39:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>. (Tue, 23 Mar 2010 14:39:03 GMT) Full text and rfc822 format available.

Message #50 received at 547079@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
Subject: Re: Bug#547079: login: Should set the iutf8 tty c_iflag if the locale is utf8
Date: Tue, 23 Mar 2010 15:33:22 +0100
The following message is a courtesy copy of an article
that has been posted to gmane.linux.debian.devel.general as well.


[Nicolas François]
> As I have no clue about TTY setup, let see if I can get some other
> opinions on debian-devel.
>
> The question raised on http://bugs.debian.org/547079 is who shall be
> responsible for setting up the user's tty (e.g. regarding UTF-8 handling).

This sound related to <URL: http://bugs.debian.org/547073 >, fixed in
sysvinit. in version 2.87dsf-7.  Init now leave it to the kernel to
set the utf-8 flag.  Perhaps login should do the same?

I do not know much about TTY setup myself, so I do not have much to
say on the topic. :)

Happy hacking,
-- 
Petter Reinholdtsen




Added tag(s) help. Request was from Nicolas François <nicolas.francois@centraliens.net> to control@bugs.debian.org. (Thu, 25 Mar 2010 12:40:32 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>:
Bug#547079; Package login. (Thu, 25 Mar 2010 13:24:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Samuel Thibault <sthibault@debian.org>:
Extra info received and forwarded to list. Copy sent to Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>. (Thu, 25 Mar 2010 13:24:03 GMT) Full text and rfc822 format available.

Message #57 received at 547079@bugs.debian.org (full text, mbox):

From: Samuel Thibault <sthibault@debian.org>
To: debian-devel@lists.debian.org
Cc: util-linux@packages.debian.org, 547079@bugs.debian.org
Subject: Re: Bug#547079: login: Should set the iutf8 tty c_iflag if the locale is utf8
Date: Thu, 25 Mar 2010 14:22:51 +0100
Nicolas François, le Tue 23 Mar 2010 23:59:29 +0100, a écrit :
> Is it an issue to set the utf8 flag too often?
> (does it break something?,

It has the converse effect as forgetting it, cf the original bug report:

“ATM, if one runs cat from a VT with a UTF-8 locale, type a non-ascii
character, backspace, enter, the first byte of the utf-8 encoding
non-ascii will remain in the stream.”

The converse would be “with utf8 spuriously set, if one runs cat
from a VT with a non-UTF-8 locale, type a character, then a non-ascii
character, backspace, enter, the first character is dropped from the
stream”.

That's not so much a big deal (that is why nobody bothered to fix the
reported bug up to now), but it's still bogus (the other way round).

> does it affect performances?)

The performance hit is very tiny: just a couple of additional tests in
the kernel.

> Also, can you elaborate on your solution. Who would configure what and how?

I don't know enough the pam stack to know whether my solution is even
feasible.  My point is that it there are at least two cases that need to
be considered:

- getty/login on a VT.
- getty/login on a serial port.

Both could be independently using utf-8 or not.

In the first case, getty could use ioctl(KDGKBMODE) to know whether the
VT keyboard is configured in UTF-8 mode or not, and set the IUTF8 flag
appropriately. That brings Linux-specific code to getty which for now
was quite OS-independent, but well.

In the second case, however, getty can not use ioctl(KDGKBMODE), since
only the other end of the serial cable knows whether it's using utf-8 or
not. The locale setting, however, has very probably been properly set
up by the user or the administrator and could be used as the source of
information for setting UTF-8 mode or not.

That is why I thought about setting it at the login/pam level, where I
believed the locale information is available, which captures both cases.

I had asked util-linux@packages.debian.org for what they think about it,
and never got an answer.

Samuel




Set Bug forwarded-to-address to 'util-linux-ng@vger.kernel.org'. Request was from Samuel Thibault <sthibault@debian.org> to control@bugs.debian.org. (Mon, 01 Aug 2011 22:12:02 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>:
Bug#547079; Package login. (Wed, 03 Aug 2011 23:36:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Samuel Thibault <sthibault@debian.org>:
Extra info received and forwarded to list. Copy sent to Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org>. (Wed, 03 Aug 2011 23:36:03 GMT) Full text and rfc822 format available.

Message #64 received at 547079@bugs.debian.org (full text, mbox):

From: Samuel Thibault <sthibault@debian.org>
To: 547079@bugs.debian.org
Subject: Re: login: Should set the iutf8 tty c_iflag if the locale is utf8
Date: Thu, 4 Aug 2011 01:33:23 +0200
reassign 547079 util-linux
retitle 547079 agetty: Should preserve the iutf8 tty c_iflag set by kernel
thanks

Hello,

util-linux upstream maintainers have applied a patch which preserves the
IUTF8 flag set by the kernel. Should thus get fixed by 2.20 release.

Samuel




Bug reassigned from package 'login' to 'util-linux'. Request was from Samuel Thibault <sthibault@debian.org> to control@bugs.debian.org. (Wed, 03 Aug 2011 23:36:04 GMT) Full text and rfc822 format available.

Bug No longer marked as found in versions shadow/1:4.1.4.2-1. Request was from Samuel Thibault <sthibault@debian.org> to control@bugs.debian.org. (Wed, 03 Aug 2011 23:36:05 GMT) Full text and rfc822 format available.

Changed Bug title to 'agetty: Should preserve the iutf8 tty c_iflag set by kernel' from 'login: Should set the iutf8 tty c_iflag if the locale is utf8' Request was from Samuel Thibault <sthibault@debian.org> to control@bugs.debian.org. (Wed, 03 Aug 2011 23:36:05 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, LaMont Jones <lamont@debian.org>:
Bug#547079; Package util-linux. (Thu, 04 Aug 2011 07:00:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christian PERRIER <bubulle@debian.org>:
Extra info received and forwarded to list. Copy sent to LaMont Jones <lamont@debian.org>. (Thu, 04 Aug 2011 07:00:06 GMT) Full text and rfc822 format available.

Message #75 received at 547079@bugs.debian.org (full text, mbox):

From: Christian PERRIER <bubulle@debian.org>
To: Samuel Thibault <sthibault@debian.org>, 547079@bugs.debian.org
Subject: Re: [Pkg-shadow-devel] Bug#547079: login: Should set the iutf8 tty c_iflag if the locale is utf8
Date: Thu, 4 Aug 2011 08:57:08 +0200
[Message part 1 (text/plain, inline)]
tags 547079 fixed-upstream
tags 547079 - help
thanks

Quoting Samuel Thibault (sthibault@debian.org):
> reassign 547079 util-linux
> retitle 547079 agetty: Should preserve the iutf8 tty c_iflag set by kernel
> thanks
> 
> Hello,
> 
> util-linux upstream maintainers have applied a patch which preserves the
> IUTF8 flag set by the kernel. Should thus get fixed by 2.20 release.


Let's help Lamont, then..:-). Given the number of bugs in util-linux,
it's quite likely that a future upload of 2.20 omits closing this bug..:)

[signature.asc (application/pgp-signature, inline)]

Added tag(s) fixed-upstream. Request was from Christian PERRIER <bubulle@debian.org> to control@bugs.debian.org. (Thu, 04 Aug 2011 07:00:08 GMT) Full text and rfc822 format available.

Removed tag(s) help. Request was from Christian PERRIER <bubulle@debian.org> to control@bugs.debian.org. (Thu, 04 Aug 2011 07:00:08 GMT) Full text and rfc822 format available.

Reply sent to Samuel Thibault <sthibault@debian.org>:
You have taken responsibility. (Tue, 05 Nov 2013 07:03:13 GMT) Full text and rfc822 format available.

Notification sent to Samuel Thibault <sthibault@debian.org>:
Bug acknowledged by developer. (Tue, 05 Nov 2013 07:03:13 GMT) Full text and rfc822 format available.

Message #84 received at 547079-done@bugs.debian.org (full text, mbox):

From: Samuel Thibault <sthibault@debian.org>
To: Christian PERRIER <bubulle@debian.org>, 547079-done@bugs.debian.org
Subject: Re: Bug#547079: [Pkg-shadow-devel] Bug#547079: login: Should set the iutf8 tty c_iflag if the locale is utf8
Date: Tue, 5 Nov 2013 08:01:24 +0100
Version: 2.20.1-1

Christian PERRIER, le Thu 04 Aug 2011 08:57:08 +0200, a écrit :
> Let's help Lamont, then..:-). Given the number of bugs in util-linux,
> it's quite likely that a future upload of 2.20 omits closing this bug..:)

Indeed, now done :)

Samuel



Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Wed, 25 Dec 2013 07:31:24 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Apr 19 00:51:17 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.