Bug 133941

Summary: patch to add console option to mount(1) and umount(1)
Product: [Fedora] Fedora Reporter: David Zeuthen <davidz>
Component: util-linuxAssignee: Elliot Lee <sopwith>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: mattdm, mclasen, mishu
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-15 13:29:51 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: 133584    
Attachments:
Description Flags
Patch to add 'console' option to mount(1) and umount(1)
none
New console patch adding a null check and fixing the snprintf
none
Missed a bracket in the if
none
More robust console patch none

Description David Zeuthen 2004-09-28 15:51:38 UTC
As discussed in bug 133584 a more secure way to allow access to
storage devices attached to the system near the console is to add a
'console' option that can appear in the /etc/fstab file. This option
works like the 'user' option but additionally requires that the user
is at the console. Will attach patch that does this.

Comment 1 David Zeuthen 2004-09-28 15:54:01 UTC
Created attachment 104443 [details]
Patch to add 'console' option to mount(1) and umount(1)

Please review and rebuild. I've rebuilt the latest util-linux RPM from Rawhide
with this patch by adding it as the last patch. With my testing the patch
appears to work.

Comment 2 David Zeuthen 2004-09-29 22:35:37 UTC
Rebuilt into beehive packages hal that adds 'console' instead of
'user' and gnome-vfs2 package that understands 'console'. Need this
patch for FC3t3.

Comment 3 Alan Cox 2004-09-30 16:15:15 UTC
Patch is buggy. Can end up snprintf'ing a NULL pointer.


Comment 4 Steve Grubb 2004-09-30 17:00:47 UTC
If an admin puts nousers for a device and console, what is the
expected behavior?

Does noconsole need to be added?

NOTE - there is no check that the user is at the console in the umount
section! 

Should the patch also update the man page?

Comment 5 John (J5) Palmieri 2004-09-30 17:24:14 UTC
Created attachment 104593 [details]
New console patch adding a null check and fixing the snprintf

This patch fixes the previous patch by adding a null check to getusername() and
removing the unneeded subtraction of one from the size argument of snprintf.

Comment 6 John (J5) Palmieri 2004-09-30 17:29:23 UTC
Created attachment 104594 [details]
Missed a bracket in the if

Add an opening bracket for the null check.

Comment 7 John (J5) Palmieri 2004-09-30 18:49:43 UTC
Created attachment 104597 [details]
More robust console patch

Good catch Steve.  New patch changes the flag name from console to pamconsole,
adds a nopamconsole flag, and checks for pamconsole in umount.	I also added
the option to the fstab man file.

Comment 8 David Zeuthen 2004-10-15 13:29:51 UTC
The patch is in util-linux-2.12a-16 which is in Rawhide so I'm closing
this bug.