Merge branch '1729_copying_into_arhive'

* 1729_copying_into_arhive:
  Ticket #1729: extfs: fail copying into arhive
This commit is contained in:
Slava Zanko 2009-10-20 14:13:52 +03:00
commit a1f9ceb99e

View File

@ -720,6 +720,13 @@ extfs_open (struct vfs_class *me, const char *file, int flags, int mode)
local_handle = local_handle =
open (entry->inode->local_filename, NO_LINEAR (flags), mode); open (entry->inode->local_filename, NO_LINEAR (flags), mode);
if (local_handle == -1) {
/* file exists(may be). Need to drop O_CREAT flag and truncate file content */
flags = ~O_CREAT & (NO_LINEAR (flags)|O_TRUNC);
local_handle = open (entry->inode->local_filename, flags , mode);
}
if (local_handle == -1) if (local_handle == -1)
ERRNOR (EIO, NULL); ERRNOR (EIO, NULL);
@ -1019,6 +1026,15 @@ cleanup:
return result; return result;
} }
static int extfs_chown (struct vfs_class *me, const char *path, int owner, int group)
{
(void) me;
(void) path;
(void) owner;
(void) group;
return 0;
}
static int extfs_chmod (struct vfs_class *me, const char *path, int mode) static int extfs_chmod (struct vfs_class *me, const char *path, int mode)
{ {
(void) me; (void) me;
@ -1414,6 +1430,7 @@ init_extfs (void)
vfs_extfs_ops.lstat = extfs_lstat; vfs_extfs_ops.lstat = extfs_lstat;
vfs_extfs_ops.fstat = extfs_fstat; vfs_extfs_ops.fstat = extfs_fstat;
vfs_extfs_ops.chmod = extfs_chmod; vfs_extfs_ops.chmod = extfs_chmod;
vfs_extfs_ops.chown = extfs_chown;
vfs_extfs_ops.readlink = extfs_readlink; vfs_extfs_ops.readlink = extfs_readlink;
vfs_extfs_ops.unlink = extfs_unlink; vfs_extfs_ops.unlink = extfs_unlink;
vfs_extfs_ops.chdir = extfs_chdir; vfs_extfs_ops.chdir = extfs_chdir;