Fixed clearing setgid if file group does not match process group

N2009_11_14_FIXES
jpandre 2007-11-06 16:39:24 +00:00
parent 90aaeea4ac
commit afb21cdd92
1 changed files with 6 additions and 0 deletions

View File

@ -3285,6 +3285,12 @@ int ntfs_set_mode(struct SECURITY_CONTEXT *scx,
if (!res) {
uid = scx->uid;
if (!uid || (fileuid == uid)) {
/*
* clear setgid if file group does
* not match process group
*/
if (uid && (filegid != scx->gid))
mode &= ~S_ISGID;
ntfs_set_owner_mode(scx, ni,
fileuid, filegid, mode);
} else {