Bug 5314

Summary: /usr/libexec/pt_chown should be suid root
Product: [Retired] Red Hat Linux Reporter: Hans de Goede <j.w.r.degoede>
Component: glibcAssignee: Cristian Gafton <gafton>
Status: CLOSED NOTABUG QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 6.1   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-10-01 22:34:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Hans de Goede 1999-09-22 21:38:06 UTC
/usr/libexec/pt_chown should be suid root and it isn't,
this causes mc's subshell and gnome-terminal to fail when
run by non root.

Probably also causes other problems.

This is with the latest glibc from the snapshots dir:

Comment 1 Bill Nottingham 1999-10-01 16:46:59 UTC
Can't reproduce this here; glibc-2.1.2-11, latest gnome-core
& mc.

Comment 2 Hans de Goede 1999-10-01 16:56:59 UTC
Hmm, could you do a "ls -l /usr/libexec/pt_chown" and check if it is
suid root? It should be, but in the rpm it isn't.
Did you test this as an ordinary user? As root it works fine.

If it is suid root, could you also do "rpm --verify glibc" ?
I made it suid root myself and rpm --verify glibc complains that the
mode is not ok.

"rpm -ql --dump glibc|grep pt_chown" gives:
/usr/libexec/pt_chown 34643 937818817 3f730db73c6f4ff5d4f20b37a7fe7976
0100755 root root 0 0 19171 X

Which should be:
/usr/libexec/pt_chown 34643 937818817 3f730db73c6f4ff5d4f20b37a7fe7976
0104755 root root 0 0 19171 X

rpm -q glibc gives:

Comment 3 Hans de Goede 1999-10-01 17:02:59 UTC
Just read you mail that it isn't suid root for you, you could have
mentioned that over here too ;)

Okay, you're partially right mc seems to have been fixed to not use
pt_chown anymore.

But gnome-terminal still gives:
[hans@shalem hans]$ gnome-terminal
pt_chown: needs to be installed setuid `root'
Error: unable to fork: Success
[hans@shalem hans]$

Comment 4 Hans de Goede 1999-10-01 17:13:59 UTC
correction it is a tricky bug:

Change /usr/libexec/pt_chown to 755

If I open one gnome-terminal all is well
second all is well, third fails

What happens is that pt_chown is only called for pty's which haven't
been used by the owner before so If I first open a few gnome-terminals
with /usr/libexec/pt_chown suid root.

And then try it without /usr/libexec/pt_chown suid root then I can
open as many terminals as I already had open, it goes wrong as soon as
I open as many as I had open + 1.

If I'm as far that gnome-terminal starts failing so does mc's

Comment 5 Bill Nottingham 1999-10-01 18:49:59 UTC
Do you have the /dev/pts filesystem mounted?

Comment 6 Hans de Goede 1999-10-01 18:59:59 UTC
oops, I didn't, with it it works fine sorry for the hassle.

Comment 7 Bill Nottingham 1999-10-01 22:34:59 UTC
That's OK.

Comment 8 Hans de Goede 1999-12-21 15:19:59 UTC
After some further checking I found out that the problem is devfs related, this
bug does happen on devfs kernel, since devfs doesn't support the pts filesystem,
so maybe this should still be fixed, maybe ?