Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d4a141c8 authored by Jeff Layton's avatar Jeff Layton Committed by James Morris
Browse files

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: default avatarJeff Layton <jlayton@redhat.com>
Acked-by: default avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: default avatarJames Morris <james.l.morris@oracle.com>
parent 864f32a5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)