Comment 2 for bug 1590767

Revision history for this message
Martin Lund (martin-lund) wrote :

@jdstrand:

Running the completion script confined is a good idea but does it require maybe too much infrastructure? I don't know.

For each snap which includes a completion script snapcraft could generate a trusted frontend completion script which automatically gets sourced by the users bash session. This frontend script then feeds the required completion arguments (name of requesting app, COMPWORDS, COMPCWORD, etc.) to a named fifo pipe, named "snap-completion" (as suggested) connected to a confined server process "snap-completer" which, for each completion request, spawns off another confined bash completion which runs the original completion script (backend) and writes back the response so that in the end the frotend script can recreate COMPREPLY().

Also, as mentioned on irc, some sort of sane character filtering is required to avoid malicious feedback in completion results returned to the frontend script.