|
2026-11-13
| ||
| 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: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 | |
|
2010-06-03
| ||
| 20:51 | • Ticket [731062ffff] file copy reports "not owner" although rights suff... artifact: 5c52a88e7a user: ferrieux | |
| 19:38 | • Ticket [731062ffff]: 4 changes artifact: a62940d548 user: ferrieux | |
| 18:37 | • Ticket [731062ffff]: 4 changes artifact: b7d3ebef66 user: ctasada | |
|
2010-06-02
| ||
| 14:26 | • Ticket [731062ffff]: 4 changes artifact: 2313da3e30 user: ferrieux | |
| 05:28 | • Ticket [731062ffff]: 4 changes artifact: 0e0d481c27 user: flatworm | |
| 05:05 | • Ticket [731062ffff]: 4 changes artifact: 04df52e423 user: flatworm | |
|
2010-06-01
| ||
| 22:37 | • Ticket [731062ffff]: 4 changes artifact: 006a5ee763 user: holgerjakobs | |
| 20:32 | • Ticket [731062ffff]: 4 changes artifact: 7c2481166f user: ctasada | |
| 19:57 | • Ticket [731062ffff]: 4 changes artifact: e10ff629a9 user: flatworm | |
| 19:48 | • Ticket [731062ffff]: 4 changes artifact: 7140422edc user: ferrieux | |
| 19:30 | • Ticket [731062ffff]: 4 changes artifact: 2a80c3b4d8 user: ctasada | |
| 18:32 | • Ticket [731062ffff]: 4 changes artifact: 79ea62094b user: ferrieux | |
| 17:33 | • Ticket [731062ffff]: 4 changes artifact: 435cd765e0 user: ctasada | |
|
2003-11-16
| ||
| 21:43 | • Ticket [731062ffff]: 4 changes artifact: 1009df0e68 user: holgerjakobs | |
| 21:40 | • Ticket [731062ffff]: 4 changes artifact: e1cae3ecd2 user: holgerjakobs | |
|
2003-11-13
| ||
| 05:45 | • Ticket [731062ffff]: 2 changes artifact: 755f0cfe17 user: vincentdarley | |
| 05:23 | • Ticket [731062ffff]: 5 changes artifact: 035ad64f16 user: dgp | |
|
2003-10-24
| ||
| 23:27 | • Ticket [731062ffff]: 4 changes artifact: f6cfc27925 user: nobody | |
|
2003-05-02
| ||
| 15:23 | • Ticket [731062ffff]: 5 changes artifact: cabffdecce user: vincentdarley | |
| 15:12 | • Ticket [731062ffff]: 3 changes artifact: d15cc46281 user: dkf | |
|
2003-05-01
| ||
| 23:06 | • New ticket [731062ffff]. artifact: df073494a9 user: nobody | |
file copy reports "not owner" although rights suffice
Closed / Duplicate731062ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 21 days ago
Descriptionplain2003-05-01 23:06:55
I cannot copy a file to a directory I do not own, although I am a member of a group having the necessary rights to do so. Even using the option "-force" of "file copy" does not help. The error reportes is "not owner", which corresponds to EPERM. Copying from the command line using cp works fine. I use Tcl/Tk 8.4.1 on Linux (version 8.3.3 behaves same way) Maybe this report belongs in the category "file system", but since it shows when using the command "file", I put it here. [email protected]
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:3975e2c580d6Fix [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:536e7c8299c5Fix [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:51b232f71166Ticket [1523045fff] file cmd fails to copy to VFAT status still Open with 3 other changes ticket2026-10-20 21:33:416ffdcda1bfFix [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 [731062ffff]: 3 changes
[History diff]2003-05-02 15:12:59
vincentdarleyplain2003-05-02 15:23:08
Logged In: YES user_id=32170 I'm afraid I'm not really in a position to debug this. A few notes though: "-force" won't help --- that's to do with files already existing If you are able to do some debugging, the function you should look at is DoCopyFile in tclUnixFCmd.c. Maybe you could give a bit more info about the actual permissions of the file and directory in question.
nobodyplain2003-10-24 23:27:06
Logged In: NO
I am user hj, primary group membership in group 100, users.
Proof:
hj > who am i
hj pts/0 Oct 24 17:54
hj > grep hj /etc/passwd
hj:x:500:100:Holger:/home/hj:/bin/bash
hj > grep 100 /etc/group
users:x:100:
The current directory is open open for writing for members
of group users.
Proof:
hj > ll -d .
drwxrwx--- 44 nobody users 12288 Okt 24 18:22 .
Now, let's copy a file to the current directory. Works fine.
hj > cp /tmp/x .
hj > ll x
-rwxrwx--- 1 nobody users 4344 Okt 24 18:22 x
Yes, the file is there!
Remove the file and try the same with Tcl.
hj > rm x
hj > tclsh
% file copy /tmp/x .
error copying "/tmp/x" to "./x": not owner
%
Oops, Tcl doesn't allow this, although the rights suffice.
dgpplain2003-11-13 05:23:30
Logged In: YES user_id=80530 pass on to someone else if not sutiable for you, but don't leave it assigned to "nobody"
vincentdarley Ticket [731062ffff]: 2 changes
[History diff]2003-11-13 05:45:44
holgerjakobsplain2003-11-16 21:40:45
Logged In: YES user_id=110058 The directory where no file could be copied to happens to be an FAT drive mounted under Linux. /dev/hda8 on /d type vfat (rw,nosuid,nodev,umask=007,uid=65534,gid=100) It only gives trouble with Tcl, not with normal Unix-cp. Does this give a hint for the programmers how to get rid of this error? vincentdarley asked: >Maybe you could give a bit more info about the actual >permissions of the file and directory in question. Actually, my description written 2003-10-24 18:27 includes all information I could think of. If you believe there is anything missing I would like to know what you are looking for. Holger
holgerjakobsplain2003-11-16 21:43:58
Logged In: YES user_id=110058 The directory where no file could be copied to happens to be an FAT drive mounted under Linux. /dev/hda8 on /d type vfat (rw,nosuid,nodev,umask=007,uid=65534,gid=100) It only gives trouble with Tcl, not with normal Unix-cp. Does this give a hint for the programmers how to get rid of this error? vincentdarley asked: >Maybe you could give a bit more info about the actual >permissions of the file and directory in question. Actually, my description written 2003-10-24 18:27 includes all information I could think of. If you believe there is anything missing I would like to know what you are looking for. Holger
ctasadaplain2010-06-01 17:33:56
Hi guys, I just got the same error using Tcl/Tk 8.5.4 and Ubuntu 10.04 As already said in the case the replication steps are: have a destination path with writing permissions (in fact I have 777) but owned by a different user (in my case root) Do: file copy $from_file $to_file Results: error: "not owner" Workaround: Right now I'm doing an "exec cp" but then I need to have specific code for every OS :( Cheers.
ferrieuxplain2010-06-01 18:32:19
Cannot repro in Fedora 12, with any of the three branches 8.[456] HEAD. Is upgrading to 8.5.8 an option for you ?
ctasadaplain2010-06-01 19:30:55
I have just tested with 8.5.8 from ActiveState and I've the same problem carlos@carlos-desktop:~/ActiveTcl-8.5/bin$ ./base-tcl8.5-thread-linux-ix86 % file copy /home/carlos/bookmarks.xml /media/borat/Users/carlos/BackUps/bookmarks.xml error copying "/home/carlos/bookmarks.xml" to "/media/borat/Users/carlos/BackUps/bookmarks.xml": not owner % puts $tcl_version 8.5 % puts $tcl_patchLevel 8.5.8 % file owned /media/borat/Users/carlos/BackUps 0 % file writable /media/borat/Users/carlos/BackUps 1 The /media/borat is mounted from a Windows computer with the next fstab line: //borat/fileserver/media/boratcifsnounix,rw,file_mode=0777,dir_mode=0777,username=Administrator,password=********00 Is there any other info that can help fixing this problem? Thanks.
ferrieuxplain2010-06-01 19:48:18
Ah, a Windows share.... It would have been cool to mention that earlier.
flatwormplain2010-06-01 19:57:14
ctasada, note that "writable" on a directory in Unix means that you have rights to manipulate directory contents which is a list of its entries, that is, you can delete and create files and directories; this does not mean you can, say, truncate an existing file and replace its contents with another data as this means modifying the file's data and this is controlled by the access rights set for that specific file. In other words, it would be cool if you posted the output of `id` command run as the user executing the script being discussed as well as the output of `stat /media/borat/Users/carlos/BackUps/` and `stat /media/borat/Users/carlos/BackUps/bookmarks.xml`.
ctasadaplain2010-06-01 20:32:18
Hi Konstantin, The requested results are: carlos@carlos-desktop:~$ stat /media/borat/Users/carlos/BackUps/ File: `/media/borat/Users/carlos/BackUps/' Size: 0 Blocks: 0 IO Block: 16384 directory Device: 15h/21dInode: 1970324837205476 Links: 1 Access: (0777/drwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2010-06-01 14:26:58.124250000 +0200 Modify: 2010-06-01 14:26:58.124250000 +0200 Change: 2010-06-01 14:26:58.124250000 +0200 carlos@carlos-desktop:~$ stat /media/borat/Users/carlos/BackUps/bookmarks.xml stat: cannot stat `/media/borat/Users/carlos/BackUps/bookmarks.xml': No such file or directory So as you can see there's no file with this name in the destination path. If I'm understanding you properly, that means that should work, right?
holgerjakobsplain2010-06-01 22:37:10
Hi, its me, the original creator of this bug report. I cannot confirm this error any more, because I don't have Tcl 8.4.4 at hand. This bug may be closed, it was solved by the passing of time. Regards Holger Jakobs
flatwormplain2010-06-02 05:05:48
Carlos, from the point of view of Unix permissions, all is OK. But you know that mount.cifs is actually lying to you about these permissions as the Windows part has no idea about them. So let's try to change file copy $from_file $to_file in your script to exec cp $from_file $to_file and see it it errors out. If it doesn't, we really have a bug.
flatwormplain2010-06-02 05:28:42
And to not make you think I'm trolling you with my questions, Carlos, I should say that I'm using CIFS from one of my scripts. That machine has Tcl 8.5.3 (Debian Lenny). All works OK with the only difference that my script uses [open $filename w] instead of [file copy]. Of course, [file copy] might have a different execution path when creating the target file, so [open] works in this case but [file copy] is not. So we should check this. The relevant bit of my script (for reference) is at http://pastebin.com/46Vzxbaw
ferrieuxplain2010-06-02 14:26:42
Konstantin, he already said he was doing [exec cp] as a workaround... Carlos, can you do an 'strace -f' of the tclsh for both the [file copy] and [exec cp] cases ? I'd like to see the difference in syscalls between the working and nonworking cases.
ctasadaplain2010-06-03 18:37:23
Ummm, I've the requested result from "strace -f", but I don't see how to attach files :( What's the best option to attach those results here? simply copy & paste? Thanks.
ferrieuxplain2010-06-03 19:38:19
Yes, I wish SF allowed logged-in, non-submitter users to attach files too :} In the meantime, please send it to ferrieux at users dot sourceforge dot net.
ferrieuxplain2010-06-03 20:51:30
Thanks Carlos for the files. Bug spotted :)
What happens is that Tcl's [file copy] does the copy, which succeeds, then tries (twice!!) to alter the permission bits of the just created file with chmod(), which fails in this case:
[pid 29862] open("/home/carlos/bookmarks.xml", O_RDONLY|O_LARGEFILE) = 5
[pid 29862] open("/media/borat/Users/carlos/BackUps/bookmarks.xml", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0100644) = 6
[pid 29862] read(5, "<?xml version=\"1.0\" encoding=\"UT"..., 4096) = 3528
[pid 29862] write(6, "<?xml version=\"1.0\" encoding=\"UT"..., 3528) = 3528
[pid 29862] read(5, "", 4096) = 0
[pid 29862] close(5) = 0
[pid 29862] close(6) = 0
[pid 29862] chmod("/media/borat/Users/carlos/BackUps/bookmarks.xml", 0644) = -1 EPERM (Operation not permitted)
[pid 29862] chmod("/media/borat/Users/carlos/BackUps/bookmarks.xml", 0644) = -1 EPERM (Operation not permitted)
[pid 29862] unlink("/media/borat/Users/carlos/BackUps/bookmarks.xml") = 0
[pid 29862] write(2, "error copying \"/home/carlos/book"..., 106error copying "/home/carlos/bookmarks.xml" to "/media/borat/Users/c
In contrast, /bin/cp trusts the perm bits passed to the initial open(), and does not try that strange chmod(), so it succeeds:
open("/home/carlos/bookmarks.xml", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=3528, ...}) = 0
open("/media/borat/Users/carlos/BackUps/bookmarks.xml", O_WRONLY|O_CREAT|O_EXCL|O_LARGEFILE, 0644) = 4
fstat64(4, {st_mode=S_IFREG|0777, st_size=0, ...}) = 0
read(3, "<?xml version=\"1.0\" encoding=\"UT"..., 32768) = 3528
write(4, "<?xml version=\"1.0\" encoding=\"UT"..., 3528) = 3528
read(3, "", 32768) = 0
close(4) = 0
close(3) = 0
Jeff, any idea why we're insisting on chmod here ?
serhiy.storchakawiki2026-10-20 21:33:41
Still present in 8.6, 9.0 and 9.1, as ferrieux's strace showed: the data is copied, but chmod() or utime() of the new file fails with EPERM when the filesystem has a fixed owner (vfat mounted with uid=, CIFS), and then the copy is removed. Proposed fix in branch copy-eperm-attrs, together with [1523045fff]: ignore EPERM there and keep the copy, as cp does.
jan.nijtmanswiki2026-11-11 14:34:40
So, mark this as duplicate to [1523045]
Thanks for the analysis and fix!
Log in (anonymous is fine) to add a comment.