bin/91134: [PATCH] Preserve access and modification time when cp to a smbfs destination path

Gilbert Cao hika at bsdmon.com
Mon Jan 2 11:28:04 PST 2006


On Sun, Jan 01, 2006 at 11:06:48AM +1100, Bruce Evans wrote:
> 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.

OK.

> 
> It can't be right to always close the file.  This leaves the fd >= 0 case
> in setfile() unused and bogotifies all the code that handles this case,
> even for POSIX file systems where this code just works.  However, I can't
> see any reason to have the fd >= 0 case except to avoid minor races for
> regular files only.

I guess I will maintain my own version of cp, until the bug in smbfs will
be correct, right ?
I don't know if I will be qualified enough to debug smbfs ;)

> 
> Bruce

-- 
--------------------------------
 (hika) Gilbert Cao
 http://www.miaouirc.com
  - MiaouIRC Project 2002-2003
 http://www.bsdmon.com
  - The BSD DMON Power to serve
 IRC : #miaule at IRCNET Network
--------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-bugs/attachments/20060102/9f832ec9/attachment.bin


More information about the freebsd-bugs mailing list