summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1994-11-26 19:38:30 +0000
committerbde <bde@FreeBSD.org>1994-11-26 19:38:30 +0000
commitb4ceae7bef5616ca5cff4a41d5cefbedf5e7c015 (patch)
tree2743631bd400040c78ef73333622c02221829d36 /sys
parent7b27d125c6b51c82ff2e01daed9974f75fd47ca0 (diff)
downloadFreeBSD-src-b4ceae7bef5616ca5cff4a41d5cefbedf5e7c015.zip
FreeBSD-src-b4ceae7bef5616ca5cff4a41d5cefbedf5e7c015.tar.gz
Submitted by: Kirk McKusick
Allow chown() to return success if the gid isn't changed even if the gid is not the caller's. Such gids are normal for files created in world-writable directories sucj as /tmp. This "fixes" annoying error messages for mv'ing files created in /tmp to another file system. mv still preserves the foreign gid of /tmp, but now does it silently.
Diffstat (limited to 'sys')
-rw-r--r--sys/ufs/ufs/ufs_vnops.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 4651b87..7a65de4 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_vnops.c 8.10 (Berkeley) 4/1/94
- * $Id: ufs_vnops.c,v 1.11 1994/10/15 04:14:23 ache Exp $
+ * $Id: ufs_vnops.c,v 1.12 1994/10/21 01:19:25 wollman Exp $
*/
#include <sys/param.h>
@@ -477,7 +477,7 @@ ufs_chown(vp, uid, gid, cred, p)
* the caller must be superuser or the call fails.
*/
if ((cred->cr_uid != ip->i_uid || uid != ip->i_uid ||
- !groupmember((gid_t)gid, cred)) &&
+ (gid != ip->i_gid && !groupmember((gid_t)gid, cred))) &&
(error = suser(cred, &p->p_acflag)))
return (error);
ogid = ip->i_gid;
OpenPOWER on IntegriCloud