3 ms·
I agree. And I agree with your bash 'whitelist'. I'd also add a hard blacklist for any serious string manipulation. A series of awks and seds look clever but th
by kinkrtyavimoodh 9y ago
I agree. And I agree with your bash 'whitelist'. I'd also add a hard blacklist for any serious string manipulation. A series of awks and seds look clever but they are quite annoying to deal with.
If it's just a bunch of cuts or tr, sure.
- aplorbust 9y ago"A series of awks and seds look clever but they are annoying to deal with." Would the following be annoying for you to deal with? #!/bin/sh sed 's/#.*//' \ | sed 's/:/#/g' \ | cat AMD64 - \ | ./qhasm-ops \ | ./qhasm-regs \ | ./qhasm-fp \ | ./qhasm-as \ | sed 's/%32/d/g' \ | sed 's/%raxd/%eax/g' \ | sed 's/%rbxd/%ebx/g' \ | sed 's/%rcxd/%ecx/g' \ | sed 's/%rdxd/%edx/g' \ | sed 's/%rsid/%esi/g' \ | sed 's/%rdid/%edi/g' \ | sed 's/%rbpd/%ebp/g' where qhasm-as and qhasm-fp are each awk scripts (222 and 427 lines, respectively). source: http://cr.yp.to/qhasm/qhasm-20061116.tar.gz http://cr.yp.to/qhasm/qhasm-20061116.tar.gz qhasm-20061116/qhasm-amd64
- DonHopkins 9y agoAnd it's SO MUCH MORE expensive to fork all those processes. Just use a real language, please.