davmac314 / dinit

Service monitoring / "init" system
Apache License 2.0
582 stars 45 forks source link

dinitctl: dinitctl will get stuck when a empty argument is passed as service_name #365

Open mobin-2008 opened 1 month ago

mobin-2008 commented 1 month ago

Describe the bug The title is self-explanatory.

To Reproduce

  1. Use dinitctl start "" or dinitctl enable "".
  2. Dinitctl is stuck because it pass a empty service name to Dinit daemon but it's unexpected and Dinit will assume that is a partial command and Dinit will wait forever.

Expected behavior It should print a error and then exit without any contact with Dinit.

Additional context I found this when I was trying to fix #363 when I accidentally used "$SRVICE" in my dinitctl commands.

davmac314 commented 5 days ago

The bug is in dinitctl, it should not accept an empty string as a service name.