← Commit list

a0017a5b5

Denys Vlasenko
Denys Vlasenko
2025-10-07
SUCCESS Duration: 158s

Subject

cp: fix `cp -aT` overwriting symlink to directories

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

coreutils/cp.c+2 -1
@@ -215,7 +215,8 @@ int cp_main(int argc, char **argv)
(flags & FILEUTILS_DEREFERENCE) ? stat : lstat);
if (s_flags < 0) /* error other than ENOENT */
return EXIT_FAILURE;
- d_flags = cp_mv_stat(last, &dest_stat);
+ d_flags = cp_mv_stat2(last, &dest_stat,
+ (flags & FILEUTILS_NO_TARGET_DIR) ? lstat : stat);
if (d_flags < 0) /* error other than ENOENT */
return EXIT_FAILURE;