searchd 在没有执行权限的情况下运行配置脚本

作者: sanikolaev创建于 2025年9月11日更新于 2026年9月19日
标签bugest::size_S

问题描述:

如果一个脚本化配置文件没有执行权限,searchd仍然可以执行它,这似乎是不正确的:

cat rt.conf.sh
#!/bin/sh
echo "
searchd {
    listen = 19312
    listen = 9315:mysql41
    log = searchd.log
    pid_file = searchd.pid
    binlog_path =
}

table t {
    type = rt
    path = /tmp/test_table
    rt_field = f
    min_infix_len = 2
}
"
~ ls -la rt.conf.sh
-rw-------  1 sn  staff  237 11 Sep 17:50 rt.conf.sh
~ searchd -c rt.conf.sh
Manticore 13.6.7 1ab9ccc95@25080704 (columnar 8.0.1 fc30df6@25072219) (secondary 8.0.1 fc30df6@25072219) (knn 8.0.1 fc30df6@25072219) (embeddings 1.0.0)
Copyright (c) 2001-2016, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
Copyright (c) 2017-2025, Manticore Software LTD (https://manticoresearch.com)
[50:53.451] [39011948] using config file '/Users/sn/rt.conf.sh' (219 chars) ...
starting daemon version '13.6.7 1ab9ccc95@25080704 (columnar 8.0.1 fc30df6@25072219) (secondary 8.0.1 fc30df6@25072219) (knn 8.0.1 fc30df6@25072219) (embeddings 1.0.0)' ...
listening on all interfaces for sphinx and http(s), port=19312
listening on all interfaces for MySQL, port=9315
precaching table 't'
precached 1 tables in 0.001 sec

预期行为:searchd在提供的配置文件是没有执行权限的脚本情况下应该失败

内容来源: manticoresoftware/manticoresearch