8000 dd: should error on reading stdin when iflag=directory option is given · Issue #5900 · uutils/coreutils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

dd: should error on reading stdin when iflag=directory option is given #5900

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jfinkels opened this issue Jan 28, 2024 · 4 comments · Fixed by #7122
Closed

dd: should error on reading stdin when iflag=directory option is given #5900

jfinkels opened this issue Jan 28, 2024 · 4 comments · Fixed by #7122
Labels

Comments

@jfinkels
Copy link
Collaborator
jfinkels commented Jan 28, 2024

GNU coreutils dd 9.4.113-c01ee

$ : | dd iflag=directory
dd: setting flags for 'standard input': Not a directory

uutils dd:

$ : | ./target/debug/dd iflag=directory
0+0 records in
0+0 records out
0 bytes copied, 2.37402e-04 s, 0.0 B/s

Test case found in GNU test suite tests/dd/misc.sh.

Edit: tested on Ubuntu 20.04, where the iflag=directory option is allowed.

@JMarkin
Copy link
JMarkin commented Nov 24, 2024

Hello @jfinkels, I tested this issue on current main

And get output

$ : | ./target/debug/coreutils dd iflag=directory
dd: feature not implemented on this system -> directory

May be this issue to close?

@jfinkels
Copy link
Collaborator Author

I should have mentioned in the description that I am testing on Ubuntu, so the iflag=directory option should be allowed. I'll update the description to mention my environment. On my machine, the issue remains.

@jfinkels
Copy link
Collaborator Author

This does seem to error as expected when a file is redirected to stdin:

$ touch f && < f ./target/debug/dd iflag=directory count=0
./target/debug/dd: standard input: not a directory

(The error message differs from that of GNU dd though)

@jfinkels
Copy link
Collaborator Author

Ah, this was partially fixed by #6084. That change actually fixed the issue in the GNU test file tests/dd/misc.sh, that's great. All that remains here is to just apply the same logic to the piped stdin as well.

jfinkels added a commit to jfinkels/coreutils that referenced this issue Jan 11, 2025
Make `dd` unconditionally error if `iflag=directory` and the input
file is `stdin`.

Fi
8000
xes uutils#5900
jfinkels added a commit to jfinkels/coreutils that referenced this issue Jan 12, 2025
Make `dd` error if `iflag=directory` and the input file is not a
directory, even if the directory is redirected to `stdin` as in

    dd <.

Fixes uutils#5900
jfinkels added a commit to jfinkels/coreutils that referenced this issue Jan 12, 2025
Make `dd` error if `iflag=directory` and the input file is not a
directory, even if the directory is redirected to `stdin` as in

    dd <.

Fixes uutils#5900
jfinkels added a commit to jfinkels/coreutils that referenced this issue Jan 12, 2025
Make `dd` error if `iflag=directory` and the input file is not a
directory, even if the directory is redirected to `stdin` as in

    dd <.

Fixes uutils#5900
jfinkels added a commit to jfinkels/coreutils that referenced this issue Jan 12, 2025
Make `dd` error if `iflag=directory` and the input file is not a
directory, as in

    : | dd iflag=directory

Fixes uutils#5900
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0