coreutils
coreutils copied to clipboard
cp: fix copy from stream
fixes #7885
copy_stream doesn't clear the dest file, if dest is not a stream, clear it manually.
I'm not familiar with FreeBSD's permissions, how could I debug FreeBSD's behavior without a FreeBSD machine?
edit: oh I find I can use forked repo's github action to debug.
GNU testsuite comparison:
Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)
I try to debug FreeBSD and find /dev/fd/0's permission was set to mode: 0o010000 (p---------), can't understand why.
GNU testsuite comparison:
Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)
Is there any description for this line? https://github.com/uutils/coreutils/blob/f111113c975c756c32d6a24e28cfcfb21a99e6d5/src/uu/cp/src/platform/other_unix.rs#L54-L56
edit: According to my tests, GNU cp doesn't reset target's permission just because the source is fifo, so I just remove these lines.
GNU testsuite comparison:
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
GNU testsuite comparison:
Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)
GNU testsuite comparison:
Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)
GNU testsuite comparison:
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
GNU testsuite comparison:
Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)
GNU testsuite comparison:
Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)
Thanks!