cp.ese bug report -- possible fix?

Charles Wilson cwilson@ece.gatech.edu
Sat May 11 19:03:00 GMT 2002


Well, I've attached a patch for this bug.  However, it uncovered another 
problem with 'cp -p src dest', when src is not owned by the current user.

(AROUND LINE 1170 in fileutils/src/copy.c):

   /* Permissions of newly-created regular files were set upon `open' in
      copy_reg.  But don't return early if there were any special bits and
      we had to run chown, because the chown must have reset those bits.  */
   if ((new_dst && copied_as_regular)
       && !(ran_chown && (src_mode & ~S_IRWXUGO)))
     return delayed_fail;

   if ((x->preserve_chmod_bits || new_dst)
       && (x->copy_as_regular || S_ISREG (src_type) || S_ISDIR (src_type)))
     {
       if (chmod (dst_path, get_dest_mode (x, src_mode)))    <<<<< HERE
    {
#ifdef __CYGWIN__
    char *p;

The chmod command returns with ENOENT.  I have no idea why; the file has 
already been created at this point...

--Chuck
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diff
URL: <http://cygwin.com/pipermail/cygwin/attachments/20020511/ec02080d/attachment.ksh>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list