[luatex] \pdfshellescape

luigi scarso luigi.scarso at gmail.com
Sun Dec 6 00:29:43 CET 2015


On Sat, Dec 5, 2015 at 10:51 PM, David Carlisle <d.p.carlisle at gmail.com>
wrote:

> On 5 December 2015 at 21:17, luigi scarso <luigi.scarso at gmail.com> wrote:
> >
> >
> > On Sat, Dec 5, 2015 at 6:51 PM, David Carlisle <d.p.carlisle at gmail.com>
> > wrote:
>
> >
> > try
> >
> > \directlua{print('os.execute():|',os.execute(),'|')}
> > \bye
> >
> > with  also
> > --shell-restricted
> > --no-shell-escape
> >
> > It should be ok.
> >
> >
> >
> > --
> > luigi
>
>
> Oh thanks!
>
> Hmm so os.execute with empty argument doesn't call the shell and just
> returns 0,1 or 2?
>
> I have to ask, could I have deduced that from the manual?;-)
>



The current code is

static int os_execute(lua_State * L)
{
    int allow = 0;
    int ret = 1;
    char *safecmd = NULL;
    char *cmdname = NULL;
    const char *cmd = luaL_optstring(L, 1, NULL);

    if (cmd == NULL) { /* pretend we are \.{\\pdfshellescape} */
        if (shellenabledp <= 0) {
            lua_pushinteger(L, 0);
        } else if (restrictedshell == 0) {
            lua_pushinteger(L, 1);
        } else {
            lua_pushinteger(L, 2);
        }
        return 1;
    }

:
}

but I'm not sure that this will be the final form --- maybe for this reason
it  is still to be documented.


-- 
luigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/luatex/attachments/20151206/3532eb66/attachment.html>


More information about the luatex mailing list