Bug 110209

Summary: rc.sysinit mounts /dev/pts without honoring /etc/fstab
Product: [Fedora] Fedora Reporter: Gerald Britton <gbritton>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED ERRATA QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 1CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-11-17 21:15:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 108782    

Description Gerald Britton 2003-11-17 04:37:33 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1)
Gecko/20031030

Description of problem:
/etc/init.d/rc.sysinit script, line 80:

mount -n -t devpts /dev/pts /dev/pts

This mounts /dev/pts without honoring the options listed in
/etc/fstab.  This default setup has: gid=5,mode=620 which makes
the pts devices owned by group 'tty' and writable by that group by
default.  The behavior of the flawed rc.sysinit script results in
the devices owned by the user that created them and that user's
primary group.  This breaks such things as "mesg" and "ytalk" from
working properly.

Version-Release number of selected component (if applicable):
initscripts-7.42-1

How reproducible:
Always

Steps to Reproduce:
1. log in using a pseudo-terminal (ssh, gnome-terminal, etc)
2. ls -l /dev/pts, note group ownership.
3. as root: mount -oremount /dev/pts
4. repeat steps 1/2 and note difference.

Actual Results:  /dev/pts/* are owned by users' primary groups.

Expected Results:  /dev/pts/* should be owned by group tty.

Additional info:

Comment 1 Bill Nottingham 2003-11-17 20:05:50 UTC
Can you attach your /etc/fstab? It works for me.

Comment 2 Gerald Britton 2003-11-17 20:37:03 UTC
I've seen this on 2 machines sofar, here's the fstab from one:

LABEL=/                 /                       ext3   
noatime,commit=600   1 1
none                    /dev/pts                devpts  gid=5,mode=620
 0 0
LABEL=/home             /home                   ext3   
noatime,commit=600   1 2
none                    /proc                   proc    defaults     
  0 0
none                    /dev/shm                tmpfs   defaults     
  0 0
/dev/hda3               /suspend                vfat    defaults     
  0 0
/dev/hda5               swap                    swap    defaults     
  0 0
/dev/cdrom              /mnt/cdrom              udf,iso9660
noauto,owner,kudzu,ro 0 0

I boot, login in X and open 3 gnome terminals, ls -l /dev/pts:

crw--w----    1 gbritton gbritton 136,   0 Nov 17 15:35 0
crw--w----    1 gbritton gbritton 136,   1 Nov 17 15:35 1
crw--w----    1 gbritton gbritton 136,   2 Nov 17 15:35 2

su and run "mount -oremount /dev/pts" then close and re-open 3
gnome terminals, ls -l /dev/pts:

crw--w----    1 gbritton tty      136,   0 Nov 17 15:36 0
crw--w----    1 gbritton tty      136,   1 Nov 17 15:36 1
crw--w----    1 gbritton tty      136,   2 Nov 17 15:36 2



Comment 3 Bill Nottingham 2003-11-17 20:58:44 UTC
Ah, sshd sets the perms itself even if the filesystem doesn't, that's
why I wasn't seeing it. :)

Comment 4 Bill Nottingham 2003-11-17 21:15:20 UTC
Fixed in 7.42.1-1.