>>18674
are you referring to this:
if( ENABLE_PDF == 1 && strcasecmp( '.pdf', substr( $upfile_name, -4 ) ) == 0 ) {
$ext = '.pdf';
$W = $H = 1;
if( pclose( popen( "/usr/local/bin/gs -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE=nullpage $dest", 'w' ) ) ) {
error( S_FAILEDUPLOAD, $dest );
}
}
was 4chan actually operating with
ENABLE_PDF 1==?
because that
popen alone is enough to DoS the shit out of servers, no need for RCE's and shit.
in rust, you would simply use a library, which is yet another real-life example of why the tech illiterate /g/eet argument against cargo was always hilariously retarded. further more, easy serialization (a byproduct of the procedural macro system) means you can send data/tasks to other threads or processes trivially.
the library already exists of course. you don't have to (re)write anything. not only that, you can audit it yourself. in fact, i just did that, and it took me 3 seconds. unsafe only used in Any/AnySync (Rc and transmute shit) and in tests (mmap). otherwise,
ZERO unsafe is used.
For dependencies, it would take a few minutes more, and that's it.
so rust
wins here at every step, language, ecosystem (good and easy to use/deploy libraries), tooling (
cargo for building and package management,
cargo vendor for checking all depended on code,
cargo audit for trivially checking any known issues in dependencies). not that
winning here is much of an achievement 🙂