aboutsummaryrefslogtreecommitdiffhomepage
path: root/notes/file_inclusion.txt
blob: 06878037703b4313741a1a0673d62bf371df324c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

File inclusion
==============

Syntax idea:
In main.slul:

    \slul 0.0.0
    ...
    \source abc.slul
    ...
    \filebytes mybuffer1 somedata.bin
    # or, alternatively, to include a BASE64 encoded file as binary:
    \fileb64 mybuffer1 somedata.b64

This is equivalent to defining the following in one of the source files:

    []byte mybuffer1 = [...]

To export the buffer, specify it's declaration in the main.slul file:

    []byte mybuffer1

Restrictions:
* File path must contain the characters a-z 0-9 _ . / only
* No component of the file path may start with a dot (.) or contain a
  double-dot (..). This prevents directory traversal attacks, as well
  as some forms of credential stealing.
* No component may start with "local", "secret" or "private". This makes
  it possible to block credential stealing by using one of these names.
* No component may be a DOS/Windows special file name (con, lpt1, nul, ...)
* If the file is a symlink, then the target (or targets, if nested)
  must follow the same rules as well. Link targets must be relative.