Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.5k
mv: add support for selinux and add minor refactor#8333
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
GNU testsuite comparison:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Is it intentional that you use both featuresfeat_selinux
andselinux
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
no :)
i should work on merging them
tbh, i don't remember why we have this :)
GNU testsuite comparison:
|
} else if matches.contains_id(OPT_CONTEXT) { | ||
matches.get_one::<String>(OPT_CONTEXT).cloned() | ||
} else { | ||
None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think a singleelse
is enough becausematches.get_one
returnsNone
if--context
is not provided.
}elseif matches.contains_id(OPT_CONTEXT){ | |
matches.get_one::<String>(OPT_CONTEXT).cloned() | |
}else{ | |
None | |
}else{ | |
matches.get_one::<String>(OPT_CONTEXT).cloned() |
@@ -781,6 +817,13 @@ fn rename( | |||
rename_with_fallback(from, to, multi_progress, None, None)?; | |||
} | |||
// Set SELinux context if specified |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The comment is redundant, it says the same as the code.
// Set SELinux context if specified |
if !context_value.is_empty() { | ||
cmd.arg(context_value); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The code in theif
block is unreachable becausecontext_value
is empty in both test cases.
("-Z", "", None), | ||
( | ||
"--context=unconfined_u:object_r:user_tmp_t:s0", | ||
"", | ||
Some("unconfined_u"), | ||
), | ||
]; | ||
for (arg, context_value, expected_context) in test_cases { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think you can omitcontext_value
as it is only used in unreachable code.
Closes:#2404