5 ms·
Apples libc used to shell-out to perl in a function: https://github.com/Apple-FOSS-Mirror/Libc/blob/2ca2ae74647714acfc18674c3114b1a5d3325d7d/gen/wordexp.c#L192
by fs111 7y ago
Apples libc used to shell-out to perl in a function: https://github.com/Apple-FOSS-Mirror/Libc/blob/2ca2ae74647714acfc18674c3114b1a5d3325d7d/gen/wordexp.c#L192 https://github.com/Apple-FOSS-Mirror/Libc/blob/2ca2ae7464771...
- f00zz 7y ago/* XXX this is _not_ designed to be fast */
- vectorEQ 7y agoit is hard to do without a subshell). It is probbably just plan a Bad Idea to call in anything setuid, or executing remotely. */ laughing so hard :')
- imglorp 7y agoO_o
- tus88 7y agoThat's hilarious. You're not supposed to go the other direction libc!
- stefan_ 7y agoI thought this is what the Unix philosophy is supposed to be all about. (Realistically, calling wordexp should just abort the program. Now I actually want to make a hacked up musl that aborts in all the various "libc functions no one should ever use" and see how far I get into a Ubuntu boot..)
- f00zz 7y agoWould be pretty awesome if Perl called wordexp(3) somewhere along this code path
- microtherion 7y agoI seem to recall that perl used to shell out to /bin/sh for some related task...
- microtherion 7y agoYep, still there in the latest perl5: Perl_start_glob https://github.com/Perl/perl5/blob/blead/doio.c https://github.com/Perl/perl5/blob/blead/doio.c It's somewhat messier than I remember, because it uses csh as the first choice and falls back to sh.
- ericfrederich 7y ago/* wordexp is also rife with security "challenges", unless you pass it WRDE_NOCMD it must support subshell expansion, and even if you don't beause it has to support so much of the standard shell (all the odd little variable expansion options for example) it is hard to do without a subshell). It is probbably just plan a Bad Idea to call in anything setuid, or executing remotely. */
- xienze 7y ago> I thought this is what the Unix philosophy is supposed to be all about. Perhaps from the perspective of an end user running things from a shell. Generally speaking though, shelling out from within a program is not ideal.
- benj111 7y agoWhich raises the question what libc functions perl calls... And imagine the debug errors: >perl error X "But I'm just calling libc ?!?"
- peterwwillis 7y agoWhat if Perl uses libc ?????
- ImNotTheNSA 7y agothen it calls the Perl implementation... is there some nuance of perl that would cause a problem with that?
- lathiat 7y agoSo if Perl uses libc, which shells put to perl, which uses libc... get it? :)
- zerocrates 7y agoThey're jokingly positing a loop: libc shells to perl, perl implements the function via libc call, which shells to perl... and so on.
- saagarjha 7y agoIt does on my system: $ otool -L /usr/bin/perl /usr/bin/perl: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1663.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.0.0)
- masklinn 7y agoThat's not an issue unless perl calls wordexp (as part of the stuff it does when called by wordexp).
- gbacon 7y agoDie ganzen Zahlen hat der liebe Gott gemacht, alles andere ist Menschenwerk. https://en.wikipedia.org/wiki/Leopold_Kronecker https://en.wikipedia.org/wiki/Leopold_Kronecker