From owner-freebsd-fs@FreeBSD.ORG Sat Apr 12 10:06:45 2003 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5207E37B401 for ; Sat, 12 Apr 2003 10:06:45 -0700 (PDT) Received: from mistral.imasy.or.jp (flets22-023.kamome.or.jp [218.45.22.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id AD65F43FB1 for ; Sat, 12 Apr 2003 10:06:43 -0700 (PDT) (envelope-from mistral@imasy.or.jp) Received: from mistral.imasy.or.jp (localhost [IPv6:::1]) h3CH6eVl001532 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 13 Apr 2003 02:06:40 +0900 (JST) (envelope-from mistral@imasy.or.jp) Received: (from sarumaru@localhost) by mistral.imasy.or.jp (8.12.9/8.12.9/Submit) id h3CH6dAJ001531; Sun, 13 Apr 2003 02:06:39 +0900 (JST) (envelope-from sarumaru) From: mistral@imasy.or.jp (Yoshihiko Sarumaru) To: fs@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Mailer: mnews [version 1.22PL5] 2001-02/07(Wed) Date: Sun, 13 Apr 2003 02:06:39 +0900 Message-ID: <030413020639.M0101472@mistral.imasy.or.jp> cc: mistral@imasy.or.jp Subject: time stamp on msdosfs could not be set by general user X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2003 17:06:45 -0000 Hello, I've been wondering why cp -p files to msdosfs complains like this: mistral% cp -p somefile /dos/ cp: utimes: /dos/somefile: Operation not permitted cp: chmod: /dos/somefile: Operation not permitted I can understand errors about chmod, but I can not understand errors about utimes and modified time could not be set at all. This behavior is controllable by changing owner of mount point, but I feel this is unreasonable. Below patch ignores unmatching of user and file owner, and it imply this block will be always ignored. Comment out with #if 0 ~ #endif may better. Any objection ? --- sys/msdosfs/msdosfs_vnops.c.orig Wed Jan 1 23:38:45 2003 +++ sys/msdosfs/msdosfs_vnops.c Sun Apr 13 01:41:01 2003 @@ -498,9 +498,9 @@ } if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL) { if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); - if (cred->cr_uid != pmp->pm_uid && + if (/* cred->cr_uid != pmp->pm_uid */ 0 && (error = suser_xxx(cred, ap->a_p, PRISON_ROOT)) && ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || (error = VOP_ACCESS(ap->a_vp, VWRITE, cred, ap->a_p)))) return (error); -- Yoshihiko Sarumaru mail: mistral@imasy.or.jp web: http://www.imasy.or.jp/~mistral/