本文介绍了CGI-BIN脚本没有得到一个用户运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行需要许可证密钥驻留在用户的主目录的二进制。我在做这在二进制调用一个CGI脚本,一切都是幸福的,当我从使用sudo -u WWW的数据的二进制命令行中执行脚本。然而,当我运行从Web CGI脚本,二进制找不到许可证密钥。

I'm running a binary that requires a license key to reside in the user's home directory. I'm making a cgi script that calls upon this binary and everything is happy when I execute the script from the command line using sudo -u www-data binary. However, when I run the cgi script from the web, the binary can't find the license key.

Apache的错误日志中指出:
许可证密钥。(空)/键未找到,引用者:

The apache error log states:License key "(null)/.key" not found., referer:

这是否意味着CGI脚本不附加出于安全原因,任何用户执行的?如何才能使我的CGI脚本如此二进制知道在合适的主目录中查找运行作为WWW的数据?不幸的是,没有命令行标志指定的关键位置。

Does this mean that cgi scripts are executed without any user attached for security reasons? And how can I make cgi scripts be run as www-data so the binary knows to look in the appropriate home directory? Unfortunately, There is no command line flag to specify the key location.

推荐答案

看看配合使用,这一点,你就可以运行CGI为指定的用户。

Take a look at suexec for apache2, with that, you'll be able to run cgi as a specified user.

这篇关于CGI-BIN脚本没有得到一个用户运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 06:18
查看更多