MORE Strip unused FSAL access check routines

Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Remove unused FSAL_OWNER_OK flag

This flag was originally implemented to allow permission checking to evaluate
the conditions where the file owner is allowed access despite the mode or ACL.
This condition is now evaluated directly for I/O operations.

Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Remove unused FSAL_F_OK flag

Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Add some debug to cache_inode_access

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

Conflicts:

	src/Cache_inode/cache_inode_access.c
Add fsal_set_credentials to fsal_symlink for FSAL_GPFS

Use fsal_set_credentials to avoid needing to chown the symlink.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Allow root execute permission if someone is allowed execute

For mode check, test is simple.

For ACL check, if we are looking for execute permission for root,
we walk the ACL, and consider ANY ACE as applicable, however, we
then ignore a DENY ACE.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Add allowed and denied parms to fsal_test_access and fsal_check_access

These parms allow access check to return the specific access mask bits
that were allowed and denied if the caller desires.

These will be used by cache inode permission checking to make some
more complex decisions, also, it will allow the protocol ACCESS routines
to make a single access check and be able to identify which bits should
be returned to the client.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Make getattr optional with cache_inode_lookup and cache_inode_create

Not all callers of cache_inode_lookup need the attributes and we
are going to check permissions on getattr so it will be good to
not ask for them if we won't use them.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Don't get attr via nfs_FhandleToCache if we don't need them

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Properly permission check cache_inode_readdir

Do not provide handle or attributes if directory does not have SEARCH permission.

Do not provide ACL for a file if file does not have READ_ACL permission.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Properly permission check cache_inode_getattr

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Properly permission check cache_inode_lookup

Also check object type correctly.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Properly permission check cache_inode_create

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Properly permission check cache_inode_link

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
NEEDS WORK Properly permission check cache_inode_remove

This still needs work because also have to permission
check the file, and check S_ISVTX

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Use cache_inode_access_no_mutex wrapper instead of calling cache_inode_access_sw

These two external callers of cache_inode_access_sw make the same call as
cache_inode_access_no_mutex, making use of that wrapper will simplify some
later patches.

Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Make cache_inode_access_sw wrappers static inline

Signed-off-by: Frank S. Filz <ffilz@us.ibm.com>
Add allowed and denied parms to cache_inode_access_sw

These parms allow access check to return the specific access mask bits
that were allowed and denied if the caller desires.

These will be used by high level permission checking to make some
more complex decisions, also, it will allow the protocol ACCESS routines
to make a single access check and be able to identify which bits should
be returned to the client.

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