From d766714986a8b0040c9f1b0d1686fe12239dd9f5 Mon Sep 17 00:00:00 2001 From: jpandre Date: Fri, 14 Mar 2008 09:13:30 +0000 Subject: [PATCH] Fixed processing of security options --- libntfs-3g/security.c | 6 +++--- src/ntfs-3g.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libntfs-3g/security.c b/libntfs-3g/security.c index 41edadc5..32449de8 100644 --- a/libntfs-3g/security.c +++ b/libntfs-3g/security.c @@ -1821,7 +1821,7 @@ static BOOL groupmember(struct SECURITY_CONTEXT *scx, uid_t uid, gid_t gid) gid_t grp; pid_t tid; - if (scx->vol->flags & (1 << SECURITY_STATICGRPS)) + if (scx->vol->secure_flags & (1 << SECURITY_STATICGRPS)) ismember = staticgroupmember(scx, uid, gid); else { ismember = FALSE; /* default return */ @@ -3229,7 +3229,7 @@ static int ntfs_get_perm(struct SECURITY_CONTEXT *scx, */ if (!test_nino_flag(ni, v3_Extensions) && (perm >= 0) - && (scx->vol->flags + && (scx->vol->secure_flags & (1 << SECURITY_ADDSECURIDS))) { upgrade_secur_desc(scx->vol, path, securattr, ni); @@ -3315,7 +3315,7 @@ int ntfs_get_owner_mode(struct SECURITY_CONTEXT *scx, * and upgrade option is selected */ if (!test_nino_flag(ni, v3_Extensions) - && (scx->vol->flags + && (scx->vol->secure_flags & (1 << SECURITY_ADDSECURIDS))) { upgrade_secur_desc(scx->vol, path, securattr, ni); diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c index 9a9f05b3..a57e8607 100644 --- a/src/ntfs-3g.c +++ b/src/ntfs-3g.c @@ -2663,9 +2663,9 @@ int main(int argc, char *argv[]) ctx->security.gid = ctx->gid; ctx->vol->secure_flags = 0; if (ctx->addsecurids && !ctx->ro) - ctx->vol->secure_flags = (1 << SECURITY_ADDSECURIDS); + ctx->vol->secure_flags |= (1 << SECURITY_ADDSECURIDS); if (ctx->staticgrps) - ctx->vol->secure_flags = (1 << SECURITY_STATICGRPS); + ctx->vol->secure_flags |= (1 << SECURITY_STATICGRPS); /* JPA open $Secure, (whatever NTFS version !) */ /* to initialize security data */ if (ntfs_open_secure(ctx->vol) && (ctx->vol->major_ver >= 3))