Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Apr 2003 02:06:39 +0900
From:      mistral@imasy.or.jp (Yoshihiko Sarumaru)
To:        fs@FreeBSD.org
Cc:        mistral@imasy.or.jp
Subject:   time stamp on msdosfs could not be set by general user
Message-ID:  <030413020639.M0101472@mistral.imasy.or.jp>

next in thread | raw e-mail | index | archive | help
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/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?030413020639.M0101472>