SELinux: pass last path component in may_create
[linux-2.6.git] / security / selinux / hooks.c
index 9e8078a..a6dd2be 100644 (file)
@@ -1579,7 +1579,8 @@ static int may_create(struct inode *dir,
                return rc;
 
        if (!newsid || !(sbsec->flags & SE_SBLABELSUPP)) {
-               rc = security_transition_sid(sid, dsec->sid, tclass, NULL, &newsid);
+               rc = security_transition_sid(sid, dsec->sid, tclass,
+                                            &dentry->d_name, &newsid);
                if (rc)
                        return rc;
        }