File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed
Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -124,3 +124,7 @@ ls-invalid-columns-width = ignoring invalid width in environment variable COLUMN
124124ls-invalid-ignore-pattern = Invalid pattern for ignore: { $pattern }
125125ls-invalid-hide-pattern = Invalid pattern for hide: { $pattern }
126126ls-total = total { $size }
127+
128+ # Security context warnings
129+ ls-warning-failed-to-get-security-context = failed to get security context of: { $path }
130+ ls-warning-getting-security-context = getting security context of: { $path } : { $error }
Original file line number Diff line number Diff line change @@ -3389,7 +3389,13 @@ fn get_security_context<'a>(
33893389 match selinux:: SecurityContext :: of_path ( path, must_dereference, false ) {
33903390 Err ( _r) => {
33913391 // TODO: show the actual reason why it failed
3392- show_warning ! ( "failed to get security context of: {}" , path. quote( ) ) ;
3392+ show_warning ! (
3393+ "{}" ,
3394+ translate!(
3395+ "ls-warning-failed-to-get-security-context" ,
3396+ "path" => path. quote( ) . to_string( )
3397+ )
3398+ ) ;
33933399 return Cow :: Borrowed ( SUBSTITUTE_STRING ) ;
33943400 }
33953401 Ok ( None ) => return Cow :: Borrowed ( SUBSTITUTE_STRING ) ,
@@ -3400,9 +3406,12 @@ fn get_security_context<'a>(
34003406
34013407 let res: String = String :: from_utf8 ( context. to_vec ( ) ) . unwrap_or_else ( |e| {
34023408 show_warning ! (
3403- "getting security context of: {}: {}" ,
3404- path. quote( ) ,
3405- e. to_string( )
3409+ "{}" ,
3410+ translate!(
3411+ "ls-warning-getting-security-context" ,
3412+ "path" => path. quote( ) . to_string( ) ,
3413+ "error" => e. to_string( )
3414+ )
34063415 ) ;
34073416
34083417 String :: from_utf8_lossy ( context) . to_string ( )
You can’t perform that action at this time.
0 commit comments