Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F132020462
D8543.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D8543.diff
View Options
Index: head/bin/dd/dd.c
===================================================================
--- head/bin/dd/dd.c
+++ head/bin/dd/dd.c
@@ -142,8 +142,6 @@
in.fd = open(in.name, O_RDONLY, 0);
if (in.fd == -1)
err(1, "%s", in.name);
- if (caph_limit_stdin() == -1)
- err(1, "unable to limit capability rights");
}
getfdtype(&in);
@@ -176,8 +174,6 @@
}
if (out.fd == -1)
err(1, "%s", out.name);
- if (caph_limit_stdout() == -1)
- err(1, "unable to limit capability rights");
}
getfdtype(&out);
@@ -188,6 +184,16 @@
errno != ENOSYS)
err(1, "unable to limit capability rights");
+ if (in.fd != STDIN_FILENO && out.fd != STDIN_FILENO) {
+ if (caph_limit_stdin() == -1)
+ err(1, "unable to limit capability rights");
+ }
+
+ if (in.fd != STDOUT_FILENO && out.fd != STDOUT_FILENO) {
+ if (caph_limit_stdout() == -1)
+ err(1, "unable to limit capability rights");
+ }
+
if (in.fd != STDERR_FILENO && out.fd != STDERR_FILENO) {
if (caph_limit_stderr() == -1)
err(1, "unable to limit capability rights");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Oct 14, 12:32 AM (4 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23698735
Default Alt Text
D8543.diff (1 KB)
Attached To
Mode
D8543: Capsicumise dd
Attached
Detach File
Event Timeline
Log In to Comment