Ticket #3814: 0001-group-sticky-bit-fix.patch

File 0001-group-sticky-bit-fix.patch, 1.6 KB (added by math_coder, 7 years ago)

Fix, which I use as temporary solution

  • src/filemanager/file.c

    From 18a44ea855f95e568c4702d92db0c19690c06226 Mon Sep 17 00:00:00 2001
    From: Warlock <internalmike@gmail.com>
    Date: Sat, 22 Apr 2017 20:58:34 +0300
    Subject: [PATCH] group sticky bit fix
    
    ---
     src/filemanager/file.c | 6 ++++--
     1 file changed, 4 insertions(+), 2 deletions(-)
    
    diff --git a/src/filemanager/file.c b/src/filemanager/file.c
    index b61821a86..8e96e5584 100644
    a b copy_dir_dir (file_op_total_context_t * tctx, file_op_context_t * ctx, const cha 
    20462046    struct link *lp; 
    20472047    vfs_path_t *src_vpath, *dst_vpath; 
    20482048    gboolean do_mkdir = TRUE; 
     2049    struct stat temp_stat; 
    20492050 
    20502051    src_vpath = vfs_path_from_str (s); 
    20512052    dst_vpath = vfs_path_from_str (d); 
    copy_dir_dir (file_op_total_context_t * tctx, file_op_context_t * ctx, const cha 
    22742275    } 
    22752276    mc_closedir (reading); 
    22762277 
     2278    mc_stat(dst_vpath, &temp_stat); 
    22772279    if (ctx->preserve) 
    22782280    { 
    22792281        mc_timesbuf_t times; 
    22802282 
    2281         mc_chmod (dst_vpath, cbuf.st_mode & ctx->umask_kill); 
     2283        mc_chmod (dst_vpath, (cbuf.st_mode & ctx->umask_kill) | (temp_stat.st_mode & 007000)); 
    22822284        get_times (&cbuf, &times); 
    22832285        mc_utime (dst_vpath, &times); 
    22842286    } 
    copy_dir_dir (file_op_total_context_t * tctx, file_op_context_t * ctx, const cha 
    22872289        cbuf.st_mode = umask (-1); 
    22882290        umask (cbuf.st_mode); 
    22892291        cbuf.st_mode = 0100777 & ~cbuf.st_mode; 
    2290         mc_chmod (dst_vpath, cbuf.st_mode & ctx->umask_kill); 
     2292        mc_chmod (dst_vpath, (cbuf.st_mode & ctx->umask_kill) | (temp_stat.st_mode & 007000)); 
    22912293    } 
    22922294 
    22932295  ret: