Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 53292 - bad permissions set on /dev/tty in udev-0.26-r1
Summary: bad permissions set on /dev/tty in udev-0.26-r1
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Greg Kroah-Hartman (RETIRED)
URL:
Whiteboard:
Keywords:
: 53342 53407 53569 53837 55989 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-06-08 03:42 UTC by Simon Watson
Modified: 2004-08-11 13:51 UTC (History)
10 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Watson 2004-06-08 03:42:00 UTC
The change of:
default_mode="0666"

to
default_mode="0660"

causes problems with ssh-askpass because /dev/tty has the wrong permissions - so passwords become readable in the terminal.

I assume a work around can be found just for the /dev/tty node - but am unsure what it is.


Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Greg Kroah-Hartman (RETIRED) gentoo-dev 2004-06-08 11:27:41 UTC
You mean "unreadable", right?

What should the "proper" permissions for /dev/tty be?  Also, what should
the default owner:group be?  Right now we do not have a rule to specify this.
Comment 2 Greg Kroah-Hartman (RETIRED) gentoo-dev 2004-06-08 11:31:43 UTC
Ok, it also looks like some of the /dev/vc/tty nodes have improper permissions
too.  The rule:
    tty[0-9][0-9]*:root:tty:0660
should be catching all tty nodes, but it isn't.

Hm, if you replace that line (which is in /etc/udev/permissions.d/50-udev.permissions ) with the following:
    tty*:root:tty:0660

and see if that fixes your problem?
Comment 3 Guillaume Castagnino 2004-06-08 11:44:43 UTC
Yes, I had the same problem
This correction is the right stuff, it works well, and it seems good that /dev/tty is owned by root:tty
Comment 4 Greg Kroah-Hartman (RETIRED) gentoo-dev 2004-06-08 22:55:09 UTC
It is good that it is owned by root:tty, but the permissions of 0660 still
cause me to have the same error as was originally reported :(

I'll work on tweaking these tomorrow and get a new release out to fix them.
Comment 5 Thomas Matthijs (RETIRED) gentoo-dev 2004-06-09 00:35:37 UTC
my ssh stoped working this morning, so i tracked it down, was because of this bug

the fix you suggested works (after i added myself to the tty group offcourse)

but, tty*:root:tty:0660 will also catch ttyUSB* etc no?
maybe it would be better to just add one for tty
tty:root:tty:0660
Comment 6 Dan A. Dickey 2004-06-09 08:27:49 UTC
I saw this too this morning after my system rebooted - I had emerged
udev-026-r1 yesterday I think.
Re: comment 1 - The reporter does mean *readable*.  The password characters
are echoed to the tty as the program reading them could not turn echo off.

And I think the proper fix is pretty close to comment #5.
However, the mode for tty should be 666.
So, I added the line:
tty:root:tty:0666
in the pty devices area of /etc/udev/permissions.d/50-udev.permissions;
rebooted, and things were working well again.

Also, I did a little back tracking - this broke in udev-025-r1 with
the change of the default_mode from 0666 to 0660 in udev.conf.
I must not have rebooted with 025-r1.

And, finally, re: comment #2, consider carefully how file globbing
works compared to regex matching.  'tty[0-9][0-9]*' most definitely
will not catch all tty's.  I mentioned this once before for a different
bug - and I think it was in either udev or hotplug also.
Comment 7 Daniel Webert 2004-06-09 09:25:12 UTC
*** Bug 53407 has been marked as a duplicate of this bug. ***
Comment 8 Mamoru KOMACHI (RETIRED) gentoo-dev 2004-06-09 09:58:39 UTC
*** Bug 53342 has been marked as a duplicate of this bug. ***
Comment 9 Stephen Bennett (RETIRED) gentoo-dev 2004-06-10 05:02:04 UTC
My guess is that you'd want tty[0-9]*:root:tty:0660 to catch /dev/tty as well as /dev/tty[number].
Comment 10 Dan A. Dickey 2004-06-10 05:24:38 UTC
re: comment 9 - are you sure about that?
On my system, /dev/tty[0-9] are symlinks that point at /dev/vc/[0-9].
What are they on your system?
Does having a line like what you propose have any effect on /dev/tty[0-9]?
Does it change the perms of what they point to, or the symlinks, or nothing
at all?
Comment 11 Michael M Nazaroff (RETIRED) gentoo-dev 2004-06-10 14:54:10 UTC
*** Bug 53569 has been marked as a duplicate of this bug. ***
Comment 12 Brian Nickel 2004-06-11 04:33:26 UTC
This bug is also causing nautilus (2.6+) to misbehave when you try accessing sftp sites.
Before I changed permissions, it would hang when you tried accessing a share; and after I set permissions to a+rw, it segfaults.
Presumably that's happening in the vfs daemon, but it's just something to watch for when fixing this bug.
Comment 13 Nathan Lutchansky 2004-06-11 14:17:49 UTC
The /dev/tty device is supposed to allow processes to open a new fd to their controlling terminal, so it should certainly be 0666.  Programs (most notably openssh) break in mysterious ways if they can't open /dev/tty.

The solution seems to be adding a line to /etc/udev/permissions.d/50-udev.permissions:

tty:root:tty:0666

right before the rule that matches the rest of the ttys.
Comment 14 Greg Kroah-Hartman (RETIRED) gentoo-dev 2004-06-14 13:51:41 UTC
Fixed in 027 release.
Comment 15 Oldrich Jedlicka 2004-06-16 02:25:55 UTC
Only a note. There is some misinterpretation of udev rules I think. The rule tty[0-9]* should be explained this way: Match an identified starting with the letters "tty", followed by any single digit, optionally followed by anything at all. This is NOT a regular expression saying "string 'tty' and any digit repeated zero or more times". Explained in `man udev`.
Comment 16 Aron Griffis (RETIRED) gentoo-dev 2004-06-16 13:19:42 UTC
*** Bug 53837 has been marked as a duplicate of this bug. ***
Comment 17 Matthew Caron 2004-07-03 15:39:42 UTC
*** Bug 55989 has been marked as a duplicate of this bug. ***
Comment 18 Patrick 2004-08-11 07:41:45 UTC
How about marking 0.27 (or higher) stable on x86
so that this bug won't keep affecting people?
Comment 19 Greg Kroah-Hartman (RETIRED) gentoo-dev 2004-08-11 13:51:20 UTC
Good idea, I just did that right now.