[Bug 10371] New: shell (ash?) PS1 can cause infinite loop of "sh: syntax error: unterminated quoted string"

bugzilla at busybox.net bugzilla at busybox.net
Fri Oct 6 15:12:57 UTC 2017


https://bugs.busybox.net/show_bug.cgi?id=10371

            Bug ID: 10371
           Summary: shell (ash?) PS1 can cause infinite loop of "sh:
                    syntax error: unterminated quoted string"
           Product: Busybox
           Version: unspecified
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Other
          Assignee: unassigned at busybox.net
          Reporter: avihpit at yahoo.com
                CC: busybox-cvs at busybox.net
  Target Milestone: ---

Tested With (git master) busybox sh, as well as earlier pre-built busybox
versions, and on more than one platform.

Try to set PS1 as follows, notice the missing end-quote for date's format:

export PS1='$(date "+%H:%M:%S) > '

The shell enters infinite loop of printing:
"sh: syntax error: unterminated quoted string"

I could not abort it with ^C, ^D or ^Z, and had to kill busybox from elsewhere.

I got the same issue with unterminated quote in printf at the subshell.

I could _not_ reproduce the issue with other errors. E.g. I tried non-existing
commands or other syntax errors, and it just printed the error as part of the
prompt - reasonable behavior.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the busybox-cvs mailing list