Bug 221181

Summary: exportfs doesn't produce any output
Product: Red Hat Enterprise Linux 5 Reporter: Jeff Layton <jlayton>
Component: selinux-policy-targetedAssignee: Daniel Walsh <dwalsh>
Status: CLOSED CURRENTRELEASE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.0CC: coughlan, steved
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RC Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-02-08 02:05: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:

Description Jeff Layton 2007-01-02 19:26:56 UTC
The latest version of exportfs in both rhel5 beta and in fc6 doesn't produce any
output. Some sample output:

# showmount -e
Export list for foo.example.com:
/scratch bar.example.com
# exportfs

...the really odd thing is that if I do:

# exportfs | cat
/scratch        bar.example.com

then I get output, so it seems to be something with the output being to a terminal.

Comment 2 RHEL Program Management 2007-01-02 19:40:38 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 3 Jeff Layton 2007-01-02 20:09:30 UTC
This is starting to look like a packaging issue. I rebuilt the package on my
workstation and installed it, and it did the exact same thing (no output). Then,
when I go down into the actual build tree and use the unstripped exportfs
binary, it works fine.

If I strip and prelink the binary, it still works fine, so it doesn't seem like
that's the problem.

Also, I'm testing this on x86_64, need to get a normal x86 box and see if it
shows the same problem.


Comment 4 Jeff Layton 2007-01-02 20:55:54 UTC
i386 on rhel5 seems to show the same issue, but i386 on fc6 does not.



Comment 5 Jeff Layton 2007-01-02 22:16:38 UTC
excerpt from strace of "failing" exportfs command:

fstat64(1, {st_mode=S_IFCHR|0666, st_rdev=makedev(1, 3), ...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfd5f6f0) = -1 ENOTTY (Inappropriate
ioctl for device)
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xb7f6a000
write(1, "/scratch      \ttleilax.poochiere"..., 107) = 107
exit_group(0)                           = ?

excerpt from strace of "working" exportfs command:

fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xb7f18000
write(1, "/scratch      \ttleilax.poochiere"..., 39/scratch            
tleilax.poochiereds.net
) = 39
exit_group(0)                           = ?

I think the fstat and ioctl discrepancy is what's at issue here.


Comment 6 Jeff Layton 2007-01-03 18:44:49 UTC
The issue seems to be due to selinux.

When I run "setenforce 0", then it works just fine. I'm not getting any avc
messages in the ring buffer, however so it's not clear to me that this is a
policy issue.


Comment 7 Daniel Walsh 2007-01-05 21:44:06 UTC
Fixed in  selinux-policy-2.4.6-24

You should be able to chcon -t sbin_t /usr/sbin/exportfs


Comment 9 RHEL Program Management 2007-02-08 02:05:51 UTC
A package has been built which should help the problem described in 
this bug report. This report is therefore being closed with a resolution 
of CURRENTRELEASE. You may reopen this bug report if the solution does 
not work for you.