Fixed changing mode for files created by standard ntfs-3g

This commit is contained in:
jpandre 2008-06-16 16:21:43 +00:00
parent 767b4d075c
commit d30bd79b02
2 changed files with 16 additions and 14 deletions

View File

@ -1484,7 +1484,7 @@ static int update_secur_descr(ntfs_volume *vol,
ntfs_attr_remove(ni,
AT_SECURITY_DESCRIPTOR,
AT_UNNAMED, 0);
}
}
set_nino_flag(ni, v3_Extensions);
ni->security_id = securid;
ntfs_attr_close(na);
@ -3518,13 +3518,13 @@ int ntfs_set_owner_mode(struct SECURITY_CONTEXT *scx, ntfs_inode *ni,
/* check whether target securid is known in cache */
isdir = (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) != 0;
wanted.uid = uid;
wanted.gid = gid;
wanted.dmode = mode & 07777;
if (isdir) wanted.dmode |= 0x10000;
wanted.variable = (void*)NULL;
wanted.varsize = 0;
if (test_nino_flag(ni, v3_Extensions)) {
wanted.uid = uid;
wanted.gid = gid;
wanted.dmode = mode & 07777;
if (isdir) wanted.dmode |= 0x10000;
wanted.variable = (void*)NULL;
wanted.varsize = 0;
cached = (const struct CACHED_SECURID*)ntfs_fetch_cache(
scx->vol->securid_cache, GENERIC(&wanted),
(cache_compare)compare);

View File

@ -1065,14 +1065,16 @@ static int ntfs_fuse_create(const char *org_path, dev_t typemode, dev_t dev,
* This is not possible for NTFS 1.x, and we will
* have to build a security attribute later.
*/
if (ctx->inherit || !ctx->security.usermapping)
securid = ntfs_inherited_id(&security, dir_path,
if (!ctx->security.usermapping)
securid = 0;
else
if (ctx->inherit)
securid = ntfs_inherited_id(&security, dir_path,
dir_ni, S_ISDIR(type));
else {
securid = ntfs_alloc_securid(&security,
security.uid, security.gid, perm,
S_ISDIR(type));
}
else
securid = ntfs_alloc_securid(&security,
security.uid, security.gid, perm,
S_ISDIR(type));
/* Create object specified in @type. */
switch (type) {
case S_IFCHR: