1 Jan 2006 01:06
Re: bin/91134: [PATCH] Preserve access and modification time when cp to a smbfs destination path
Bruce Evans <bde <at> zeta.org.au>
2006-01-01 00:06:48 GMT
2006-01-01 00:06:48 GMT
On Sat, 31 Dec 2005, Gilbert Cao wrote:
>> Fix:
> The following patch has fixed the problem as I have finally found the problem in
> the src/bin/cp source code, especially the utils.c file :
> I have found out that utimes() does nothing on the newly created file, if its
> file descriptor is not closed yet, and this is only the case in a SMB destination path.
This is a bug in smbfs. cp only works on POSIX file systems.
> --- patch_cp_utils.diff begins here ---
> --- ./src/bin/cp/utils.c.orig Sat Nov 12 22:21:45 2005
> +++ ./src/bin/cp/utils.c Fri Dec 30 19:23:04 2005
> <at> <at> -204,8 +204,6 <at> <at>
> * to remove it if we created it and its length is 0.
> */
>
> - if (pflag && setfile(fs, to_fd))
> - rval = 1;
> if (pflag && preserve_fd_acls(from_fd, to_fd) != 0)
> rval = 1;
> (void)close(from_fd);
> <at> <at> -213,6 +211,14 <at> <at>
> warn("%s", to.p_path);
> rval = 1;
> }
> + /*
> + * To preserve times in SMB to.p_path,
> + * setfile() should be call *AFTER* we have closed the file
> + * descriptors. As we have closed the descriptors, we should
(Continue reading)
RSS Feed