From 1c93e2a97d4bb88450521a4fac98d498305d3b64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Wed, 21 Mar 2012 18:52:07 +0100 Subject: [PATCH] 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. --- libntfs-3g/security.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libntfs-3g/security.c b/libntfs-3g/security.c index efef3ace..0c676b66 100644 --- a/libntfs-3g/security.c +++ b/libntfs-3g/security.c @@ -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);