From nobody@FreeBSD.org  Thu Jul 22 08:43:11 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id CC56416A4CF
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 22 Jul 2004 08:43:11 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id C314443D48
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 22 Jul 2004 08:43:11 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i6M8hBxc003618
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 22 Jul 2004 08:43:11 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id i6M8hBxG003617;
	Thu, 22 Jul 2004 08:43:11 GMT
	(envelope-from nobody)
Message-Id: <200407220843.i6M8hBxG003617@www.freebsd.org>
Date: Thu, 22 Jul 2004 08:43:11 GMT
From: Matthias Schuendehuette <msch@snafu.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: chown(8) not possible on NFS Filesystems from a FreeBSD Server
X-Send-Pr-Version: www-2.3

>Number:         69420
>Category:       kern
>Synopsis:       chown(8) not possible on NFS Filesystems from a FreeBSD Server
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 22 08:50:27 GMT 2004
>Closed-Date:    Thu Jul 22 15:07:15 GMT 2004
>Last-Modified:  Thu Jul 22 15:07:15 GMT 2004
>Originator:     Matthias Schuendehuette
>Release:        FreeBSD 5.2.1-RELEASE-p9
>Organization:
SIEMENS AG
>Environment:
FreeBSD blnn719x.ww004.siemens.net 5.2.1-RELEASE-p9 FreeBSD 5.2.1-RELEASE-p9 #2: Fri Jul  2 09:50:02 CEST 2004     root@blnn719x.ww004.siemens.net:/usr/obj/usr/src/sys/BLNN719X  i386

>Description:
If I try as an ordinary user to chown(8) a file which is owned by that user, the (FreeBSD-) NFS-Server responds with 'not owner' and refuses the change of ownership.

It works as 'root' if root-access is enabled on that filesystem.
chmod(1) and chgrp(1) are working as expected.

I tested on NFS-Servers with FreeBSD 4.10-STABLE, 5.2.1-RELEASE-p9 and 5.2-CURRENT (of Jul 20, 2004) and HP-UX 11.11 - the HP-UX Server behaves as expected and lets a user change the ownership of his files.

I have libpcap-format networktraces of the SETATTR call&reply available for NFSv2 and NFSv3. Especially with NFSv3 one can see the RPC-credentials (UID) and the unchanged UID of the fileowner in question - they are explicitly the same. The returncode of the SETATTR-call is ERR_PERM(1).

Priority is 'high' because this occurs on two production servers :-(
>How-To-Repeat:
Mount a filesystem from a FreeBSD-Server and try (as a non-root user) to change the ownership of your files,  
>Fix:
      
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: ceri 
State-Changed-When: Thu Jul 22 15:06:13 GMT 2004 
State-Changed-Why:  
This is a BSD semantic - see the manual page for chown(2). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=69420 
>Unformatted:
