Skip to content

[Bug]: sanitize_input does not work as expected #324

Open
@dimitry-ishenko

Description

What happened?

While testing PR #320 I would get the following error:

admin@armbian:~/configng$ bin/armbian-config --api pkg_install vim-airline

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package Invalid argument: vim-airline

Upon further testing, any package containing dash (-) in the name would produce similar error.

It turns out the error is generated by the sanitize_input function which does not allow dashes. However, the pipeline doesn't seem to work as expected, since instead of just reporting the error "Invalid argument: vim-airline," this output is passed further down the pipeline.

In the end the pkg_install function tries to install a package called Invalid argument: vim-airline, which results in a confusing error.

How to reproduce?

See above.

On which host OS are you running the build script and observing this problem?

Ubuntu 24.04 Noble

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working as it should

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions