FAQ SearchLogin
Tuxera Home
View unanswered posts | View active topics It is currently Thu May 13, 2021 02:21



Post new topic Reply to topic  [ 11 posts ] 
cp: preserving times for 'file': Operation not permitted 
Author Message

Joined: Fri Feb 16, 2007 12:09
Posts: 4
Post cp: preserving times for 'file': Operation not permitted
Hello.
I have ALT Linux Sisyphus, 2.6.18
Last ntfs-3g (20070207-RC1)
i mount ntfs volume in fstab:
/dev/sda1 /mnt/c ntfs-3g silent,user,auto,umask=0,locale=ru_RU.cp1251,allow_other 0 0
And i have error about set of permission when try to copy files to /mnt/c
Why? option silent not work? Or silent not work on my old kernel fuse?

_________________
ALT-Linux team


Fri Feb 16, 2007 13:31
Profile
Tuxera CTO

Joined: Tue Nov 21, 2006 23:15
Posts: 1648
Post 
No, you really don't have permission to do what you want. Here are some question which can help you to figure out the reason:

Is ntfs-3g setuid root?
Is the volume mounted as non-root?
What is the file and/or dir permission you have problem with?
Who is the user/group not having the permission?


Fri Feb 16, 2007 15:04
Profile

Joined: Fri Feb 16, 2007 12:09
Posts: 4
Post 
szaka wrote:
No, you really don't have permission to do what you want.

Yes, but option "silent" must "Do nothing on chmod and chown operations, but do not return error", isn't it?
Quote:
Is ntfs-3g setuid root?
Is the volume mounted as non-root?

volume mounted from /etc/fstab on system start
alex:alexlin ~$ ps aux|grep ntfs
root 23117 0.0 0.0 2632 968 ? Ss 09:13 0:00 /sbin/mount.ntfs-3g /dev/sda1 /mnt/c -o rw,noexec,nosuid,nodev,user,umask=0,locale=ru_RU.cp1251,allow_other
root 14046 0.0 0.1 2636 992 ? Ss 14:23 0:00 /sbin/mount.ntfs-3g /dev/hdc2 /mnt/d -o rw,noexec,nosuid,nodev,user,umask=0,locale=ru_RU.cp1251,allow_other
a
Quote:
What is the file and/or dir permission you have problem with?

cp tell about timestamp. but timestamps of copied file looks ok.
Quote:
Who is the user/group not having the permission?

standart user.
for root - all ok.

_________________
ALT-Linux team


Fri Feb 16, 2007 15:22
Profile

Joined: Fri Feb 16, 2007 12:09
Posts: 4
Post 
AlexSid wrote:
Quote:
What is the file and/or dir permission you have problem with?

cp tell about timestamp. but timestamps of copied file looks ok.

Oops...
No. For root - all ok, but for user both timestamps (create and modify) of file set "now"

_________________
ALT-Linux team


Fri Feb 16, 2007 15:30
Profile
Tuxera CTO

Joined: Tue Nov 21, 2006 23:15
Posts: 1648
Post 
Aha, I guess you mean such messages:

cp: preserving times for 'foo': Operation not permitted

The 'silent' option is uneffective in your case because if one of the uid, gid or mask options is used then FUSE checks the permissions and ntfs-3g has no control over it.

Remove the otherwise redundant umask=0 option then you should have the behaviour you want.

The ntfs-3g manual will be updated. Thanks!


Fri Feb 16, 2007 16:24
Profile
Tuxera CTO

Joined: Tue Nov 21, 2006 23:15
Posts: 1648
Post 
I checked your problem in detail and in fact it seems to be a FUSE bug. I reported it and let you know how it goes. Thanks again.


Fri Feb 16, 2007 17:15
Profile

Joined: Fri Feb 16, 2007 12:09
Posts: 4
Post 
szaka wrote:
Remove the otherwise redundant umask=0 option then you should have the behaviour you want.

Now all ok.
thanks

_________________
ALT-Linux team


Sat Feb 17, 2007 11:46
Profile
Tuxera CTO

Joined: Tue Nov 21, 2006 23:15
Posts: 1648
Post permissions error
I have the result of the investigation. FUSE is right. Things worked
as they should. The operation indeed mustn't be permitted in such cases
according to the POSIX standard.

Namely utimes(2) doesn't permit changing the time stamps because the
effective uid of the cp process doesn't equal the uid of the file
__AND__ the new time stamps are not the current time, __EVEN_IF__
the user has write permission to the file. This is how POSIX wants.

I'll document this issue, thanks again.


Sat Feb 17, 2007 13:17
Profile

Joined: Thu Apr 24, 2008 09:00
Posts: 1
Post 
A little late, but nonetheless...
I was able to overcome problems with preserving times:
Code:
cp: preserving times for 'foo': Operation not permitted


by adding 'uid=' option in /etc/fstab, like this:

Code:
# /dev/sda3
UUID=E486D32886D2FA2A  /media/files  ntfs-3g  defaults,umask=007,gid=46,uid=1000  0  1


Thu Apr 24, 2008 13:13
Profile

Joined: Thu Aug 05, 2010 08:56
Posts: 1
Post Re: cp: preserving times for 'file': Operation not permitted
Hate to necrobump a 3-year-old thread but I'm having this problem using the latest version of ntfs-3g:

I have a data partition mounted like this (from my /etc/fstab):
Code:
/dev/sda8       /media/data     ntfs-3g defaults,umask=002,fmask=113,gid=100    0       0


Here is the mount point:
Code:
drwxrwxr-x 1 root    users   4096 Aug  2 04:03 data


When anyone in the "users" group tries to copy files to this partition, the date/time stamp is NOW rather than what was on the dir/files as a function of this problem:

Code:
$ cp -a ./Desktop /media/data/
cp: preserving times for `/media/data/Desktop/templog-31-Dec-09-11_04_02.csv~': Operation not permitted
cp: preserving times for `/media/data/Desktop/screenshot2.png': Operation not permitted
cp: preserving times for `/media/data/Desktop/conky-d.desktop': Operation not permitted


1) I must keep the mount point owned by root:users or else all the users in the "users" group cannot create files. How does one deal with this?

I found the following but I don't think it applies:

https://forums.gentoo.org/viewtopic-t-827518-start-0.html
Quote:
re-emerge and exclude the acl use flag. I'm not sure why or what acl does but by turning off that use flag I solved the problem I was having which was identical to yours with rsync.


...the thread goes on to say that this bug was fixed in ntfs-3g "latest" release but I am using> the version mentioned in the thread.

Thanks all!


Thu Aug 05, 2010 09:00
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: cp: preserving times for 'file': Operation not permitted
Hi,

Quote:
I have a data partition mounted like this (from my /etc/fstab):
Code:
/dev/sda8       /media/data     ntfs-3g defaults,umask=002,fmask=113,gid=100    0       0

So you have forced a group (gid), but you have not defined an owner (uid). As a consequence the files appear as owned by root.

Quote:
When anyone in the "users" group tries to copy files to this partition, the date/time stamp is NOW rather than what was on the dir/files as a function of this problem:

This is because non-owners can only set the timestamp to "now", quoting from man utime :
Quote:
Changing timestamps is permitted when: either the process has appropriate privileges, or the effective user ID equals the user ID of the file, or times is NULL and the process has write permission for the file.

Quote:
I must keep the mount point owned by root:users or else all the users in the "users" group cannot create files.

Mounting with uid defined as a user id would solve the issue for this user, but this is not possible if you want several users. Removing the gid, umask and dmask options will disable permission checks, but you will not be able to restrict writing to the device to members of a specific group.

So you want protections, but not too much. Protections are being redefined (see http://b.andre.pagesperso-orange.fr/per ... ml#options), but I have no immediate solution for enabling permissions for restricting writing to some users and disabling permissions for setting timestamps.

Are you not interested by full Linux-type permissions ?

Regards

Jean-Pierre


Fri Aug 06, 2010 15:07
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Original forum style by Vjacheslav Trushkin.