Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actions are allergic to whitespace #4

Open
Michcioperz opened this issue Feb 15, 2019 · 0 comments
Open

Actions are allergic to whitespace #4

Michcioperz opened this issue Feb 15, 2019 · 0 comments

Comments

@Michcioperz
Copy link

Copying files from/to DUT is currently implemented as

func (d *deviceCommunicationProvider) CopyFilesTo(src []string, dest string) error {
for _, path := range src {
_, _, err := d.sessionProvider.Exec(prefixPath+"dut_copyto.sh", path, dest)

and even though sessionProvider.Exec takes the command in the form of a list of strings, it proceeds then to just

return d.executeRemoteCommand(strings.Join(cmd, " "))

This is then executed by the default shell on the supervisor. In most cases this is fine, but if either of the paths contains a space, the command will turn into dut_copyto.sh path with spaces other_path. The implementation of dut_copyto will throw an error in best case or do something unexpected in worst case (consider CopyFilesTo([]string{"random_file /etc/passwd"}, "what_if_this_path_is_ignored")).

This issue also affects SupervisorPull/Push in my changes.

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

No branches or pull requests

1 participant