简体   繁体   中英

Cgi-bin scripts get run without a user?

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.

看一下apache2的suexec ,就可以以指定用户身份运行cgi。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM