File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ path = "src/uniq.rs"
2020
2121[dependencies ]
2222clap = { workspace = true }
23- uucore = { workspace = true , features = [" parser" ] }
23+ uucore = { workspace = true , features = [" parser" , " fs " ] }
2424fluent = { workspace = true }
2525
2626[dev-dependencies ]
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ use std::num::IntErrorKind;
1414use uucore:: display:: Quotable ;
1515use uucore:: error:: { FromIo , UError , UResult , USimpleError } ;
1616use uucore:: format_usage;
17+ use uucore:: fs:: create_file_restrictive_perm;
1718use uucore:: parser:: shortcut_value_parser:: ShortcutValueParser ;
1819use uucore:: posix:: { OBSOLETE , posix_version} ;
1920use uucore:: translate;
@@ -824,7 +825,7 @@ fn open_input_file(in_file_name: Option<&OsStr>) -> UResult<Box<dyn BufRead>> {
824825fn open_output_file ( out_file_name : Option < & OsStr > ) -> UResult < Box < dyn Write > > {
825826 Ok ( match out_file_name {
826827 Some ( path) if path != "-" => {
827- let out_file = File :: create ( path) . map_err_context (
828+ let out_file = create_file_restrictive_perm ( path, true ) . map_err_context (
828829 || translate ! ( "uniq-error-could-not-open" , "path" => path. maybe_quote( ) ) ,
829830 ) ?;
830831 Box :: new ( BufWriter :: with_capacity ( OUTPUT_BUFFER_CAPACITY , out_file) )
You can’t perform that action at this time.
0 commit comments