Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
sylvestre wants to merge2 commits intouutils:main
base:main
Choose a base branch
Loading
fromsylvestre:selinux-mv

Conversation

sylvestre
Copy link
Contributor

Closes:#2404

@github-actionsGitHub Actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)

Copy link
Contributor

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?

Copy link
ContributorAuthor

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 :)

@github-actionsGitHub Actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

Comment on lines +203 to +206
} else if matches.contains_id(OPT_CONTEXT) {
matches.get_one::<String>(OPT_CONTEXT).cloned()
} else {
None
Copy link
Contributor

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.

Suggested change
}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
Copy link
Contributor

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.

Suggested change
// Set SELinux context if specified

Comment on lines +2516 to +2518
if !context_value.is_empty() {
cmd.arg(context_value);
}
Copy link
Contributor

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.

Comment on lines +2498 to +2506
("-Z", "", None),
(
"--context=unconfined_u:object_r:user_tmp_t:s0",
"",
Some("unconfined_u"),
),
];

for (arg, context_value, expected_context) in test_cases {
Copy link
Contributor

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.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@cakebakercakebakercakebaker left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

cp, ls, mv: Implement SELinux context handling
2 participants
@sylvestre@cakebaker

[8]ページ先頭

©2009-2025 Movatter.jp