Bug 236746

Summary: xfs_quota tries to open devicefiles & pipes
Product: [Fedora] Fedora Reporter: Leo Baltus <leo.baltus>
Component: xfsprogsAssignee: Eric Sandeen <esandeen>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6CC: donaldd, esandeen
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.8.21-1.fc7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-08-24 05:36:09 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:
Attachments:
Description Flags
Fixes input of a projectid which starts whith a digit
none
Fixes this bug (for me) none

Description Leo Baltus 2007-04-17 14:39:29 UTC
Description of problem:
xfs_quota -x -c "project -s $name" opens divices pipes etc., not smart

Version-Release number of selected component (if applicable):
2.8.11

How reproducible:
always.


Steps to Reproduce:
cat <<eof >/etc/projects
1:/d/1/foo
eof

cat <<eof >/etc/projid
bar:1
eof
mkdir -p /d/1
mklv --size 1G  -n quotatest rootvg
mkfs -t xfs -f /dev/rootvg/quotatest
mount -o prjquota /dev/rootvg/quotatest /d/1
mkdir -p /d/1/foo
mknod /d/1/foo/null c 1 3
mknod /d/1/foo/pipe p 
xfs_quota -x -c 'project -s naam1' /d/1
xfs_quota: cannot get flags on /d/1/foo/null: Inappropriate ioctl for device
<xfs_quota hangs on pipe>

strace:
open("/d/1/foo/pipe", O_RDONLY|O_NOCTTY|O_LARGEFILE <unfinished ...>

  
Actual results:


Expected results:


Additional info:

Comment 1 Leo Baltus 2007-04-18 16:26:09 UTC
Created attachment 152924 [details]
Fixes input of a projectid which starts whith a digit

xfs_quota -x -c "project -s 123foo" would result in a lookup for directories
belonging to project 123

Comment 2 Leo Baltus 2007-04-18 16:28:52 UTC
Created attachment 152925 [details]
Fixes this bug (for me)

I have added a lstat and a check routine to prevent devices, sockets, fifos and
symlinks from beeing opened, instead it reports
xfs_quota: skipping special file /d/0/foo/bar

Comment 3 Eric Sandeen 2007-04-20 02:44:10 UTC
see also http://oss.sgi.com/bugzilla/show_bug.cgi?id=754

Comment 4 Donald Douwsma 2007-05-17 08:04:44 UTC
This has been fixed upstream. 
Currently available in cvs at oss.sgi.com and will be 
in next xfsprogs tarball. 

Modid:  master-melb:xfs-cmds:28597a
xfsprogs/doc/CHANGES - 1.238 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfsprogs/doc/CHANGES.diff?r1=text&tr1=1.238&r2=text&tr2=1.237&f=h
xfsprogs/quota/project.c - 1.5 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfsprogs/quota/project.c.diff?r1=text&tr1=1.5&r2=text&tr2=1.4&f=h

Comment 5 Eric Sandeen 2007-07-05 19:12:42 UTC
I've put xfsprogs-2.6.21, which containst his fix, into the devel cvs
repository, see http://koji.fedoraproject.org/koji/buildinfo?buildID=10460

I'll get it out to FC updates at some point...

Thanks,

-Eric

Comment 6 Fedora Update System 2007-07-27 05:52:25 UTC
xfsprogs-2.8.21-1.fc7 has been pushed to the Fedora 7 testing repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2007-08-24 05:36:03 UTC
xfsprogs-2.8.21-1.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.