Re: [exim] Sqlite Lookup absolute filename (was Exim 4.94.2 …

Pàgina inicial
Delete this message
Reply to this message
Autor: Victor \"Ustugov\"
Data:  
A: Heiko Schlittermann via Exim-users
Assumpte: Re: [exim] Sqlite Lookup absolute filename (was Exim 4.94.2 - security update released)
Heiko Schlittermann via Exim-users wrote on 04.05.2021 19:29:
> Heiko Schlittermann via Exim-users <exim-users@???> (Di 04 Mai 2021 17:44:23 CEST):
>> Odhiambo Washington via Exim-users <exim-users@???> (Di 04 Mai 2021 17:00:36 CEST):
>>> On Tue, May 4, 2021 at 4:52 PM Heiko Schlittermann via Exim-users <
>>> temporarily rejected after DATA: failed to expand ACL string "${lookup
>>> sqlite,file=/var/spool/exim/db/greylist.db {SELECT host from resenders
>>> WHERE helo='${quote_sqlite:$sender_helo_name}' AND
>>> host='$sender_host_address';} {1}}": absolute file name expected for
>>> "sqlite" lookup
>>
>> I'm checking it. Give me a minute.
>> --
>> Heiko
>
> Is there any chance setting the global sqlite_dbfile option?
>
> According to the spec file
>
>     9.26 More about SQLite
>     ----------------------

>
>     SQLite is different to the other SQL lookups because a filename is required in
>     addition to the SQL query. An SQLite database is a single file, and there is no
>     daemon as in the other SQL databases.

>
>     The preferred way of specifying the file is by using the sqlite_dbfile option,
>     set to an absolute path.

>
>     A deprecated method is available, prefixing the query with the filename
>     separated by white space. This means that the path name cannot contain white
>     space. It also means that the query cannot use any tainted values, as that
>     taints the entire query including the filename - resulting in a refusal to open
>     the file.

>
>     Here is a lookup expansion example:

>
>     sqlite_dbfile = /some/thing/sqlitedb
>     ...
>     ${lookup sqlite {select name from aliases where id='userx';}}

>
>
> I cannot find any reference to the syntax you're using.
> Maybe I'm stupid.


https://lists.exim.org/lurker/message/20200606.183617.325a7016.en.html

https://git.exim.org/exim.git/commitdiff/b8514d1960e259d49ab2c84c89eba52ab993da3f?hp=4a7dca52352d0976f200b89a50825433b7551554

+There are two ways of
+specifying the file.
+The first is is by using the &%sqlite_dbfile%& main option.
+The second, which allows separate files for each query,
+is to use an option appended, comma-separated, to the &"sqlite"&
+lookup type word. The option is the word &"file"&, then an equals,
+then the filename.
+The filename in this case cannot contain whitespace or open-brace
charachters.
+.wen


> ${lookup      
>  sqlite,file=/var/spool/exim/db/greylist.db {SELECT host from resenders      
>  WHERE helo='${quote_sqlite:$sender_helo_name}' AND                          
>  host='$sender_host_address';} {1}}

>
>
>



-- 
Best wishes
Victor Ustugov        mailto:victor@corvax.kiev.ua
Skype ID: corvax_nb   JID: victor@???
public GnuPG/PGP key: https://victor.corvax.kiev.ua/corvax.asc