mirror of
https://git.code.sf.net/p/ntfs-3g/ntfs-3g.git
synced 2024-11-23 18:14:24 +08:00
Fixed changing mode for files created by standard ntfs-3g
This commit is contained in:
parent
767b4d075c
commit
d30bd79b02
@ -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);
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user