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 |
2046 | 2046 | struct link *lp; |
2047 | 2047 | vfs_path_t *src_vpath, *dst_vpath; |
2048 | 2048 | gboolean do_mkdir = TRUE; |
| 2049 | struct stat temp_stat; |
2049 | 2050 | |
2050 | 2051 | src_vpath = vfs_path_from_str (s); |
2051 | 2052 | dst_vpath = vfs_path_from_str (d); |
… |
… |
copy_dir_dir (file_op_total_context_t * tctx, file_op_context_t * ctx, const cha |
2274 | 2275 | } |
2275 | 2276 | mc_closedir (reading); |
2276 | 2277 | |
| 2278 | mc_stat(dst_vpath, &temp_stat); |
2277 | 2279 | if (ctx->preserve) |
2278 | 2280 | { |
2279 | 2281 | mc_timesbuf_t times; |
2280 | 2282 | |
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)); |
2282 | 2284 | get_times (&cbuf, ×); |
2283 | 2285 | mc_utime (dst_vpath, ×); |
2284 | 2286 | } |
… |
… |
copy_dir_dir (file_op_total_context_t * tctx, file_op_context_t * ctx, const cha |
2287 | 2289 | cbuf.st_mode = umask (-1); |
2288 | 2290 | umask (cbuf.st_mode); |
2289 | 2291 | 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)); |
2291 | 2293 | } |
2292 | 2294 | |
2293 | 2295 | ret: |