Avoided setuid/setgid removal by chown on OpenIndiana

On OpenIndiana, it is not customary to remove the setuid/setgid flags
when doing a chown, so comply with the local rules.
This commit is contained in:
Jean-Pierre André 2012-03-21 18:52:07 +01:00
parent 319958545e
commit 1c93e2a97d

View File

@ -3546,10 +3546,12 @@ int ntfs_set_owner(struct SECURITY_CONTEXT *scx, ntfs_inode *ni,
uid = fileuid;
if ((int)gid < 0)
gid = filegid;
#if !defined(__sun) || !defined (__SVR4)
/* clear setuid and setgid if owner has changed */
/* unless request originated by root */
if (uid && (fileuid != uid))
mode &= 01777;
#endif
#if POSIXACLS
res = ntfs_set_owner_mode(scx, ni, uid, gid,
mode, pxdesc);