Skip to contentSkip to conversation

/etc/exports parsing is borked again in nfs-utils

DISCUSSION Trond Myklebust 2 participants 5 messages Jun 25, 2016 – Jul 5, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

W3Jvb3RAbGVpcmEgbmZzXSMgY2F0IC9ldGMvZXhwb3J0cw0KL2V4cG9ydAkJLXJvLHNlYz1zeXMs c3luYwlsb2NhbGhvc3Qocncsbm9fcm9vdF9zcXUNCmFzaCkNCltyb290QGxlaXJhIG5mc10jIGV4 cG9ydGZzIC1ydg0KZXhwb3J0aW5nIGxvY2FsaG9zdDovZXhwb3J0DQpbcm9vdEBsZWlyYSBuZnNd IyBtb3VudCAtdCBuZnMgbG9jYWxob3N0Oi9leHBvcnQgL21udC9uZnMNCltyb290QGxlaXJhIG5m c10jIG1rZGlyIC9tbnQvbmZzL2dudXJyDQpta2RpcjogY2Fubm90IGNyZWF0ZSBkaXJlY3Rvcnkg 4oCYL21udC9uZnMvZ251cnLigJk6IFJlYWQtb25seSBmaWxlIHN5c3RlbQ0KDQoNCk5vdGUgdGhh dCByZW1vdmluZyB0aGUgInNlYz1zeXMiIGFib3ZlIGNhdXNlcyB0aGUgdGVzdCB0byBzdWNjZWVk Lg0KDQotLSANCg0KVHJvbmQgTXlrbGVidXN0DQpMaW51eCBORlMgY2xpZW50IG1haW50YWluZXIs IFByaW1hcnlEYXRhDQp0cm9uZC5teWtsZWJ1c3RAcHJpbWFyeWRhdGEuY29tDQo=

#1 lore raw
Quoted 11 lines · Trond Myklebust

[root@leira nfs]# cat /etc/exports
/export -ro,sec=sys,sync localhost(rw,no_root_squ
ash)
[root@leira nfs]# exportfs -rv
exporting localhost:/export
[root@leira nfs]# mount -t nfs localhost:/export /mnt/nfs [root@leira nfs]# mkdir /mnt/nfs/gnurr
mkdir: cannot create directory ‘/mnt/nfs/gnurr’: Read-only file system

Note that removing the "sec=sys" above causes the test to succeed.

When you say "succeed" what do you mean by that since your are specifying both 'ro' and 'rw'.

steved.

#2 lore raw
Quoted 16 lines · Steve Dickson
Quoted 10 lines · Trond Myklebust

[root@leira nfs]# cat /etc/exports
/export -ro,sec=sys,sync localhost(rw,no_root_squ
ash)
[root@leira nfs]# exportfs -rv
exporting localhost:/export
[root@leira nfs]# mount -t nfs localhost:/export /mnt/nfs [root@leira nfs]# mkdir /mnt/nfs/gnurr
mkdir: cannot create directory ‘/mnt/nfs/gnurr’: Read-only file system

Quoted 3 lines
Quoted 1 line

Note that removing the "sec=sys" above causes the test to succeed.

When you say "succeed" what do you mean by that since your are specifying both 'ro' and 'rw’.

I expect the default option specification (i.e. ‘ro’) to be overridden by the host-specific option. That’s how it used to work, and I know, because I had to fix it once already.

Cheers
Trond

#3 lore raw
In reply to Trond Myklebust
Quoted 10 lines · Trond Myklebust

[root@leira nfs]# cat /etc/exports
/export -ro,sec=sys,sync localhost(rw,no_root_squ
ash)
[root@leira nfs]# exportfs -rv
exporting localhost:/export
[root@leira nfs]# mount -t nfs localhost:/export /mnt/nfs [root@leira nfs]# mkdir /mnt/nfs/gnurr
mkdir: cannot create directory ‘/mnt/nfs/gnurr’: Read-only file system

Quoted 2 lines

Note that removing the "sec=sys" above causes the test to succeed.

Well it has something to do with

commit 9b5c3c6a6571a265a90cfce30345891fac24a67c

Author: Trond Myklebust <[email protected]>
Date:   Wed Sep 18 11:50:58 2013 -0400

exportfs: insecure/secure should be a secinfo_flag

Because I commit out the call to secinfo_flags_show(), the export is exported correctly... still looking...

steved.

#4 lore raw
Quoted 17 lines · Steve Dickson
Quoted 10 lines · Trond Myklebust

[root@leira nfs]# cat /etc/exports
/export -ro,sec=sys,sync localhost(rw,no_root_squ
ash)
[root@leira nfs]# exportfs -rv
exporting localhost:/export
[root@leira nfs]# mount -t nfs localhost:/export /mnt/nfs [root@leira nfs]# mkdir /mnt/nfs/gnurr
mkdir: cannot create directory ‘/mnt/nfs/gnurr’: Read-only file system

Quoted 2 lines

Note that removing the "sec=sys" above causes the test to succeed.

Well it has something to do with

Quoted 8 lines

commit 9b5c3c6a6571a265a90cfce30345891fac24a67c

Author: Trond Myklebust <[email protected]>
Date:   Wed Sep 18 11:50:58 2013 -0400

exportfs: insecure/secure should be a secinfo_flag

Because I commit out the call to secinfo_flags_show(), the export is exported correctly... still looking...

It turns out the problem has nothing to do that commit because the export flags that are being passed to it are wrong.

When the sec= specified in the default options the flags stored in the e_secinfo are the default export flags and are not being updated by the host-specific options.

I'm not sure how this ever worked... :-(

steved.