Make Mount use per client export permissions

Also simplify code, export now has terminating / in
full path, and just always use terminated mount path.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Add flags to export_perms to indicate all access

Make the flags in export perms indicate all of the
four types of access allowed, IO Write, IO Read,
MD Write, MD Read.

This will make NFSv4 permission checking easier.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Make putrootfh and putpubfh mostly the same for sanity

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Remove security checks from NFS4 ops

Remove calls to nfs_export_check_security, that will be handled when a
handle is instantiated by PUTFH, PUTROORFH, PUTPUBFH, LOOKUP, LOOKUPP,
OPEN, CREATE, etc.

Remove calls to nfs4_Is_Fh_Pseudo, the pseudo file system is
explicitly MD READ ONLY and has no REGULAR files so none of these
operations will succeed.

However, RENAME and LINK do need to check savedFH to see if IT is in
pseudo file system.

Remove calls to nfs4_SetCompoundExport, that will be handled before
these routines are called.

Annotate places where currentFH is updated and we do not need to
call nfs4_SetCompoundExport because the new currentFH MUST be on the
same export as the old currentFH (which is a parent directory).

Also remove some redundant setting of data->current_entry and
data->current_filetype since they were set in nfs4_create_fh.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Add saved_pexport and saved_export_perms

It simplifies things if we save pexport and export_perms when a
file handle is saved or restored if pexport and export_perms go with
it.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Add routine to set_compound_data_for_pseudo

This routine fills in compound data fields when a pseudo fs handle is
made currentFH:

data->current_entry
data->current_filetype
data->pexport
data->export_perms.options

Also clean up some return code issues in Protocols/NFS/nfs4_pseudo.c
and remove some unecessary casts to make finding code that affects
currentFH easier.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Clean up nfs4_SetCompoundExport and make nfs4_MakeCred check export perms

PUTFH is now the only consumer of nfs4_SetCompoundExport. PUTFH should
always call nfs4_SetCompoundExport when putting a non-pseudo fs handle
into currentFH.

nfs4_MakeCred now checks all the per export permissions other than
READ, WRITE, MD_WRITE, and MD_READ.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Check READ, WRITE, MD_WRITE, and MD_READ in nfs4_Compound

The compound operations array now includes a flag field indicating
which export permissions from READ, WRITE, MD_WRITE, and MD_READ
are used by the operation.

OPEN needs additional checking if OPEN4_CREATE is set for the
operation, so that is done inside.

SECINFO needs to get the security flavors available to the client
from data->export_perms instead of from data->pexport->export_perms.
SECINFO also needs to use nfs4_op_lookup_pseudo more carefully,
that routine should return NFS4ERR_WRONGSEC, which of course is
ok, that's why SECINFO was called, so we need to proceed and
return the information.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Improve export error checking, don't allow dup path, export_id, or tag

Also make sure all options that are only allowed once are checked
for duplicate even if the first instance was bad, for example

Also, make sure message at end of processing an EXPORT or EXPORT_CLIENT
stanza with errors is clear that the entry will be ignored.

SecType = "this_is_bad";
SecType = "sys";

Will flag the second entry as a duplicate

Signed-off-by: Frank Filz <ffilz@us.ibm.com>