mirror of
https://git.code.sf.net/p/ntfs-3g/ntfs-3g.git
synced 2024-11-23 10:04:00 +08:00
Fixed returning EPERM when not allowed as owner
For actions which may be allowed depending on the ownership rather than permissions (such as utime()), return EPERM if the owner cannot be determined.
This commit is contained in:
parent
314b5396bd
commit
aa7af7d53b
@ -3048,12 +3048,12 @@ BOOL ntfs_allowed_as_owner(struct SECURITY_CONTEXT *scx, ntfs_inode *ni)
|
|||||||
free(oldattr);
|
free(oldattr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
allowed = FALSE;
|
|
||||||
if (gotowner) {
|
|
||||||
/* TODO : use CAP_FOWNER process capability */
|
/* TODO : use CAP_FOWNER process capability */
|
||||||
if (!processuid || (processuid == uid))
|
if (gotowner
|
||||||
|
&& (!processuid || (processuid == uid)))
|
||||||
allowed = TRUE;
|
allowed = TRUE;
|
||||||
else
|
else {
|
||||||
|
allowed = FALSE;
|
||||||
errno = EPERM;
|
errno = EPERM;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user