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

description text within backticks is blindly executed #50

Open
oskapt opened this issue May 21, 2018 · 2 comments
Open

description text within backticks is blindly executed #50

oskapt opened this issue May 21, 2018 · 2 comments

Comments

@oskapt
Copy link

oskapt commented May 21, 2018

To report a bug...

  • What command(s) did you run?
    tasksh> start 34

  • What did you expect to happen?
    the task would start

  • What actually happened?
    the task started, and it reported that it had attempted to run sections of the description contained within backticks

tasksh> /rancher/
[task /rancher/]

ID Age Project  Tag        Description                                                                    Urg
34 9d  Personal IT ansible change `server` group to `rancher_server` and clean up old use of              1.95
                           `rancher_server`

1 task
There are local changes.  Sync required.
tasksh> start 34
[task start 34]
sh: server: command not found
sh: rancher_server: command not found
sh: rancher_server: command not found
Starting task f275c6e1 'change `server` group to `rancher_server` and clean up old use of `rancher_server`'.
Started 1 task.
Tracking IT Personal ansible "change  group to  and clean up old use of"
  Started 2018-05-21T12:22:00
  Current                  00
  Total               0:00:00
You have more urgent tasks.
Project 'Personal' is 51% complete (53 of 109 tasks remaining).
tasksh> done 34
[task done 34]
sh: server: command not found
sh: rancher_server: command not found
sh: rancher_server: command not found
Completed task f275c6e1 'change `server` group to `rancher_server` and clean up old use of `rancher_server`'.
Completed 1 task.
Recorded IT Personal ansible "change  group to  and clean up old use of"
  Started 2018-05-21T12:22:00
  Ended                 48:40
  Total               0:26:40
You have more urgent tasks.
The project 'Personal' has changed.  Project 'Personal' is 52% complete (52 of 109 tasks remaining).

Details

I write everything in markdown, so it's common for me to use backticks in descriptions to block out words/commands/code. I've only been using tasksh for one day, and today it did the stuff I've detailed above. The easy answer is to say, "don't use backticks," but I think that it's worth reporting that anything in backticks is blindly executed when starting the task.

In a worst-case scenario, this means that a task with a description like make sure that `rm -fr ~` doesn't actually delete my home directory will do nasty and unexpected things.

Some of the output is from Timewarrior, which had the backticked "commands" removed before time tracking started. I don't know if this is a problem specifically within tasksh, Taskwarrior or Timewarrior.

@ThomasAdam
Copy link

ThomasAdam commented Jun 22, 2018

From what I can tell, this would have been a taskshell bug anyway. But using both taskwarrior 2.6.0 and/or taskshell 1.3.0 (both from git), isn't leading me to reproducing your problem as stated.

Can you confirm this is the case, please?

@pbeckingham
Copy link
Member

pbeckingham commented Aug 12, 2018

Backticks are a tasksh feature. Relocating.

Edit: Not sure that I can relocate.

@tbabej tbabej transferred this issue from GothenburgBitFactory/taskwarrior Jan 2, 2019
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

3 participants