Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

in release note:

> ... , it reconfigures stock GCC and Clang to output a POSIX-approved polyglot format ...

Did POSIX really _approve_ this? if yes, when?



Look for “POSIX” on https://justine.lol/cosmo3/


POSIX now says:

>The input file can be of any type, but the initial portion of the file intended to be parsed according to the shell grammar [...] shall not contain the NUL character.

But the initial portion of, https://cosmo.zip/pub/cosmos/bin/cat for example, does contain the NUL character.


Cosmo author here. I'm familiar with the new rules. They were first implemented in https://github.com/freebsd/freebsd-src/commit/e0f5c1387df23c... which makes a clear intentional allowance for what APE is doing. If you look at the hex dump:

    main jart@luna:~/llamafile$ hexdump -C cat | head
    00000000  4d 5a 71 46 70 44 3d 27  0a 0a 00 10 00 f8 00 00  |MZqFpD='........|
    00000010  00 00 00 00 00 01 00 08  40 00 00 00 00 00 00 00  |........@.......|
You'll notice there's no NUL characters on the first line, and that the subsequent NULs are escaped by a single-quoted string, which is legal. The rules used to be more restrictive but they relaxed the requirements specifically so I could work on APE. Jilles Tjoelker is one of the heroes who made that possible.


[T]he initial portion doesn't mean the first line, it means the script part of a file consisting of a shell script and a binary payload, separated by `exit', `exec whatever', etc. A good example is the Oracle Developer Studio installation script.

You can write to Austin Group mailing list and ask for clarification if you want.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: