Skip to content

Conversation

@troglobit
Copy link
Contributor

@troglobit troglobit commented Oct 16, 2024

Description

  • New: copy/erase/files stand-alone UNIX programs, from klish-plugin-infix
  • Remaining copy/erase code in klish-plugin-infix handle args. and cd $HOME
  • Also, some minor fixes to other programs

TODO: add bash completion to copy/erase and #373

Checklist

Tick relevant boxes, this PR is-a or has-a:

  • Bugfix
    • Regression tests
    • ChangeLog updates (for next release)
  • Feature
    • YANG model change => revision updated?
    • Regression tests added?
    • ChangeLog updates (for next release)
    • Documentation added?
  • Test changes
    • Checked in changed Readme.adoc (make test-spec)
    • Added new test to group Readme.adoc and yaml file
  • Code style update (formatting, renaming)
  • Refactoring (please detail in commit messages)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Relocate C code from klish-plugin-infix to stand-alone binaries we can
use also from Bash.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Fixes #701

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
@troglobit troglobit added this to the Infix v24.10 milestone Oct 16, 2024
@troglobit troglobit requested a review from wkz October 16, 2024 04:15
Copy link
Contributor

@wkz wkz left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this! ❤️

Also: great addition to get copy from the shell 👍

@troglobit troglobit merged commit 3bcc058 into main Oct 18, 2024
5 of 6 checks passed
@troglobit troglobit deleted the copy-timeout branch October 18, 2024 07:44
troglobit added a commit that referenced this pull request Oct 21, 2025
This is a follow-up to PR #717 where path traversal protection was
discussed.  A year later and it's clear that having a user-friendly
copy tool in the shell is a good thing, but that we proably want to
restrict what it can do when called from the CLI.

A sanitize flag (-s) is added to control the behavior, when used in the
shell without -s, both commands act like traditional UNIX tools and do
assume . for relative paths, and allow ../, whereas when running from
the CLI only /media/ is allowed and otherwise files are assumed to be
in $HOME or /cfg

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
troglobit added a commit that referenced this pull request Oct 23, 2025
This is a follow-up to PR #717 where path traversal protection was
discussed.  A year later and it's clear that having a user-friendly
copy tool in the shell is a good thing, but that we proably want to
restrict what it can do when called from the CLI.

A sanitize flag (-s) is added to control the behavior, when used in the
shell without -s, both commands act like traditional UNIX tools and do
assume . for relative paths, and allow ../, whereas when running from
the CLI only /media/ is allowed and otherwise files are assumed to be
in $HOME or /cfg

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
troglobit added a commit that referenced this pull request Oct 23, 2025
This is a follow-up to PR #717 where path traversal protection was
discussed.  A year later and it's clear that having a user-friendly
copy tool in the shell is a good thing, but that we proably want to
restrict what it can do when called from the CLI.

A sanitize flag (-s) is added to control the behavior, when used in the
shell without -s, both commands act like traditional UNIX tools and do
assume . for relative paths, and allow ../, whereas when running from
the CLI only /media/ is allowed and otherwise files are assumed to be
in $HOME or /cfg

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants