[Labeled-nfs] [PATCH 6/7] NFSv4: Client implementation of MAC Labeling
James Morris
jmorris at namei.org
Wed Aug 1 23:37:11 EDT 2007
On Wed, 1 Aug 2007, David P. Quigley wrote:
> +#ifdef CONFIG_NFS_V4_MAC
> + if ((fattr->valid & NFS_ATTR_FATTR_V4) &&
> + (fattr->bitmap[1] & FATTR4_WORD1_MAC_LABEL)) {
> + security_inode_setsecid(inode, fattr->secid);
> + }
> +#endif /* CONFIG_NFS_V4_MAC */
Turn this into a static inline & reuse it, then it can be compiled away
cleanly for !CONFIG_NFS_V4_MAC.
> + if (security_secctx_to_secid(sid, (char *)p, len) != 0)
> + dprintk("%s: security_decode_secid failed!\n",
> + __FUNCTION__);
Standard form is:
err = foo();
if (err)
bar();
And then you can print the error code, too.
--
James Morris
<jmorris at namei.org>
More information about the Labeled-nfs
mailing list