Skip to content

Commit

Permalink
security: have cap_dentry_init_security return error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff Layton authored and James Morris committed Mar 7, 2014
1 parent 864f32a commit d4a141c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion security/capability.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ static int cap_dentry_init_security(struct dentry *dentry, int mode,
struct qstr *name, void **ctx,
u32 *ctxlen)
{
return 0;
return -EOPNOTSUPP;
}

static int cap_inode_alloc_security(struct inode *inode)
Expand Down

0 comments on commit d4a141c

Please sign in to comment.