[Crash-utility] "char-mapper"
Dave Anderson
anderson at redhat.com
Tue Feb 21 22:09:20 UTC 2012
----- Original Message -----
> Hi Dave,
>
> Just to throw another wrench into the mix, you might find customized character
> classifications useful. First, you'd specify an interesting
> category:
>
> redirection "|!>"
>
> then you generate a table and some macros and then:
>
> p1 = BRK_REDIRECTION_CHARS(p2);
> if (*p1 != NUL) {
> fp = handle_redirection(p1);
> *p1 = NUL;
> }
>
> To play with it, install gperf and autogen, git-clone the autogen sources,
> go into autogen/add-on/char-mapper and type "make".
>
> If you use it, I recommend checking the generated source into git/svn.
> The git repo is on both sourceforge and savannah.gnu.org
>
> Anyway, thanks for the patch, though I think there may still be a problem.
> Anything after the first pipe character can be arbitrary shell. viz:
> crash-command ! cat | sed s/// > file
> which is why I recommended the char classifier stuff.
> The BRK macro stops the scan on the first match of a character from
> the REDIRECTION class of characters.
Right - a combined ! and | would also be a problem. But that's easy
enough to fix.
Thanks again,
Dave
More information about the Crash-utility
mailing list