Cgi-bin scripts get run without a user?

Deadly 提交于 2020-01-15 03:12:09

问题


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.

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

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.


回答1:


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



来源:https://stackoverflow.com/questions/7518120/cgi-bin-scripts-get-run-without-a-user

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!