security: have cap_dentry_init_security return error
authorJeff Layton <jlayton@redhat.com>
Wed, 5 Mar 2014 17:47:37 +0000 (12:47 -0500)
committerJames Morris <james.l.morris@oracle.com>
Fri, 7 Mar 2014 00:50:01 +0000 (11:50 +1100)
commitd4a141c8e77043bd674dd6aa0b40bc3675cb7b1d
treec2316156f377d13be833690ebc06b7c3719b24f0
parent864f32a52b53341c54a25953afb5b66ed79a7f76
security: have cap_dentry_init_security return error

Currently, cap_dentry_init_security returns 0 without actually
initializing the security label. This confuses its only caller
(nfs4_label_init_security) which expects an error in that situation, and
causes it to end up sending out junk onto the wire instead of simply
suppressing the label in the attributes sent.

When CONFIG_SECURITY is disabled, security_dentry_init_security returns
-EOPNOTSUPP. Have cap_dentry_init_security do the same.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
security/capability.c