davmac314 / dinit

Service monitoring / "init" system
Apache License 2.0
622 stars 49 forks source link

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

Closed mobin-2008 closed 2 months ago

mobin-2008 commented 3 months 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 2 months ago

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