Changes between Initial Version and Version 1 of Ticket #2278, comment 20


Ignore:
Timestamp:
10/11/12 19:02:41 (12 years ago)
Author:
onkeltem
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #2278, comment 20

    initial v1  
    88 
    99Also I would like to have "Preserve attributes" OFF by default, any ideas how to do this? 
     10 
     11'''UPDATE''' 
     12 
     13After looking in code it becomes clear that MC takes local mask and use it to '''chmod''''ing a remote object: 
     14 
     15{{{ 
     16  else if (!dst_exists) 
     17  { 
     18    src_mode = umask (-1); 
     19    umask (src_mode); 
     20    src_mode = 0100666 & ~src_mode; 
     21    mc_chmod (dst_vpath, (src_mode & ctx->umask_kill)); 
     22  } 
     23}}} 
     24https://github.com/MidnightCommander/mc/blob/master/src/filemanager/file.c#L1894 
     25 
     26This happens with both SFTP and FISH VFSes which I tested. 
     27The correct behavior would be to not '''chmod''' at all when we deal with a remote VFS. So instead of: 
     28{{{ 
     29  else if (!dst_exists) 
     30}}} 
     31there should be something like: 
     32{{{ 
     33  else if (!dst_exists && !<vfs_is_remote>) 
     34}}} 
     35 
     36Unfortunately I don't know how to check is a vfs is remote. Please fix this.