public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Loading local lua
@ 2021-08-12  8:43 William Lupton
       [not found] ` <CAEe_xxhAWWYZO5C4sdwSEpRGiavcNg-6JzWvGjMtzOs5rFjDuw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: William Lupton @ 2021-08-12  8:43 UTC (permalink / raw)
  To: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 1866 bytes --]

Hello,

My lua filters and writers all do "local utils = require 'utils'" to load
utils.lua from my user data dir.

I recently upgraded from pandoc 2.11.4 (23 Jan) to 2.14.1 (18 Jul) and
therefore this stopped working, as discussed here:

   - Lua filter can not find lua package in data-dir
   <https://groups.google.com/g/pandoc-discuss/c/rMfK9i9ZdWs/m/GmsnnHNqAQAJ>
(predates
   pandoc 2.12)
   - Using require on Lua filter doesn't work anymore in Pandoc 2.12
   <https://groups.google.com/g/pandoc-discuss/c/1wmM9ZzP9pw/m/O3wns027AAAJ>

Following the advice in the second thread, I ended up setting LUA_PATH. I
preferred this solution because it didn't involve changing any source files.

My pandoc command used to be "pandoc --data-dir=$DATADIR ..." and is now
"LUA_PATH=$DATADIR/?.lua pandoc --data-dir=$DATADIR ..." so it seems to me
that I must be subverting the fix to any security problems that were fixed
by not searching the user data dir!

I'm wondering whether it might be possible to restore searching of the user
data dir, possibly with some restrictions to prevent things like overriding
pandoc.List. It would be really nice to be able to use a simple "require".

Thanks,
William

PS, Note that utils.lua isn't in the same directory as the filters or
writers. These are in $DATADIR/filters and $DATADIR/writers, whereas
utils.lua is in the parent $DATADIR. I'd be happy to put utils.lua in some
other $DATADIR sub-directory.

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAEe_xxhAWWYZO5C4sdwSEpRGiavcNg-6JzWvGjMtzOs5rFjDuw%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 2472 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-08-12 16:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-12  8:43 Loading local lua William Lupton
     [not found] ` <CAEe_xxhAWWYZO5C4sdwSEpRGiavcNg-6JzWvGjMtzOs5rFjDuw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-08-12  9:47   ` BPJ
     [not found]     ` <CADAJKhAOStn6WUCQ2eNPGU+dZD9GETR8ktHJXzk00A=zo0S1dQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-08-12 11:22       ` William Lupton
     [not found]         ` <CAEe_xxjLNvz4afJuwDhBqc0rnnQ=h5_i3W3s_VPuQTSx0WfqqQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-08-12 16:00           ` BPJ
     [not found]             ` <CADAJKhBfbdHs74_HGSnfMzBNy6TD=+qC1k0MWG4_kh2Kfp-nzA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-08-12 16:09               ` William Lupton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).