From 78bd8350ca5cf739a9a4ba49a9a52647a64ea329 Mon Sep 17 00:00:00 2001 From: jpandre Date: Thu, 13 Dec 2007 17:27:32 +0000 Subject: [PATCH] Fixed a bug when getting permissions for the first time --- libntfs-3g/security.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libntfs-3g/security.c b/libntfs-3g/security.c index 5cbb6988..b3b92148 100644 --- a/libntfs-3g/security.c +++ b/libntfs-3g/security.c @@ -1624,6 +1624,10 @@ static BOOL groupmember(struct SECURITY_CONTEXT *scx, uid_t uid, gid_t gid) * must be kept separately : the interpretation of ACL * in both direction are approximations which could be non * reciprocal for some configuration of the user mapping data + * + * During the process of recompiling ntfs-3g from a tgz archive, + * security processing added 7.6% to the cpu time used by ntfs-3g + * and 30% if the cache is disabled. */ static struct SECURITY_CACHE *create_caches(struct SECURITY_CONTEXT *scx, @@ -3142,9 +3146,10 @@ static int ntfs_get_perm(struct SECURITY_CONTEXT *scx, gid, perm); } free(securattr); - } else + } else { perm = -1; uid = gid = 0; + } } if (perm >= 0) { if (uid == scx->uid)