X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=fs%2Fafs%2Fsecurity.c;h=bb4ed144d0e446c627fb8b4e391664058d094b87;hb=36e15263aa5dcf3b72f1f88437e69497782b7ab8;hp=e0ea88b63ebf429e7d2ec45c7f6377b24ab27364;hpb=416351f28d2b31d15ff73e9aff699b2163704c95;p=safe%2Fjmp%2Flinux-2.6 diff --git a/fs/afs/security.c b/fs/afs/security.c index e0ea88b..bb4ed14 100644 --- a/fs/afs/security.c +++ b/fs/afs/security.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include "internal.h" @@ -94,7 +95,7 @@ static struct afs_vnode *afs_get_auth_inode(struct afs_vnode *vnode, auth_inode = afs_iget(vnode->vfs_inode.i_sb, key, &vnode->status.parent, NULL, NULL); if (IS_ERR(auth_inode)) - return ERR_PTR(PTR_ERR(auth_inode)); + return ERR_CAST(auth_inode); } auth_vnode = AFS_FS_I(auth_inode); @@ -188,8 +189,9 @@ void afs_cache_permit(struct afs_vnode *vnode, struct key *key, long acl_order) if (!permits) goto out_unlock; - memcpy(permits->permits, xpermits->permits, - count * sizeof(struct afs_permit)); + if (xpermits) + memcpy(permits->permits, xpermits->permits, + count * sizeof(struct afs_permit)); _debug("key %x access %x", key_serial(key), vnode->status.caller_access); @@ -283,10 +285,10 @@ static int afs_check_permit(struct afs_vnode *vnode, struct key *key, * - AFS ACLs are attached to directories only, and a file is controlled by its * parent directory's ACL */ -int afs_permission(struct inode *inode, int mask, struct nameidata *nd) +int afs_permission(struct inode *inode, int mask) { struct afs_vnode *vnode = AFS_FS_I(inode); - afs_access_t access; + afs_access_t uninitialized_var(access); struct key *key; int ret;