X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=fs%2Fposix_acl.c;h=39df95a0ec25edc87e7c3e29aef2b9a707f95f9f;hb=01a05b337a5b647909e1d6670f57e7202318a5fb;hp=6c8dcf7613fd89bf903a95b311af8a1eee2bf8ce;hpb=dd0fc66fb33cd610bc1a5db8a5e232d34879b4d7;p=safe%2Fjmp%2Flinux-2.6 diff --git a/fs/posix_acl.c b/fs/posix_acl.c index 6c8dcf7..39df95a 100644 --- a/fs/posix_acl.c +++ b/fs/posix_acl.c @@ -58,11 +58,9 @@ posix_acl_clone(const struct posix_acl *acl, gfp_t flags) if (acl) { int size = sizeof(struct posix_acl) + acl->a_count * sizeof(struct posix_acl_entry); - clone = kmalloc(size, flags); - if (clone) { - memcpy(clone, acl, size); + clone = kmemdup(acl, size, flags); + if (clone) atomic_set(&clone->a_refcount, 1); - } } return clone; } @@ -219,11 +217,11 @@ posix_acl_permission(struct inode *inode, const struct posix_acl *acl, int want) switch(pa->e_tag) { case ACL_USER_OBJ: /* (May have been checked already) */ - if (inode->i_uid == current->fsuid) + if (inode->i_uid == current_fsuid()) goto check_perm; break; case ACL_USER: - if (pa->e_id == current->fsuid) + if (pa->e_id == current_fsuid()) goto mask; break; case ACL_GROUP_OBJ: