Skip to content

setpgid: accept a command and arguments that are not valid UTF-8 - #655

Open
SichenLiang wants to merge 1 commit into
uutils:mainfrom
SichenLiang:setpgid-non-utf8-args
Open

SichenLiang wants to merge 1 commit into
uutils:mainfrom
SichenLiang:setpgid-non-utf8-args

Conversation

@SichenLiang

Copy link
Copy Markdown

Read the program name and its arguments as OsString so they reach execvp() unchanged. This allows both non-UTF-8 arguments and program paths, matching util-linux 2.42.4.

If execvp() fails, the diagnostic still displays the program name with to_string_lossy(), as setsid does.

The Unix tests cover a non-UTF-8 argument and, on Linux, a command run through a symlink whose name contains byte ff.

Fixes #654

Read the command and its arguments as OsString so they reach execvp()
unchanged, as they do with util-linux setpgid.
}

#[test]
#[cfg(target_os = "linux")]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why only linux? /bin/sh should be there on every unix

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

setpgid: a program name or argument that is not valid UTF-8 is rejected

2 participants