Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2026-11-13
18:49 • Closed ticket [1523045fff]: file cmd fails to copy to VFAT plus 5 other chan... artifact: 6839eac734 user: jan.nijtmans
17:32
Fix [1523045fff] and [731062ffff]: [file copy] to a filesystem that cannot store the mode or the tim... check-in: b5e7b93862 user: jan.nijtmans tags: core-8-6-branch
17:30
Fix [1523045fff] and [731062ffff]: [file copy] to a filesystem that cannot store the mode or the tim... check-in: 75e2c580d6 user: jan.nijtmans tags: core-9-0-branch
2026-11-11
14:35
Fix [1523045fff] and [731062ffff]: [file copy] to a filesystem that cannot store the mode or the tim... check-in: 6e7c8299c5 user: jan.nijtmans tags: trunk, main
14:35 • Pending ticket [1523045fff]: file cmd fails to copy to VFAT plus 7 other cha... artifact: 73177a9242 user: jan.nijtmans
14:34 • Closed ticket [731062ffff]: file copy reports "not owner" although rig... artifact: afa69cfb9d user: jan.nijtmans
2026-10-20
21:33 • Ticket [731062ffff]: 3 changes artifact: fb8a999a36 user: serhiy.storchaka
21:33 • Ticket [1523045fff] file cmd fails to copy to VFAT status still Open with 3 ... artifact: b232f71166 user: serhiy.storchaka
2026-10-19
18:59
Fix [1523045fff] and [731062ffff]: [file copy] to a filesystem that cannot store the mode or the tim... closed check-in: 6ffdcda1bf user: serhiy.storchaka tags: copy-eperm-attrs
2006-08-04
00:19 • Ticket [1523045fff] file cmd fails to copy to VFAT status still Open with 2 ... artifact: 15ed65ce90 user: dkf
2006-07-15
12:35 • New ticket [1523045fff]. artifact: afb84fb0e0 user: bernhard_sr

file cmd fails to copy to VFAT

Closed / Fixed1523045fffffffffffffffffffffffffffffffffCreated 20 years agoUpdated 19 days ago
Descriptionplain2006-07-15 12:35:56
On Linux (Kernel 2.6.5-7.111.19, glibc-2.3) copying the
file "short" to a directory on a VFAT filesystem fails,

 file copy short /D/home/bs
 error copying "short" to "/D/home/bs/short": not owner

The actual copying works fine but since the target's
permissions can not be set, the copy is unlinked and an
error is generated afterwards. The strace outputs is

---------------------------------------------
lstat64("short", {st_mode=S_IFREG|0644, st_size=13,
...}) = 0
lstat64("/windows/D/home/bs/short", 0xbfffe5d8) = -1
ENOENT (No such file or di
unlink("/windows/D/home/bs/short")      = -1 ENOENT (No
such file or directory)
open("short", O_RDONLY|O_LARGEFILE)     = 6
open("/windows/D/home/bs/short",
O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0100644)
read(6, "file to copy\n", 4096)         = 13
write(7, "file to copy\n", 13)          = 13
read(6, "", 4096)                       = 0 
close(6)                                = 0
close(7)                                = 0
chmod("/windows/D/home/bs/short", 0644) = -1 EPERM
(Operation not permitted)
chmod("/windows/D/home/bs/short", 0644) = -1 EPERM
(Operation not permitted)   
unlink("/windows/D/home/bs/short")      = 0
write(1, "error copying \"short\" to \"/D/hom"..., 56) = 56
--------------------------------------
Referenced by5
  • b5e7b93862Fix [1523045fff] and [731062ffff]: [file copy] to a filesystem that cannot store the mode or the times (VFAT, CIFS with a fixed owner) failed with "operation not permitted" and removed the copy. Ignore EPERM from chmod() and utime() of the new file, as cp does check-in2026-11-13 17:32:39
  • 75e2c580d6Fix [1523045fff] and [731062ffff]: [file copy] to a filesystem that cannot store the mode or the times (VFAT, CIFS with a fixed owner) failed with "operation not permitted" and removed the copy. Ignore EPERM from chmod() and utime() of the new file, as cp does check-in2026-11-13 17:30:53
  • 6e7c8299c5Fix [1523045fff] and [731062ffff]: [file copy] to a filesystem that cannot store the mode or the times (VFAT, CIFS with a fixed owner) failed with "operation not permitted" and removed the copy. Ignore EPERM from chmod() and utime() of the new file, as cp does check-in2026-11-11 14:35:51
  • fb8a999a36Ticket [731062ffff] file copy reports "not owner" although rights suffice status still Open with 3 other changes ticket2026-10-20 21:33:41
  • 6ffdcda1bfFix [1523045fff] and [731062ffff]: [file copy] to a filesystem that cannot store the mode or the times (VFAT, CIFS with a fixed owner) failed with "operation not permitted" and removed the copy. Ignore EPERM from chmod() and utime() of the new file, as cp does. check-in2026-10-19 18:59:01
dkf Ticket [1523045fff]: 2 changes [History diff]2006-08-04 00:19:25
serhiy.storchakawiki2026-10-20 21:33:41

Still present in 8.6, 9.0 and 9.1: after copying the data, [file copy] sets the mode and the times of the new file, and when that fails with EPERM (VFAT and similar filesystems) it removes the copy and reports an error. Copying a directory fails the same way and leaves a partial tree.

Proposed fix in branch copy-eperm-attrs, also for [731062ffff]: EPERM from chmod() and utime() of the newly created file is ignored, as cp does, so the copy is kept (without the mode or times that the filesystem cannot store). Tested with an LD_PRELOAD shim that makes these calls fail; no test in the suite, since it needs such a filesystem.

jan.nijtmans Pending ticket [1523045fff]. [History diff]2026-11-11 14:35:12
jan.nijtmanswiki2026-11-13 18:49:07

Merged in [trunk], core-9-0-branch and core-8-6-branch

Many thanks!

Log in (anonymous is fine) to add a comment.